diff options
Diffstat (limited to 'hw/xfree86/os-support')
-rw-r--r-- | hw/xfree86/os-support/hurd/hurd_mmap.c | 12 | ||||
-rw-r--r-- | hw/xfree86/os-support/hurd/hurd_video.c | 27 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_video.c | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/sigio.c | 9 |
4 files changed, 26 insertions, 24 deletions
diff --git a/hw/xfree86/os-support/hurd/hurd_mmap.c b/hw/xfree86/os-support/hurd/hurd_mmap.c index ccef5f218..3f942aaca 100644 --- a/hw/xfree86/os-support/hurd/hurd_mmap.c +++ b/hw/xfree86/os-support/hurd/hurd_mmap.c @@ -39,8 +39,8 @@ int xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) { - mach_port_t device,iopl_dev; - memory_object_t iopl_mem; + mach_port_t device,mem_dev; + memory_object_t mem_obj; vm_address_t addr = (vm_address_t)0; /* serach starting address */ kern_return_t err; @@ -51,14 +51,14 @@ xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) errno = err; FatalError("xf86ReadBIOS() can't get_privileged_ports. (%s)\n",strerror(errno)); } - err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev); + err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev); mach_port_deallocate (mach_task_self (), device); if( err ) { errno = err; FatalError("xf86ReadBIOS() can't device_open. (%s)\n",strerror(errno)); } - err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&iopl_mem,0); + err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&mem_obj,0); if( err ) { errno = err; @@ -69,13 +69,13 @@ xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) BIOS_SIZE, 0, TRUE, - iopl_mem, + mem_obj, Base, FALSE, VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE, VM_INHERIT_SHARE); - mach_port_deallocate(mach_task_self(),iopl_mem); + mach_port_deallocate(mach_task_self(),mem_obj); if( err ) { errno = err; diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index 4a99db375..39f353bd3 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -44,8 +44,8 @@ static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) { - mach_port_t device,iopl_dev; - memory_object_t iopl_mem; + mach_port_t device,mem_dev; + memory_object_t mem_obj; kern_return_t err; vm_address_t addr=(vm_address_t)0; @@ -55,7 +55,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) errno = err; FatalError("xf86MapVidMem() can't get_privileged_ports. (%s)\n",strerror(errno)); } - err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev); + err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev); mach_port_deallocate (mach_task_self(), device); if( err ) { @@ -63,7 +63,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) FatalError("xf86MapVidMem() can't device_open. (%s)\n",strerror(errno)); } - err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&iopl_mem,0); + err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&mem_obj,0); if( err ) { errno = err; @@ -74,23 +74,23 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) Size, 0, /* mask */ TRUE, /* anywhere */ - iopl_mem, + mem_obj, (vm_offset_t)Base, FALSE, /* copy on write */ VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE, VM_INHERIT_SHARE); - mach_port_deallocate(mach_task_self(),iopl_mem); + mach_port_deallocate(mach_task_self(),mem_obj); if( err ) { errno = err; - FatalError("xf86MapVidMem() can't vm_map.(iopl_mem) (%s)\n",strerror(errno)); + FatalError("xf86MapVidMem() can't vm_map.(mem_obj) (%s)\n",strerror(errno)); } - mach_port_deallocate(mach_task_self(),iopl_dev); + mach_port_deallocate(mach_task_self(),mem_dev); if( err ) { errno = err; - FatalError("xf86MapVidMem() can't mach_port_deallocate.(iopl_dev) (%s)\n",strerror(errno)); + FatalError("xf86MapVidMem() can't mach_port_deallocate.(mem_dev) (%s)\n",strerror(errno)); } return (pointer)addr; } @@ -124,8 +124,17 @@ xf86EnableIO() FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno)); return FALSE; } +#if 0 + /* + * Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these + * ports, and the int10 wrapper is not emulating them. (Note that it's + * effectively what happens in the Linux variant too, as iopl() is used + * there, making the ioperm() meaningless.) + * + * Reenable this when int10 gets fixed. */ ioperm(0x40,4,0); /* trap access to the timer chip */ ioperm(0x60,4,0); /* trap access to the keyboard controller */ +#endif return TRUE; } diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index b97757c9b..39c728d9e 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -530,6 +530,8 @@ xf86EnableIO(void) return FALSE; } # if !defined(__alpha__) + /* XXX: this is actually not trapping anything because of iopl(3) + * above */ ioperm(0x40,4,0); /* trap access to the timer chip */ ioperm(0x60,4,0); /* trap access to the keyboard controller */ # endif diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index aed5654e8..274a8ab7e 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -1,4 +1,3 @@ - /* sigio.c -- Support for SIGIO handler installation and removal * Created: Thu Jun 3 15:39:18 1999 by faith@precisioninsight.com * @@ -67,14 +66,6 @@ # include <stropts.h> #endif -/* - * Linux libc5 defines FASYNC, but not O_ASYNC. Don't know if it is - * functional or not. - */ -#if defined(FASYNC) && !defined(O_ASYNC) -# define O_ASYNC FASYNC -#endif - #ifdef MAXDEVICES /* MAXDEVICES represents the maximimum number of input devices usable * at the same time plus one entry for DRM support. |