]> mj.ucw.cz Git - pciutils.git/blob - lib/i386-io-djgpp.h
win32-cfgmgr32: Clean up initialization
[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.
7  */
8
9 #include <pc.h>
10 #include <dos.h>
11 #define outb(x,y) outportb(y, x)
12 #define outw(x,y) outportw(y, x)
13 #define outl(x,y) outportl(y, x)
14
15 #define inb  inportb
16 #define inw  inportw
17 #define inl  inportl
18
19 static int irq_enabled;
20
21 static int
22 intel_setup_io(struct pci_access *a UNUSED)
23 {
24   return 1;
25 }
26
27 static inline void
28 intel_cleanup_io(struct pci_access *a UNUSED)
29 {
30 }
31
32 static inline void intel_io_lock(void)
33 {
34   asm volatile("" : : : "memory");
35   irq_enabled = disable();
36 }
37
38 static inline void intel_io_unlock(void)
39 {
40   asm volatile("" : : : "memory");
41   if (irq_enabled) {
42     enable();
43   }
44 }