]> git.ipfire.org Git - thirdparty/pciutils.git/blame - lib/i386-io-djgpp.h
Update license comments and added SPDX license identifiers
[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 *
61829219
MM
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
5c5ce192
RM
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
21static int irq_enabled;
22
23static int
24intel_setup_io(struct pci_access *a UNUSED)
25{
26 return 1;
27}
28
b9803586 29static inline void
5c5ce192
RM
30intel_cleanup_io(struct pci_access *a UNUSED)
31{
5c5ce192
RM
32}
33
34static inline void intel_io_lock(void)
35{
36 asm volatile("" : : : "memory");
37 irq_enabled = disable();
38}
39
40static inline void intel_io_unlock(void)
41{
42 asm volatile("" : : : "memory");
43 if (irq_enabled) {
44 enable();
45 }
46}