diff options
Diffstat (limited to 'libdha/sysdep')
-rw-r--r-- | libdha/sysdep/pci_386bsd.c | 13 | ||||
-rw-r--r-- | libdha/sysdep/pci_bsdi.c | 13 | ||||
-rw-r--r-- | libdha/sysdep/pci_freebsd.c | 13 | ||||
-rw-r--r-- | libdha/sysdep/pci_isc.c | 6 | ||||
-rw-r--r-- | libdha/sysdep/pci_linux.c | 13 | ||||
-rw-r--r-- | libdha/sysdep/pci_mach386.c | 10 | ||||
-rw-r--r-- | libdha/sysdep/pci_netbsd.c | 13 | ||||
-rw-r--r-- | libdha/sysdep/pci_openbsd.c | 10 | ||||
-rw-r--r-- | libdha/sysdep/pci_os2.c | 10 | ||||
-rw-r--r-- | libdha/sysdep/pci_sco.c | 6 | ||||
-rw-r--r-- | libdha/sysdep/pci_svr4.c | 6 | ||||
-rw-r--r-- | libdha/sysdep/pci_win32.c | 6 |
12 files changed, 77 insertions, 42 deletions
diff --git a/libdha/sysdep/pci_386bsd.c b/libdha/sysdep/pci_386bsd.c index a8040d60ad..d00ecb0785 100644 --- a/libdha/sysdep/pci_386bsd.c +++ b/libdha/sysdep/pci_386bsd.c @@ -3,6 +3,7 @@ $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ Modified for readability by Nick Kurshev */ +#include <errno.h> #include <sys/file.h> #include <machine/console.h> #ifndef GCCUSESGAS @@ -11,25 +12,27 @@ static int io_fd; -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { io_fd = -1 ; if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) { perror("/dev/console"); - exit(1); + return(errno); } if (ioctl(io_fd, KDENABIO, 0) < 0) { perror("ioctl(KDENABIO)"); - exit(1); + return(errno); } + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { if (ioctl(io_fd, KDDISABIO, 0) < 0) { perror("ioctl(KDDISABIO)"); close(io_fd); - exit(1); + return(errno); } close(io_fd); + return(0); } diff --git a/libdha/sysdep/pci_bsdi.c b/libdha/sysdep/pci_bsdi.c index 1e7b877a3b..b6b142054d 100644 --- a/libdha/sysdep/pci_bsdi.c +++ b/libdha/sysdep/pci_bsdi.c @@ -3,6 +3,7 @@ $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ Modified for readability by Nick Kurshev */ +#include <errno.h> #include <sys/file.h> #include <sys/ioctl.h> #include <i386/isa/pcconsioctl.h> @@ -12,25 +13,27 @@ static int io_fd; -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { io_fd = -1 ; if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) { perror("/dev/console"); - exit(1); + return(errno); } if (ioctl(io_fd, PCCONENABIOPL, 0) < 0) { perror("ioctl(PCCONENABIOPL)"); - exit(1); + return(errno); } + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { if (ioctl(io_fd, PCCONDISABIOPL, 0) < 0) { perror("ioctl(PCCONDISABIOPL)"); close(io_fd); - exit(1); + return(errno); } close(io_fd); + return(0); } diff --git a/libdha/sysdep/pci_freebsd.c b/libdha/sysdep/pci_freebsd.c index a8040d60ad..dd93d90d68 100644 --- a/libdha/sysdep/pci_freebsd.c +++ b/libdha/sysdep/pci_freebsd.c @@ -3,6 +3,7 @@ $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ Modified for readability by Nick Kurshev */ +#include <errno.h> #include <sys/file.h> #include <machine/console.h> #ifndef GCCUSESGAS @@ -11,25 +12,27 @@ static int io_fd; -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { io_fd = -1 ; if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) { perror("/dev/console"); - exit(1); + return(errno); } if (ioctl(io_fd, KDENABIO, 0) < 0) { perror("ioctl(KDENABIO)"); - exit(1); + return(errno); } + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { if (ioctl(io_fd, KDDISABIO, 0) < 0) { perror("ioctl(KDDISABIO)"); close(io_fd); - exit(1); + return(errno); } close(io_fd); + return(0); } diff --git a/libdha/sysdep/pci_isc.c b/libdha/sysdep/pci_isc.c index 0fabba5972..5b5a591824 100644 --- a/libdha/sysdep/pci_isc.c +++ b/libdha/sysdep/pci_isc.c @@ -11,20 +11,22 @@ #include <sys/sysi86.h> #include <sys/v86.h> -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 3); #else sysi86(SI86V86, V86SC_IOPL, PS_IOPL); #endif + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 0); #else sysi86(SI86V86, V86SC_IOPL, 0); #endif + return(0); } diff --git a/libdha/sysdep/pci_linux.c b/libdha/sysdep/pci_linux.c index 96a520b65d..f4b46990a4 100644 --- a/libdha/sysdep/pci_linux.c +++ b/libdha/sysdep/pci_linux.c @@ -3,18 +3,23 @@ $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ Modified for readability by Nick Kurshev */ +#include <errno.h> #ifdef __i386__ #include <sys/perm.h> #else #include <sys/io.h> #endif -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { - iopl(3); + if (iopl(3) != 0) + return(errno); + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { - iopl(0); + if (iopl(0) != 0) + return(errno); + return(0); } diff --git a/libdha/sysdep/pci_mach386.c b/libdha/sysdep/pci_mach386.c index 32e2a657ff..31621862b8 100644 --- a/libdha/sysdep/pci_mach386.c +++ b/libdha/sysdep/pci_mach386.c @@ -4,18 +4,22 @@ Modified for readability by Nick Kurshev */ +#include <errno.h> + static int io_fd; -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { io_fd = -1 ; if ((io_fd = open("/dev/iopl", O_RDWR, 0)) < 0) { perror("/dev/iopl"); - exit(1); + return(errno); } + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { close(io_fd); + return(0); } diff --git a/libdha/sysdep/pci_netbsd.c b/libdha/sysdep/pci_netbsd.c index 19fa771fbd..793944beba 100644 --- a/libdha/sysdep/pci_netbsd.c +++ b/libdha/sysdep/pci_netbsd.c @@ -3,6 +3,7 @@ $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ Modified for readability by Nick Kurshev */ +#include <errno.h> #include <sys/param.h> #include <sys/file.h> #include <machine/sysarch.h> @@ -12,30 +13,32 @@ static int io_fd; -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { io_fd = -1 ; #if !defined(USE_I386_IOPL) if ((io_fd = open("/dev/io", O_RDWR, 0)) < 0) { perror("/dev/io"); - exit(1); + return(errno); } #else if (i386_iopl(1) < 0) { perror("i386_iopl"); - exit(1); + return(errno); } #endif /* USE_I386_IOPL */ + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { #if !defined(USE_I386_IOPL) close(io_fd); #else if (i386_iopl(0) < 0) { perror("i386_iopl"); - exit(1); + return(errno); } #endif /* NetBSD1_1 */ + return(0); } diff --git a/libdha/sysdep/pci_openbsd.c b/libdha/sysdep/pci_openbsd.c index ef835b405f..387335c236 100644 --- a/libdha/sysdep/pci_openbsd.c +++ b/libdha/sysdep/pci_openbsd.c @@ -4,15 +4,19 @@ Modified for readability by Nick Kurshev */ -static __inline__ void enable_os_io(void) +#include <errno.h> + +static __inline__ int enable_os_io(void) { if (i386_iopl(1) < 0) { perror("i386_iopl"); - exit(1); + return(errno); } + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { /* Nothing to do */ + return(0); } diff --git a/libdha/sysdep/pci_os2.c b/libdha/sysdep/pci_os2.c index 4f0df53b30..ddfc0c0ea6 100644 --- a/libdha/sysdep/pci_os2.c +++ b/libdha/sysdep/pci_os2.c @@ -8,7 +8,7 @@ static USHORT callgate[3] = {0,0,0}; -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { HFILE hfd; ULONG dlen,action; @@ -21,7 +21,7 @@ static __inline__ void enable_os_io(void) (ULONG)0) != 0) { fprintf(stderr,"Error opening fastio$ driver...\n"); fprintf(stderr,"Please install xf86sup.sys in config.sys!\n"); - exit(42); + return(42); } callgate[0] = callgate[1] = 0; @@ -34,7 +34,7 @@ static __inline__ void enable_os_io(void) fprintf(stderr,"xf86-OS/2: EnableIOPorts failed, rc=%d, dlen=%d; emergency exit\n", rc,dlen); DosClose(hfd); - exit(42); + return(42); } /* Calling callgate with function 13 sets IOPL for the program */ @@ -45,9 +45,11 @@ static __inline__ void enable_os_io(void) : "eax","ebx","ecx","edx","cc"); DosClose(hfd); + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { /* Nothing to do */ + return(0); } diff --git a/libdha/sysdep/pci_sco.c b/libdha/sysdep/pci_sco.c index 1d5c355989..9cb2282ada 100644 --- a/libdha/sysdep/pci_sco.c +++ b/libdha/sysdep/pci_sco.c @@ -12,20 +12,22 @@ #include <sys/sysi86.h> #include <sys/v86.h> -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 3); #else sysi86(SI86V86, V86SC_IOPL, PS_IOPL); #endif + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 0); #else sysi86(SI86V86, V86SC_IOPL, 0); #endif + return(0); } diff --git a/libdha/sysdep/pci_svr4.c b/libdha/sysdep/pci_svr4.c index 7acdd9f3e4..fd8b9cbfec 100644 --- a/libdha/sysdep/pci_svr4.c +++ b/libdha/sysdep/pci_svr4.c @@ -19,20 +19,22 @@ #define __EXTENSIONS__ #endif -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 3); #else sysi86(SI86V86, V86SC_IOPL, PS_IOPL); #endif + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 0); #else sysi86(SI86V86, V86SC_IOPL, 0); #endif + return(0); } diff --git a/libdha/sysdep/pci_win32.c b/libdha/sysdep/pci_win32.c index 363fa23485..1c88cb13e8 100644 --- a/libdha/sysdep/pci_win32.c +++ b/libdha/sysdep/pci_win32.c @@ -7,10 +7,12 @@ /* Nothing to do for Win9x. For WinNT I have no solution */ -static __inline__ void enable_os_io(void) +static __inline__ int enable_os_io(void) { + return(0); } -static __inline__ void disable_os_io(void) +static __inline__ int disable_os_io(void) { + return(0); } |