[Mplayer-cvslog] CVS: main/libdha/sysdep pci_386bsd.c,1.1,1.2 pci_bsdi.c,1.1,1.2 pci_freebsd.c,1.1,1.2 pci_isc.c,1.1,1.2 pci_linux.c,1.1,1.2 pci_mach386.c,1.1,1.2 pci_netbsd.c,1.1,1.2 pci_openbsd.c,1.1,1.2 pci_os2.c,1.1,1.2 pci_sco.c,1.1,1.2 pci_svr4.c,1.1,1.2 pci_win32.c,1.1,1.2
Alex Beregszaszi
alex at mplayer.dev.hu
Tue Jan 15 16:59:56 CET 2002
Update of /cvsroot/mplayer/main/libdha/sysdep
In directory mplayer:/var/tmp.root/cvs-serv3325/sysdep
Modified Files:
pci_386bsd.c pci_bsdi.c pci_freebsd.c pci_isc.c pci_linux.c
pci_mach386.c pci_netbsd.c pci_openbsd.c pci_os2.c pci_sco.c
pci_svr4.c pci_win32.c
Log Message:
api changed: enable/disable_os_io returns error-code (or zero if ok) and pciconfig_read exported for mga_vid
Index: pci_386bsd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_386bsd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_386bsd.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_386bsd.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_bsdi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_bsdi.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_bsdi.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_bsdi.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_freebsd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_freebsd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_freebsd.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_freebsd.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_isc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_isc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_isc.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_isc.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_linux.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_linux.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_linux.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_linux.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_mach386.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_mach386.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_mach386.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_mach386.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_netbsd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_netbsd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_netbsd.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_netbsd.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_openbsd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_openbsd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_openbsd.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_openbsd.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_os2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_os2.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_os2.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_os2.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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 @@
(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 @@
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 @@
: "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);
}
Index: pci_sco.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_sco.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_sco.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_sco.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_svr4.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_svr4.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_svr4.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_svr4.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
Index: pci_win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/sysdep/pci_win32.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pci_win32.c 15 Jan 2002 08:31:53 -0000 1.1
+++ pci_win32.c 15 Jan 2002 15:59:53 -0000 1.2
@@ -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);
}
More information about the MPlayer-cvslog
mailing list