From 99e4ddabfe6401c16247fe60b59582428afadba6 Mon Sep 17 00:00:00 2001 From: marschap Date: Wed, 6 Apr 2005 15:30:25 +0000 Subject: [PATCH] included modified version of M.Dolze's patch patch_drivers_port from his web site --- server/drivers/port.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/drivers/port.h b/server/drivers/port.h index 1e579ff..9ba3ee8 100644 --- a/server/drivers/port.h +++ b/server/drivers/port.h @@ -229,6 +229,8 @@ Use i386_get_ioperm, i386_set_ioperm from and inb and outb f #include #include #include + +static FILE * port_access_handle = NULL; /* Read a byte from port */ static inline int port_in (unsigned short port) { @@ -247,7 +249,16 @@ static inline int port_access (unsigned short port) { /* Get access to multiple ports at once */ static inline int port_access_multiple (unsigned short port, unsigned short count) { +#if (__FreeBSD_version > 500000) + if( port_access_handle + || (port_access_handle = fopen("/dev/io", "rw")) != NULL ) { + return i386_set_ioperm(port, count, 1); + } else { + return( -1 ); /* Failure */ + }; +#else return i386_set_ioperm(port, count, 1); +#endif } /* Close access to a specific port */