]> git.ipfire.org Git - thirdparty/pciutils.git/blob - lib/i386-io-djgpp.h
Update license comments and added SPDX license identifiers
[thirdparty/pciutils.git] / lib / i386-io-djgpp.h
1 /*
2 * The PCI Library -- Access to i386 I/O ports on DJGPP
3 *
4 * Copyright (c) 2010, 2017 Rudolf Marek <r.marek@assembler.cz>
5 *
6 * Can be freely distributed and used under the terms of the GNU GPL v2+
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11 #include <pc.h>
12 #include <dos.h>
13 #define outb(x,y) outportb(y, x)
14 #define outw(x,y) outportw(y, x)
15 #define outl(x,y) outportl(y, x)
16
17 #define inb inportb
18 #define inw inportw
19 #define inl inportl
20
21 static int irq_enabled;
22
23 static int
24 intel_setup_io(struct pci_access *a UNUSED)
25 {
26 return 1;
27 }
28
29 static inline void
30 intel_cleanup_io(struct pci_access *a UNUSED)
31 {
32 }
33
34 static inline void intel_io_lock(void)
35 {
36 asm volatile("" : : : "memory");
37 irq_enabled = disable();
38 }
39
40 static inline void intel_io_unlock(void)
41 {
42 asm volatile("" : : : "memory");
43 if (irq_enabled) {
44 enable();
45 }
46 }