drivers/libdha/sysdep/pci_mach386.c
raw| 1 | /* |
| 2 | This file is based on: |
| 3 | $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ |
| 4 | Modified for readability by Nick Kurshev |
| 5 | */ |
| 6 | |
| 7 | #include <errno.h> |
| 8 | |
| 9 | static int io_fd; |
| 10 | |
| 11 | static __inline__ int enable_os_io(void) |
| 12 | { |
| 13 | io_fd = -1 ; |
| 14 | if ((io_fd = open("/dev/iopl", O_RDWR, 0)) < 0) { |
| 15 | perror("/dev/iopl"); |
| 16 | return(errno); |
| 17 | } |
| 18 | return(0); |
| 19 | } |
| 20 | |
| 21 | static __inline__ int disable_os_io(void) |
| 22 | { |
| 23 | close(io_fd); |
| 24 | return(0); |
| 25 | } |