summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-11-11 12:54:46 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-11-11 12:54:46 +1000
commit88cb61e1e55c54982b90e2a77465faaac6a0ba89 (patch)
tree0798bc507e7b088e2bdeadd29888a4bd092b036d /hw/xfree86/os-support
parent19f43836d1006d253391926e880b14ed2e7a0cf8 (diff)
parent4ed4915bc0fbe9b4419ca4a0d4e43c2fee032ae9 (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-api
Conflicts: dix/getevents.c hw/xfree86/common/xf86Xinput.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/xfree86/os-support')
-rw-r--r--hw/xfree86/os-support/hurd/hurd_mmap.c12
-rw-r--r--hw/xfree86/os-support/hurd/hurd_video.c27
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c2
-rw-r--r--hw/xfree86/os-support/shared/sigio.c9
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.