]> git.ipfire.org Git - thirdparty/pciutils.git/blame - lib/i386-io-djgpp.h
README.Windows: Replaced broken link to winio
[thirdparty/pciutils.git] / lib / i386-io-djgpp.h
CommitLineData
5c5ce192
RM
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
19static int irq_enabled;
20
21static int
22intel_setup_io(struct pci_access *a UNUSED)
23{
24 return 1;
25}
26
27static inline int
28intel_cleanup_io(struct pci_access *a UNUSED)
29{
30 return 1;
31}
32
33static inline void intel_io_lock(void)
34{
35 asm volatile("" : : : "memory");
36 irq_enabled = disable();
37}
38
39static inline void intel_io_unlock(void)
40{
41 asm volatile("" : : : "memory");
42 if (irq_enabled) {
43 enable();
44 }
45}