debian/changelog                       |    7 +++
 debian/patches/24_hurd_ioperm_fix.diff |   64 +++++++++++++++++++++++++++++++++
 debian/patches/series                  |    1 
 3 files changed, 72 insertions(+)

New commits:
commit 6d548942f58f6e6ff0ac89f82100c0bb056d9499
Author: Brice Goglin <[EMAIL PROTECTED]>
Date:   Fri May 11 02:45:25 2007 +0200

    Add 24_hurd_ioperm_fix.diff to fix xf86Enable/DisableIO on Hurd with recent 
GNU Mach.

diff --git a/debian/changelog b/debian/changelog
index 63eb057..c38ff5e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.3.0.0.dfsg-5) UNRELEASED; urgency=low
+
+  * Add 24_hurd_ioperm_fix.diff to fix xf86Enable/DisableIO on Hurd with
+    recent GNU Mach. Thanks Samuel Thibault!
+
+ -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 11 May 2007 02:37:19 +0200
+
 xorg-server (2:1.3.0.0.dfsg-4) unstable; urgency=low
 
   * Cherry-pick patch from upstream git to fix security issue in the Xrender
diff --git a/debian/patches/24_hurd_ioperm_fix.diff 
b/debian/patches/24_hurd_ioperm_fix.diff
new file mode 100644
index 0000000..d2ff452
--- /dev/null
+++ b/debian/patches/24_hurd_ioperm_fix.diff
@@ -0,0 +1,64 @@
+--- a/hw/xfree86/os-support/hurd/hurd_video.c.orig     2007-05-08 
18:28:21.000842117 +0000
++++ b/hw/xfree86/os-support/hurd/hurd_video.c  2007-05-08 18:27:37.000381314 
+0000
+@@ -117,49 +117,29 @@
+ /**************************************************************************
+  * I/O Permissions section                                                 
+  ***************************************************************************/
+-mach_port_t io_port;
++
++/*
++ * Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
++ * this.
++ */
++extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on);
+ 
+ Bool
+ xf86EnableIO()
+ {
+-    mach_port_t device;
+-    kern_return_t err;
+-
+-    err = get_privileged_ports(NULL, &device);
+-    if( err )
+-    {
+-      errno = err;
+-      FatalError("xf86EnableIO() can't get_privileged_ports. 
(%s)\n",strerror(errno));
+-    }
+-    err = device_open(device,D_READ|D_WRITE,"io",&io_port);
+-    mach_port_deallocate(mach_task_self(), device);
+-    if( err )
+-    {
+-      errno = err;
+-      FatalError("xf86EnableIO() can't device_open. (%s)\n",strerror(errno));
+-    }
+-
+-    err = i386_io_port_add(mach_thread_self (), io_port);
+-    if( err )
+-    {
+-      errno = err;
+-      FatalError("xf86EnableIO() can't i386_io_port_add.(io_port) 
(%s)\n",strerror(errno));
++    if (ioperm(0, 0xffff, 1)) {
++      FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
++      return FALSE;
+     }
++    ioperm(0x40,4,0); /* trap access to the timer chip */
++    ioperm(0x60,4,0); /* trap access to the keyboard controller */
+     return TRUE;
+ }
+       
+ void
+ xf86DisableIO()
+ {
+-    kern_return_t err;
+-
+-    err = i386_io_port_remove(mach_thread_self (), io_port);
+-    if( err )
+-    {
+-      errno = err;
+-      FatalError("xf86DisableIO() can't i386_io_port_remove.(io_port) 
(%s)\n",strerror(errno));
+-    }
+-    mach_port_deallocate(mach_task_self(), io_port);
++    ioperm(0,0xffff,0);
+     return;
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index e5b2a45..0a454ae 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,6 +12,7 @@
 16_s390_fix.diff
 21_glx_align_fixes.patch
 23_kfreebsd_support.diff
+24_hurd_ioperm_fix.diff
 32_disable_sparc_pci_bridge.diff
 34_xorg.conf_man_typos.patch
 39_alpha_build_flags.patch -p0


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to