diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:24:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:24:33 +0000 |
commit | 7a19c99f661602b67db95fd1d8aca5fe3a387441 (patch) | |
tree | 215ff04ec522779fa83acf394d296c2356c6b382 /lib/i386-io-djgpp.h | |
parent | Initial commit. (diff) | |
download | pciutils-80b48659d5b3bdd36c7b3c9d0c0331ff0d08e44f.tar.xz pciutils-80b48659d5b3bdd36c7b3c9d0c0331ff0d08e44f.zip |
Adding upstream version 1:3.9.0.upstream/1%3.9.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | lib/i386-io-djgpp.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/i386-io-djgpp.h b/lib/i386-io-djgpp.h new file mode 100644 index 0000000..53f2f4e --- /dev/null +++ b/lib/i386-io-djgpp.h @@ -0,0 +1,44 @@ +/* + * The PCI Library -- Access to i386 I/O ports on DJGPP + * + * Copyright (c) 2010, 2017 Rudolf Marek <r.marek@assembler.cz> + * + * Can be freely distributed and used under the terms of the GNU GPL. + */ + +#include <pc.h> +#include <dos.h> +#define outb(x,y) outportb(y, x) +#define outw(x,y) outportw(y, x) +#define outl(x,y) outportl(y, x) + +#define inb inportb +#define inw inportw +#define inl inportl + +static int irq_enabled; + +static int +intel_setup_io(struct pci_access *a UNUSED) +{ + return 1; +} + +static inline void +intel_cleanup_io(struct pci_access *a UNUSED) +{ +} + +static inline void intel_io_lock(void) +{ + asm volatile("" : : : "memory"); + irq_enabled = disable(); +} + +static inline void intel_io_unlock(void) +{ + asm volatile("" : : : "memory"); + if (irq_enabled) { + enable(); + } +} |