[PATCH,HURD] Fix use of deprecated iopl device
Samuel Thibault
samuel.thibault at ens-lyon.org
Sat Oct 23 13:42:33 PDT 2010
This fixes Xserver on GNU/Hurd into using the "mem" device instead of
the deprecated "iopl" device.
Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
diff --git a/hw/xfree86/os-support/hurd/hurd_mmap.c b/hw/xfree86/os-support/hurd/hurd_mmap.c
index ccef5f2..3f942aa 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 4a99db3..3d7af40 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;
}
More information about the xorg-devel
mailing list