commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnumach] 01/01: New upstream snapshot


From: Samuel Thibault
Subject: [gnumach] 01/01: New upstream snapshot
Date: Fri, 07 Nov 2014 01:39:23 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch master
in repository gnumach.

commit c469306cd9dccab203d31507853318e5c17aa20d
Author: Samuel Thibault <address@hidden>
Date:   Fri Nov 7 01:38:46 2014 +0000

    New upstream snapshot
    
    * rules: ignore +git version.
    * patches/git-*, patches/80_missing_files.patch: Remove.
---
 debian/changelog                                   |    9 +-
 debian/patches/50_initrd.patch                     |   58 +-
 debian/patches/70_dde.patch                        |  150 +-
 debian/patches/git-coverity-fixes.patch            |  120 -
 debian/patches/git-cursor_init.patch               |   61 -
 debian/patches/git-device_translatable.patch       |   46 -
 debian/patches/git-device_translatable2.patch      |   37 -
 debian/patches/git-gdb_hw_watch.patch              |   25 -
 debian/patches/git-halt.patch                      | 2500 --------------------
 debian/patches/git-kentry_data_size.patch          |   38 -
 debian/patches/git-mach_debug.patch                |   38 -
 debian/patches/git-mach_debug2.patch               |   45 -
 .../patches/git-memory_object_translatable.patch   |  120 -
 .../patches/git-memory_object_translatable2.patch  |   63 -
 debian/patches/git-mig-inlines.patch               |   90 -
 debian/patches/git-notify_translatable.patch       |   48 -
 debian/patches/git-physical-access.patch           |  267 ---
 debian/patches/git-quiet-cd-floppy.patch           |  370 ---
 debian/patches/git-task_set_name.patch             |  280 ---
 debian/patches/git-thread_terminate_release.patch  |  112 -
 debian/patches/git-vm-tune.patch                   |   77 -
 debian/patches/git-vm_map.patch                    |   27 -
 debian/patches/git-xen_clock_overflow.patch        |   33 -
 debian/patches/git-xen_races.patch                 |   21 -
 debian/patches/series                              |   22 -
 debian/rules                                       |    3 +-
 26 files changed, 111 insertions(+), 4549 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c2f56b5..a74460a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,8 @@
-gnumach (2:1.4-13) UNRELEASED; urgency=medium
+gnumach (2:1.4+git20141107-1) unstable; urgency=medium
 
-  * patches/git-gdb_hw_watch.patch: New patch to fix gdb using hardware
-    watches.
+  * New upstream snapshot
+  * rules: ignore +git version.
+  * patches/git-*, patches/80_missing_files.patch: Remove.
   * Bump Standards-Version to 3.9.6 (no changes).
   * control: rename into control.in with 1.4 replaced with @version@, so
     that...
@@ -9,7 +10,7 @@ gnumach (2:1.4-13) UNRELEASED; urgency=medium
     of the upstream version. Thanks Svante Signell for the original patch.
     Closes: Bug#762175.
 
- -- Samuel Thibault <address@hidden>  Wed, 17 Sep 2014 01:51:31 +0200
+ -- Samuel Thibault <address@hidden>  Fri, 07 Nov 2014 01:06:55 +0000
 
 gnumach (2:1.4-12) unstable; urgency=medium
 
diff --git a/debian/patches/50_initrd.patch b/debian/patches/50_initrd.patch
index 3091996..626ca56 100644
--- a/debian/patches/50_initrd.patch
+++ b/debian/patches/50_initrd.patch
@@ -1,11 +1,11 @@
 Jérémie Koenig <address@hidden>
 Add ramdisk support for d-i.
 
-Index: gnumach/Makefrag.am
+Index: gnumach-1.4+git20141107/Makefrag.am
 ===================================================================
---- gnumach.orig/Makefrag.am   2010-06-12 03:44:45.000000000 +0200
-+++ gnumach/Makefrag.am        2010-06-12 03:45:00.000000000 +0200
-@@ -275,6 +275,8 @@
+--- gnumach-1.4+git20141107.orig/Makefrag.am
++++ gnumach-1.4+git20141107/Makefrag.am
+@@ -308,6 +308,8 @@ libkernel_a_SOURCES += \
        device/net_io.c \
        device/net_io.h \
        device/param.h \
@@ -14,19 +14,19 @@ Index: gnumach/Makefrag.am
        device/subrs.c \
        device/subrs.h \
        device/tty.h
-Index: gnumach/i386/i386at/conf.c
+Index: gnumach-1.4+git20141107/i386/i386at/conf.c
 ===================================================================
---- gnumach.orig/i386/i386at/conf.c    2010-06-12 03:44:45.000000000 +0200
-+++ gnumach/i386/i386at/conf.c 2010-06-12 03:45:00.000000000 +0200
-@@ -29,6 +29,7 @@
- 
- #include <mach/machine/vm_types.h>
+--- gnumach-1.4+git20141107.orig/i386/i386at/conf.c
++++ gnumach-1.4+git20141107/i386/i386at/conf.c
+@@ -31,6 +31,7 @@
  #include <device/conf.h>
+ #include <kern/mach_clock.h>
+ #include <i386at/model_dep.h>
 +#include <device/ramdisk.h>
  
- extern int    timeopen(), timeclose();
- extern vm_offset_t timemmap();
-@@ -127,6 +128,8 @@
+ #define       timename                "time"
+ 
+@@ -129,6 +130,8 @@ struct dev_ops     dev_name_list[] =
          nodev },
  #endif        /* MACH_HYP */
  
@@ -34,12 +34,12 @@ Index: gnumach/i386/i386at/conf.c
 +
  #ifdef        MACH_KMSG
          { kmsgname,     kmsgopen,       kmsgclose,       kmsgread,
-           nodev,        kmsggetstat,    nodev,           nomap,
-Index: gnumach/kern/boot_script.c
+           nulldev_write,        kmsggetstat,    nulldev_setstat,           
nomap,
+Index: gnumach-1.4+git20141107/kern/boot_script.c
 ===================================================================
---- gnumach.orig/kern/boot_script.c    2010-06-12 03:44:45.000000000 +0200
-+++ gnumach/kern/boot_script.c 2010-06-12 03:45:00.000000000 +0200
-@@ -88,12 +88,20 @@
+--- gnumach-1.4+git20141107.orig/kern/boot_script.c
++++ gnumach-1.4+git20141107/kern/boot_script.c
+@@ -88,12 +88,20 @@ prompt_resume_task (struct cmd *cmd, con
    return boot_script_prompt_task_resume (cmd);
  }
  
@@ -60,11 +60,11 @@ Index: gnumach/kern/boot_script.c
  };
  #define NUM_BUILTIN (sizeof (builtin_symbols) / sizeof (builtin_symbols[0]))
  
-Index: gnumach/kern/bootstrap.c
+Index: gnumach-1.4+git20141107/kern/bootstrap.c
 ===================================================================
---- gnumach.orig/kern/bootstrap.c      2010-06-12 03:44:44.000000000 +0200
-+++ gnumach/kern/bootstrap.c   2010-06-12 03:45:00.000000000 +0200
-@@ -48,6 +48,7 @@
+--- gnumach-1.4+git20141107.orig/kern/bootstrap.c
++++ gnumach-1.4+git20141107/kern/bootstrap.c
+@@ -51,6 +51,7 @@
  #include <vm/vm_user.h>
  #include <vm/pmap.h>
  #include <device/device_port.h>
@@ -72,7 +72,7 @@ Index: gnumach/kern/bootstrap.c
  
  #if   MACH_KDB
  #include <machine/db_machdep.h>
-@@ -776,6 +773,23 @@
+@@ -792,6 +793,23 @@ boot_script_free (void *ptr, unsigned in
  }
  
  int
@@ -96,10 +96,10 @@ Index: gnumach/kern/bootstrap.c
  boot_script_task_create (struct cmd *cmd)
  {
    kern_return_t rc = task_create(TASK_NULL, FALSE, &cmd->task);
-Index: gnumach/device/ramdisk.c
+Index: gnumach-1.4+git20141107/device/ramdisk.c
 ===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gnumach/device/ramdisk.c   2010-06-12 05:02:54.000000000 +0200
+--- /dev/null
++++ gnumach-1.4+git20141107/device/ramdisk.c
 @@ -0,0 +1,160 @@
 +#include <mach/vm_param.h>
 +#include <machine/vm_param.h>
@@ -261,10 +261,10 @@ Index: gnumach/device/ramdisk.c
 +      return pmap_phys_to_frame(kvtophys((vm_offset_t) ramdisk[dev].data + 
off));
 +}
 +
-Index: gnumach/device/ramdisk.h
+Index: gnumach-1.4+git20141107/device/ramdisk.h
 ===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gnumach/device/ramdisk.h   2010-06-12 03:45:00.000000000 +0200
+--- /dev/null
++++ gnumach-1.4+git20141107/device/ramdisk.h
 @@ -0,0 +1,47 @@
 +#ifndef _KERN_RAMDISK_H_
 +#define _KERN_RAMDISK_H_
diff --git a/debian/patches/70_dde.patch b/debian/patches/70_dde.patch
index 56479f5..3c14744 100644
--- a/debian/patches/70_dde.patch
+++ b/debian/patches/70_dde.patch
@@ -1,8 +1,8 @@
-diff --git a/Makefrag.am b/Makefrag.am
-index 5d22504..64abbe9 100644
---- a/Makefrag.am
-+++ b/Makefrag.am
-@@ -204,6 +204,7 @@ libkernel_a_SOURCES += \
+Index: gnumach-1.4+git20141107/Makefrag.am
+===================================================================
+--- gnumach-1.4+git20141107.orig/Makefrag.am
++++ gnumach-1.4+git20141107/Makefrag.am
+@@ -220,6 +220,7 @@ EXTRA_DIST += \
        kern/mach.srv \
        kern/mach4.srv \
        kern/gnumach.srv \
@@ -10,7 +10,7 @@ index 5d22504..64abbe9 100644
        kern/mach_debug.srv \
        kern/mach_host.srv
  
-@@ -280,6 +281,7 @@ libkernel_a_SOURCES += \
+@@ -302,6 +303,7 @@ libkernel_a_SOURCES += \
        device/device_types_kernel.h \
        device/ds_routines.c \
        device/ds_routines.h \
@@ -18,7 +18,7 @@ index 5d22504..64abbe9 100644
        device/if_ether.h \
        device/if_hdr.h \
        device/io_req.h \
-@@ -348,6 +352,7 @@ include_mach_HEADERS = \
+@@ -373,6 +375,7 @@ include_mach_HEADERS = \
        include/mach/memory_object_default.defs \
        include/mach/notify.defs \
        include/mach/std_types.defs \
@@ -26,7 +26,7 @@ index 5d22504..64abbe9 100644
        include/mach/alert.h \
        include/mach/boolean.h \
        include/mach/boot.h \
-@@ -478,6 +483,7 @@ nodist_libkernel_a_SOURCES += \
+@@ -514,6 +517,7 @@ nodist_lib_dep_tr_for_defs_a_SOURCES +=
        kern/mach.server.defs.c \
        kern/mach4.server.defs.c \
        kern/gnumach.server.defs.c \
@@ -34,7 +34,7 @@ index 5d22504..64abbe9 100644
        kern/mach_debug.server.defs.c \
        kern/mach_host.server.defs.c
  nodist_libkernel_a_SOURCES += \
-@@ -487,6 +493,9 @@ nodist_libkernel_a_SOURCES += \
+@@ -526,6 +530,9 @@ nodist_libkernel_a_SOURCES += \
        kern/gnumach.server.h \
        kern/gnumach.server.c \
        kern/gnumach.server.msgids \
@@ -44,7 +44,7 @@ index 5d22504..64abbe9 100644
        kern/mach_debug.server.h \
        kern/mach_debug.server.c \
        kern/mach_debug.server.msgids \
-@@ -495,6 +504,7 @@ nodist_libkernel_a_SOURCES += \
+@@ -535,6 +542,7 @@ nodist_libkernel_a_SOURCES += \
  #     kern/mach.server.defs
  #     kern/mach4.server.defs
  #     kern/gnumach.server.defs
@@ -52,11 +52,11 @@ index 5d22504..64abbe9 100644
  #     kern/mach_debug.server.defs
  #     kern/mach_host.server.defs
  
-diff --git a/device/ds_routines.c b/device/ds_routines.c
-index 5a6fdd2..b89d70f 100644
---- a/device/ds_routines.c
-+++ b/device/ds_routines.c
-@@ -318,6 +318,43 @@ ds_device_map (device_t dev, vm_prot_t prot, vm_offset_t 
offset,
+Index: gnumach-1.4+git20141107/device/ds_routines.c
+===================================================================
+--- gnumach-1.4+git20141107.orig/device/ds_routines.c
++++ gnumach-1.4+git20141107/device/ds_routines.c
+@@ -318,6 +318,43 @@ ds_device_map (device_t dev, vm_prot_t p
                                offset, size, pager, unmap);
  }
  
@@ -100,7 +100,7 @@ index 5a6fdd2..b89d70f 100644
  boolean_t
  ds_notify (mach_msg_header_t *msg)
  {
-@@ -1820,6 +1857,24 @@ device_writev_trap (mach_device_t device, dev_mode_t 
mode,
+@@ -1802,6 +1839,24 @@ device_writev_trap (mach_device_t device
        return (result);
  }
  
@@ -125,23 +125,22 @@ index 5a6fdd2..b89d70f 100644
  struct device_emulation_ops mach_device_emulation_ops =
  {
    (void*) mach_device_reference,
-diff --git a/device/ds_routines.h b/device/ds_routines.h
-index a00a12d..9d635cf 100644
---- a/device/ds_routines.h
-+++ b/device/ds_routines.h
-@@ -58,4 +58,7 @@ boolean_t    ds_write_done(io_req_t);
-       vm_size_t       size,
-       mach_port_t     *pager);
+Index: gnumach-1.4+git20141107/device/ds_routines.h
+===================================================================
+--- gnumach-1.4+git20141107.orig/device/ds_routines.h
++++ gnumach-1.4+git20141107/device/ds_routines.h
+@@ -83,4 +83,7 @@ io_return_t ds_device_writev_trap(
+       io_buf_vec_t    *iovec,
+       vm_size_t       count);
  
 +/* XXX arch-specific */
 +extern ipc_port_t intr_rcv_ports[16];
 +
  #endif        /* DS_ROUTINES_H */
-diff --git a/device/intr.c b/device/intr.c
-new file mode 100644
-index 0000000..6fca328
+Index: gnumach-1.4+git20141107/device/intr.c
+===================================================================
 --- /dev/null
-+++ b/device/intr.c
++++ gnumach-1.4+git20141107/device/intr.c
 @@ -0,0 +1,198 @@
 +#include <device/intr.h>
 +#include <device/ds_routines.h>
@@ -341,14 +340,18 @@ index 0000000..6fca328
 +  return TRUE;
 +}
 +#endif        /* MACH_XEN */
---- /dev/null  2012-02-17 19:11:40.849680975 +0100
-+++ b/kern/experimental.srv    2012-02-18 22:56:48.192291483 +0100
+Index: gnumach-1.4+git20141107/kern/experimental.srv
+===================================================================
+--- /dev/null
++++ gnumach-1.4+git20141107/kern/experimental.srv
 @@ -0,0 +1,3 @@
 +#define KERNEL_SERVER 1
 +
 +#include <mach/experimental.defs>
+Index: gnumach-1.4+git20141107/include/mach/experimental.defs
+===================================================================
 --- /dev/null
-+++ b/include/mach/experimental.defs
++++ gnumach-1.4+git20141107/include/mach/experimental.defs
 @@ -0,0 +1,100 @@
 +/* 
 + * Mach Operating System
@@ -450,11 +453,10 @@ index 0000000..6fca328
 +      out     vaddr           : vm_address_t;
 +      out     paddr           : vm_address_t;
 +              size            : vm_size_t);
-diff --git a/include/device/intr.h b/include/device/intr.h
-new file mode 100644
-index 0000000..3c0e1b8
+Index: gnumach-1.4+git20141107/include/device/intr.h
+===================================================================
 --- /dev/null
-+++ b/include/device/intr.h
++++ gnumach-1.4+git20141107/include/device/intr.h
 @@ -0,0 +1,17 @@
 +#ifndef __INTR_H__
 +
@@ -473,19 +475,19 @@ index 0000000..3c0e1b8
 +#define MACH_INTR_NOTIFY 424242
 +
 +#endif
-diff --git a/kern/startup.c b/kern/startup.c
-index 3bdda16..9f0e692 100644
---- a/kern/startup.c
-+++ b/kern/startup.c
-@@ -70,6 +70,7 @@ extern void  vm_pageout();
- extern void   reaper_thread();
- extern void   swapin_thread();
- extern void   sched_thread();
+Index: gnumach-1.4+git20141107/kern/startup.c
+===================================================================
+--- gnumach-1.4+git20141107.orig/kern/startup.c
++++ gnumach-1.4+git20141107/kern/startup.c
+@@ -79,6 +79,7 @@ boolean_t reboot_on_panic = TRUE;
+ /* XX */
+ extern vm_offset_t phys_first_addr, phys_last_addr;
+ extern char *kernel_cmdline;
 +extern void   intr_thread();
  
- extern void   bootstrap_create();
- extern void   device_service_create();
-@@ -231,6 +232,9 @@ void start_kernel_threads()
+ /*
+  *    Running in virtual memory, on the interrupt stack.
+@@ -221,6 +222,9 @@ void start_kernel_threads(void)
        (void) kernel_thread(kernel_task, reaper_thread, (char *) 0);
        (void) kernel_thread(kernel_task, swapin_thread, (char *) 0);
        (void) kernel_thread(kernel_task, sched_thread, (char *) 0);
@@ -495,10 +497,10 @@ index 3bdda16..9f0e692 100644
  
  #if   NCPUS > 1
        /*
-diff --git a/linux/dev/arch/i386/kernel/irq.c 
b/linux/dev/arch/i386/kernel/irq.c
-index 41bdaa3..974eaf8 100644
---- a/linux/dev/arch/i386/kernel/irq.c
-+++ b/linux/dev/arch/i386/kernel/irq.c
+Index: gnumach-1.4+git20141107/linux/dev/arch/i386/kernel/irq.c
+===================================================================
+--- gnumach-1.4+git20141107.orig/linux/dev/arch/i386/kernel/irq.c
++++ gnumach-1.4+git20141107/linux/dev/arch/i386/kernel/irq.c
 @@ -83,6 +83,7 @@ struct linux_action
    void *dev_id;
    struct linux_action *next;
@@ -554,7 +556,7 @@ index 41bdaa3..974eaf8 100644
        action = action->next;
      }
  
-@@ -233,6 +265,7 @@ setup_x86_irq (int irq, struct linux_action *new)
+@@ -233,6 +265,7 @@ setup_x86_irq (int irq, struct linux_act
        }
        while (old);
        shared = 1;
@@ -562,7 +564,7 @@ index 41bdaa3..974eaf8 100644
      }
  
    save_flags (flags);
-@@ -250,6 +283,51 @@ setup_x86_irq (int irq, struct linux_action *new)
+@@ -250,6 +283,51 @@ setup_x86_irq (int irq, struct linux_act
    return 0;
  }
  
@@ -614,7 +616,7 @@ index 41bdaa3..974eaf8 100644
  /*
   * Attach a handler to an IRQ.
   */
-@@ -278,6 +356,7 @@ request_irq (unsigned int irq, void (*handler) (int, void 
*, struct pt_regs *),
+@@ -278,6 +356,7 @@ request_irq (unsigned int irq, void (*ha
    action->next = NULL;
    action->dev_id = dev_id;
    action->flags = flags;
@@ -622,11 +624,11 @@ index 41bdaa3..974eaf8 100644
    
    retval = setup_x86_irq (irq, action);
    if (retval)
-diff --git a/vm/vm_user.c b/vm/vm_user.c
-index 59c2a36..6cd9d77 100644
---- a/vm/vm_user.c
-+++ b/vm/vm_user.c
-@@ -413,3 +413,117 @@ kern_return_t vm_wire(host, map, start, size, access)
+Index: gnumach-1.4+git20141107/vm/vm_user.c
+===================================================================
+--- gnumach-1.4+git20141107.orig/vm/vm_user.c
++++ gnumach-1.4+git20141107/vm/vm_user.c
+@@ -434,3 +434,117 @@ kern_return_t vm_wire(host, map, start,
                                    round_page(start+size),
                                    access);
  }
@@ -744,10 +746,10 @@ index 59c2a36..6cd9d77 100644
 +      kfree ((vm_offset_t) pages, npages * sizeof (vm_page_t));
 +      return KERN_SUCCESS;
 +}
-diff --git a/linux/dev/drivers/block/genhd.c b/linux/dev/drivers/block/genhd.c
-index 95b499b..c360af6 100644
---- a/linux/dev/drivers/block/genhd.c
-+++ b/linux/dev/drivers/block/genhd.c
+Index: gnumach-1.4+git20141107/linux/dev/drivers/block/genhd.c
+===================================================================
+--- gnumach-1.4+git20141107.orig/linux/dev/drivers/block/genhd.c
++++ gnumach-1.4+git20141107/linux/dev/drivers/block/genhd.c
 @@ -786,7 +786,9 @@ void device_setup(void)
  #ifdef MACH
        linux_intr_pri = SPL6;
@@ -759,20 +761,18 @@ index 95b499b..c360af6 100644
  #endif
  #ifndef MACH
        console_map_init();
-diff --git a/kern/ipc_kobject.c b/kern/ipc_kobject.c
-index c922d7f..078b1d0 100644
---- a/kern/ipc_kobject.c
-+++ b/kern/ipc_kobject.c
-@@ -151,7 +151,8 @@ ipc_kobject_server(request)
-                               device_server_routine(),
-                               device_pager_server_routine(),
-                               mach4_server_routine(),
--                              gnumach_server_routine();
-+                              gnumach_server_routine(),
-+                              experimental_server_routine();
- #if   MACH_DEBUG
-       extern mig_routine_t    mach_debug_server_routine();
- #endif
+Index: gnumach-1.4+git20141107/kern/ipc_kobject.c
+===================================================================
+--- gnumach-1.4+git20141107.orig/kern/ipc_kobject.c
++++ gnumach-1.4+git20141107/kern/ipc_kobject.c
+@@ -159,6 +159,7 @@ ipc_kobject_server(request)
+        * to perform the kernel function
+        */
+     {
++      extern mig_routine_t    experimental_server_routine();
+       check_simple_locks();
+       if ((routine = mach_server_routine(&request->ikm_header)) != 0
+        || (routine = mach_port_server_routine(&request->ikm_header)) != 0
 @@ -170,6 +171,7 @@ ipc_kobject_server(request)
  #endif        /* MACH_DEBUG */
         || (routine = mach4_server_routine(&request->ikm_header)) != 0
diff --git a/debian/patches/git-coverity-fixes.patch 
b/debian/patches/git-coverity-fixes.patch
deleted file mode 100644
index 685e4b1..0000000
--- a/debian/patches/git-coverity-fixes.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-commit a9f5cf5d2ff55abdd05a2ab6965d8b4ba190eac9
-Author: Samuel Thibault <address@hidden>
-Date:   Tue Feb 4 13:03:48 2014 +0100
-
-    Fix FPU state access
-    
-    Found by coverity.
-    
-    * i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix out of bound
-    `user_fp_regs' access.
-
-diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
-index fd5f4b6..62a4e67 100644
---- a/i386/i386/fpu.c
-+++ b/i386/i386/fpu.c
-@@ -374,7 +374,7 @@ ASSERT_IPL(SPL0);
-               ifps->xfp_save_state.fp_dp      = user_fp_state->fp_dp;
-               ifps->xfp_save_state.fp_ds      = user_fp_state->fp_ds;
-               for (i=0; i<8; i++)
--                  memcpy(&ifps->xfp_save_state.fp_reg_word[i], 
&user_fp_regs[i], sizeof(user_fp_regs[i]));
-+                  memcpy(&ifps->xfp_save_state.fp_reg_word[i], 
&user_fp_regs->fp_reg_word[i], sizeof(user_fp_regs[i]));
-           } else {
-               ifps->fp_save_state.fp_control = user_fp_state->fp_control;
-               ifps->fp_save_state.fp_status  = user_fp_state->fp_status;
-@@ -467,7 +467,7 @@ ASSERT_IPL(SPL0);
-               user_fp_state->fp_dp      = ifps->xfp_save_state.fp_dp;
-               user_fp_state->fp_ds      = ifps->xfp_save_state.fp_ds;
-               for (i=0; i<8; i++)
--                  memcpy(&user_fp_regs[i], 
&ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs[i]));
-+                  memcpy(&user_fp_regs->fp_reg_word[i], 
&ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs[i]));
-           } else {
-               user_fp_state->fp_control = ifps->fp_save_state.fp_control;
-               user_fp_state->fp_status  = ifps->fp_save_state.fp_status;
-commit a7fcd5dfaad27dc33c1c1e22ebef2ded8d53b5a0
-Author: Samuel Thibault <address@hidden>
-Date:   Tue Feb 4 13:20:15 2014 +0100
-
-    Fix FPU state copy size
-    
-    * i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix size of
-    `user_fp_regs' access.
-
-diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
-index 62a4e67..cd90ee9 100644
---- a/i386/i386/fpu.c
-+++ b/i386/i386/fpu.c
-@@ -374,7 +374,7 @@ ASSERT_IPL(SPL0);
-               ifps->xfp_save_state.fp_dp      = user_fp_state->fp_dp;
-               ifps->xfp_save_state.fp_ds      = user_fp_state->fp_ds;
-               for (i=0; i<8; i++)
--                  memcpy(&ifps->xfp_save_state.fp_reg_word[i], 
&user_fp_regs->fp_reg_word[i], sizeof(user_fp_regs[i]));
-+                  memcpy(&ifps->xfp_save_state.fp_reg_word[i], 
&user_fp_regs->fp_reg_word[i], sizeof(user_fp_regs->fp_reg_word[i]));
-           } else {
-               ifps->fp_save_state.fp_control = user_fp_state->fp_control;
-               ifps->fp_save_state.fp_status  = user_fp_state->fp_status;
-@@ -467,7 +467,7 @@ ASSERT_IPL(SPL0);
-               user_fp_state->fp_dp      = ifps->xfp_save_state.fp_dp;
-               user_fp_state->fp_ds      = ifps->xfp_save_state.fp_ds;
-               for (i=0; i<8; i++)
--                  memcpy(&user_fp_regs->fp_reg_word[i], 
&ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs[i]));
-+                  memcpy(&user_fp_regs->fp_reg_word[i], 
&ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs->fp_reg_word[i]));
-           } else {
-               user_fp_state->fp_control = ifps->fp_save_state.fp_control;
-               user_fp_state->fp_status  = ifps->fp_save_state.fp_status;
-commit e6f93609728d0ad864fc2d7dacd9df128eccd37a
-Author: Samuel Thibault <address@hidden>
-Date:   Tue Feb 4 19:07:47 2014 +0100
-
-    Fix potential NULL dereference
-    
-    Found by Coverity
-    
-    * i386/i386/user_ldt.c (i386_get_ldt): Fetch `pcb' field of `thread'
-    only after looking for `thread' being NULL.
-
-diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c
-index a83bc12..3a2c1cc 100644
---- a/i386/i386/user_ldt.c
-+++ b/i386/i386/user_ldt.c
-@@ -262,7 +262,7 @@ i386_get_ldt(thread, first_selector, selector_count, 
desc_list, count)
-       unsigned int    *count;                 /* in/out */
- {
-       struct user_ldt *user_ldt;
--      pcb_t           pcb = thread->pcb;
-+      pcb_t           pcb;
-       int             first_desc = sel_idx(first_selector);
-       unsigned int    ldt_count;
-       vm_size_t       ldt_size;
-@@ -276,6 +276,7 @@ i386_get_ldt(thread, first_selector, selector_count, 
desc_list, count)
-       if (first_desc + selector_count >= 8192)
-           return KERN_INVALID_ARGUMENT;
- 
-+      pcb = thread->pcb;
-       addr = 0;
-       size = 0;
- 
-commit 03df518586e3cfd106eb20827781f12a0596e48c
-Author: Justus Winter <address@hidden>
-Date:   Tue Feb 4 11:47:00 2014 +0100
-
-    xen: fix buffer size
-    
-    Previously, only strlen(device_name) bytes were allocated, missing one
-    byte for the terminating zero.
-    
-    * xen/block.c (hyp_block_init): Fix buffer size.
-
-diff --git a/xen/block.c b/xen/block.c
-index 3e4ce7c..bd3758f 100644
---- a/xen/block.c
-+++ b/xen/block.c
-@@ -217,7 +217,7 @@ void hyp_block_init(void) {
-                       sprintf(device_name, "%s%ds%d", prefix, disk, 
partition);
-               else
-                       sprintf(device_name, "%s%d", prefix, disk);
--              bd->name = (char*) kalloc(strlen(device_name));
-+              bd->name = (char*) kalloc(strlen(device_name) + 1);
-               strcpy(bd->name, device_name);
- 
-               /* Get domain id of backend driver.  */
diff --git a/debian/patches/git-cursor_init.patch 
b/debian/patches/git-cursor_init.patch
deleted file mode 100644
index def4141..0000000
--- a/debian/patches/git-cursor_init.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-commit e1cd0a70ace0944a4916f8a152c50e366c2c6984
-Author: Samuel Thibault <address@hidden>
-Date:   Thu Jan 2 23:25:46 2014 +0100
-
-    Make sure cursor is initialized
-    
-    * i386/i386at/kd.c (kd_xga_init): Add start, stop variables, read them
-    from CRT registers, make sure the cursor is enabled and is not reduced
-    to 0, and write them back to CRT registers.
-    * i386/i386at/kd.h (C_START, C_STOP): New macros.
-
-diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
-index 3c66cc5..f70175c 100644
---- a/i386/i386at/kd.c
-+++ b/i386/i386at/kd.c
-@@ -2498,6 +2498,7 @@ kd_xga_init(void)
- {
-       csrpos_t        xga_getpos();
-       unsigned char   screen;
-+      unsigned char   start, stop;
- 
-       outb(CMOS_ADDR, CMOS_EB);
-       screen = inb(CMOS_DATA) & CM_SCRMSK;
-@@ -2552,6 +2553,24 @@ kd_xga_init(void)
-               printf("kd: unknown screen type, defaulting to EGA\n");
-       }
- 
-+      outb(kd_index_reg, C_START);
-+      start = inb(kd_io_reg);
-+      /* Make sure cursor is enabled */
-+      start &= ~0x20;
-+      outb(kd_io_reg, start);
-+      outb(kd_index_reg, C_STOP);
-+      stop = inb(kd_io_reg);
-+
-+      if (!start && !stop)
-+      {
-+              /* Some firmware seem not to be initializing the cursor size
-+               * any more...  Try using standard values.  */
-+              outb(kd_index_reg, C_START);
-+              outb(kd_io_reg, 14);
-+              outb(kd_index_reg, C_STOP);
-+              outb(kd_io_reg, 15);
-+      }
-+
-       kd_setpos(xga_getpos());
- }
- 
-diff --git a/i386/i386at/kd.h b/i386/i386at/kd.h
-index 0907e23..6c869d6 100644
---- a/i386/i386at/kd.h
-+++ b/i386/i386at/kd.h
-@@ -113,6 +113,8 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- /*
-  * Commands sent to graphics adapter.
-  */
-+#define C_START       0x0a            /* return cursor line start */
-+#define C_STOP                0x0b            /* return cursor line stop */
- #define C_LOW                 0x0f            /* return low byte of cursor 
addr */
- #define C_HIGH                0x0e            /* high byte */
- 
diff --git a/debian/patches/git-device_translatable.patch 
b/debian/patches/git-device_translatable.patch
deleted file mode 100644
index df23a1c..0000000
--- a/debian/patches/git-device_translatable.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-commit f1cdf417edeb9979a5f1f32c20d7ad75abc97a14
-Author: Justus Winter <address@hidden>
-Date:   Tue Apr 8 15:40:42 2014 +0200
-
-    include: make the device_t types translation functions mutable
-    
-    Make the intran, outtran and destructor functions mutable using
-    preprocessor macros.  Make it possible to inject imports using the
-    DEVICE_IMPORTS macro.  This way, userspace servers can provide their
-    own translation functions.
-    
-    * include/device/device_types.defs: Honor DEVICE_IMPORTS.
-    (device_t): Make the translation mutable using preprocessor macros.
-
-diff --git a/include/device/device_types.defs 
b/include/device/device_types.defs
-index 79e4c5b..ff6cff6 100644
---- a/include/device/device_types.defs
-+++ b/include/device/device_types.defs
-@@ -39,6 +39,10 @@
- 
- #include <mach/std_types.defs>
- 
-+#ifdef DEVICE_IMPORTS
-+DEVICE_IMPORTS
-+#endif
-+
- type recnum_t         = unsigned32;
- type dev_mode_t               = unsigned32;
- type dev_flavor_t     = unsigned32;
-@@ -55,6 +59,16 @@ type device_t = mach_port_t
-               intran: device_t dev_port_lookup(mach_port_t)
-               outtran: mach_port_t convert_device_to_port(device_t)
-               destructor: device_deallocate(device_t)
-+#else /* KERNEL_SERVER */
-+#ifdef        DEVICE_INTRAN
-+              intran: DEVICE_INTRAN
-+#endif
-+#ifdef        DEVICE_OUTTRAN
-+              outtran: DEVICE_OUTTRAN
-+#endif
-+#ifdef        DEVICE_DESTRUCTOR
-+              destructor: DEVICE_DESTRUCTOR
-+#endif
- #endif        /* KERNEL_SERVER */
-               ;
- 
diff --git a/debian/patches/git-device_translatable2.patch 
b/debian/patches/git-device_translatable2.patch
deleted file mode 100644
index 4e8f149..0000000
--- a/debian/patches/git-device_translatable2.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-commit 5e533682c0df29d28dc8250c57c2e33406a57835
-Author: Justus Winter <address@hidden>
-Date:   Thu Apr 10 19:13:47 2014 +0200
-
-    include: fix the definition of device_open
-    
-    Previously, every userspace server implementing the device protocol
-    filtered the device definitions to replace the device_t type with
-    mach_port_send_t to make the device argument of device_open
-    polymorphic.  Rather than doing that, which makes it impossible to use
-    translation functions, fix the definition of device_open.
-    
-    * include/device/device.defs (device_open): Redefine the device
-    argument to make it polymorphic unless a outran function is specified.
-
-diff --git a/include/device/device.defs b/include/device/device.defs
-index d9234e3..5fdf1bd 100644
---- a/include/device/device.defs
-+++ b/include/device/device.defs
-@@ -52,7 +52,16 @@ routine device_open(
-       sreplyport reply_port   : reply_port_t;
-               mode            : dev_mode_t;
-               name            : dev_name_t;
--      out     device          : device_t
-+      out     device          : device_t =
-+                                      MACH_MSG_TYPE_PORT_SEND
-+                                      ctype: mach_port_t
-+#if   KERNEL_SERVER
-+              outtran: mach_port_t convert_device_to_port(device_t)
-+#else
-+#ifdef        DEVICE_OUTTRAN
-+              outtran: DEVICE_OUTTRAN
-+#endif
-+#endif        /* KERNEL_SERVER */
-       );
- 
- routine device_close(
diff --git a/debian/patches/git-gdb_hw_watch.patch 
b/debian/patches/git-gdb_hw_watch.patch
deleted file mode 100644
index f6498a1..0000000
--- a/debian/patches/git-gdb_hw_watch.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-commit 96cec60d956bfb27f135d4e932a1c319cbc878df
-Author: Samuel Thibault <address@hidden>
-Date:   Wed Sep 17 01:50:05 2014 +0200
-
-    Report DR6 to userland
-    
-    * i386/i386/trap.c (user_trap): On T_DEBUG, record the content of dr6 in
-    PCB, and clear it.
-
-diff --git a/i386/i386/trap.c b/i386/i386/trap.c
-index 200cbcc..9d4d43d 100644
---- a/i386/i386/trap.c
-+++ b/i386/i386/trap.c
-@@ -395,6 +395,11 @@ printf("user trap %d error %d sub %08x\n", type, code, 
subcode);
-                       return 0;
-               }
- #endif
-+              /* Make the content of the debug status register (DR6)
-+                 available to user space.  */
-+              if (thread->pcb)
-+                  thread->pcb->ims.ids.dr[6] = get_dr6() & 0x600F;
-+              set_dr6(0);
-               exc = EXC_BREAKPOINT;
-               code = EXC_I386_SGL;
-               break;
diff --git a/debian/patches/git-halt.patch b/debian/patches/git-halt.patch
deleted file mode 100644
index f0f1d2f..0000000
--- a/debian/patches/git-halt.patch
+++ /dev/null
@@ -1,2500 +0,0 @@
-commit 3bb2b68bc84b9cb11aae7b46eeec3c5eb3363f54
-Author: Justus Winter <address@hidden>
-Date:   Fri May 2 21:33:01 2014 +0200
-
-    i386: add io_map_cached
-    
-    io_map_cached is like io_map, but reuses the old mapping if it is
-    applicable.
-    
-    * i386/i386/io_map.c: Add io_map_cached.
-
-diff --git a/i386/i386/io_map.c b/i386/i386/io_map.c
-index 74e0b47..03d7152 100644
---- a/i386/i386/io_map.c
-+++ b/i386/i386/io_map.c
-@@ -58,3 +58,32 @@ io_map(
-                       VM_PROT_READ|VM_PROT_WRITE);
-       return (start);
- }
-+
-+/*
-+ * Allocate and map memory for devices that may need to be mapped before
-+ * Mach VM is running.
-+ *
-+ * This maps the all pages containing [PHYS_ADDR:PHYS_ADDR + SIZE].
-+ * For contiguous requests to those pages will reuse the previously
-+ * established mapping.
-+ */
-+vm_offset_t
-+io_map_cached(
-+      vm_offset_t     phys_addr,
-+      vm_size_t       size)
-+{
-+  static vm_offset_t base;
-+  static vm_size_t length;
-+  static vm_offset_t map;
-+
-+  if (! map
-+      || (phys_addr < base)
-+      || (base + length < phys_addr + size))
-+    {
-+      base = trunc_page(phys_addr);
-+      length = round_page(phys_addr - base + size);
-+      map = io_map(base, length);
-+    }
-+
-+  return map + (phys_addr - base);
-+}
-commit c031b41b783cc99c0bd5aac7d14c1d6e34520397
-Author: Justus Winter <address@hidden>
-Date:   Sat May 3 01:33:14 2014 +0200
-
-    i386: use ACPI to power off the machine
-    
-    This is a mostly verbatim copy of acpihalt.c from GRUB2 with a little
-    bit of glue code.
-    
-    * i386/Makefrag.am (libkernel_a_SOURCES): Add the new files.
-    * i386/grub/acpi.h: Verbatim copy from GRUB2.
-    * i386/grub/compiler.h: Likewise.
-    * i386/grub/cpu/io.h: Likewise.
-    * i386/grub/cpu/time.h: Likewise.
-    * i386/grub/cpu/types.h: Likewise.
-    * i386/grub/err.h: Likewise.
-    * i386/grub/misc.h: Likewise.
-    * i386/grub/mm.h: Likewise.
-    * i386/grub/symbol.h: Likewise.
-    * i386/grub/time.h: Likewise.
-    * i386/grub/types.h: Likewise.
-    * i386/i386at/acpi.c: Likewise.
-    * i386/i386at/acpihalt.c: Likewise.
-    (grub_acpi_halt): Map physical addresses.
-    * i386/i386at/acpihalt.h: New file.
-    * i386/grub/glue.h: Some glue macros.
-    * i386/grub/i18n.h: Stub out i18n.
-    * i386/i386at/grub_glue.c: Some glue code.
-    * i386/i386at/model_dep.c (halt_all_cpus): Use grub_acpi_halt.
-
-diff --git a/i386/Makefrag.am b/i386/Makefrag.am
-index cac2267..4dd6a9f 100644
---- a/i386/Makefrag.am
-+++ b/i386/Makefrag.am
-@@ -55,6 +55,25 @@ libkernel_a_SOURCES += \
-       i386/i386at/pic_isa.c \
-       i386/i386at/rtc.c \
-       i386/i386at/rtc.h
-+
-+libkernel_a_SOURCES += \
-+      i386/i386at/acpihalt.c \
-+      i386/i386at/acpihalt.h \
-+      i386/i386at/acpi.c \
-+      i386/i386at/grub_glue.c \
-+      i386/grub/err.h \
-+      i386/grub/cpu/io.h \
-+      i386/grub/cpu/types.h \
-+      i386/grub/cpu/time.h \
-+      i386/grub/mm.h \
-+      i386/grub/acpi.h \
-+      i386/grub/symbol.h \
-+      i386/grub/misc.h \
-+      i386/grub/types.h \
-+      i386/grub/time.h \
-+      i386/grub/i18n.h \
-+      i386/grub/compiler.h \
-+      i386/grub/glue.h
- endif
- 
- #
-diff --git a/i386/grub/acpi.h b/i386/grub/acpi.h
-new file mode 100644
-index 0000000..2ac2bd6
---- /dev/null
-+++ b/i386/grub/acpi.h
-@@ -0,0 +1,220 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2009  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef GRUB_ACPI_HEADER
-+#define GRUB_ACPI_HEADER      1
-+
-+#ifndef GRUB_DSDT_TEST
-+#include <grub/types.h>
-+#include <grub/err.h>
-+#endif
-+
-+#define GRUB_RSDP_SIGNATURE "RSD PTR "
-+#define GRUB_RSDP_SIGNATURE_SIZE 8
-+
-+struct grub_acpi_rsdp_v10
-+{
-+  grub_uint8_t signature[GRUB_RSDP_SIGNATURE_SIZE];
-+  grub_uint8_t checksum;
-+  grub_uint8_t oemid[6];
-+  grub_uint8_t revision;
-+  grub_uint32_t rsdt_addr;
-+} GRUB_PACKED;
-+
-+struct grub_acpi_rsdp_v20
-+{
-+  struct grub_acpi_rsdp_v10 rsdpv1;
-+  grub_uint32_t length;
-+  grub_uint64_t xsdt_addr;
-+  grub_uint8_t checksum;
-+  grub_uint8_t reserved[3];
-+} GRUB_PACKED;
-+
-+struct grub_acpi_table_header
-+{
-+  grub_uint8_t signature[4];
-+  grub_uint32_t length;
-+  grub_uint8_t revision;
-+  grub_uint8_t checksum;
-+  grub_uint8_t oemid[6];
-+  grub_uint8_t oemtable[8];
-+  grub_uint32_t oemrev;
-+  grub_uint8_t creator_id[4];
-+  grub_uint32_t creator_rev;
-+} GRUB_PACKED;
-+
-+#define GRUB_ACPI_FADT_SIGNATURE "FACP"
-+
-+struct grub_acpi_fadt
-+{
-+  struct grub_acpi_table_header hdr;
-+  grub_uint32_t facs_addr;
-+  grub_uint32_t dsdt_addr;
-+  grub_uint8_t somefields1[20];
-+  grub_uint32_t pm1a;
-+  grub_uint8_t somefields2[64];
-+  grub_uint64_t facs_xaddr;
-+  grub_uint64_t dsdt_xaddr;
-+  grub_uint8_t somefields3[96];
-+} GRUB_PACKED;
-+
-+#define GRUB_ACPI_MADT_SIGNATURE "APIC"
-+
-+struct grub_acpi_madt_entry_header
-+{
-+  grub_uint8_t type;
-+  grub_uint8_t len;
-+};
-+
-+struct grub_acpi_madt
-+{
-+  struct grub_acpi_table_header hdr;
-+  grub_uint32_t lapic_addr;
-+  grub_uint32_t flags;
-+  struct grub_acpi_madt_entry_header entries[0];
-+};
-+
-+enum
-+  {
-+    GRUB_ACPI_MADT_ENTRY_TYPE_LAPIC = 0,
-+    GRUB_ACPI_MADT_ENTRY_TYPE_IOAPIC = 1,
-+    GRUB_ACPI_MADT_ENTRY_TYPE_INTERRUPT_OVERRIDE = 2,
-+    GRUB_ACPI_MADT_ENTRY_TYPE_LAPIC_NMI = 4,
-+    GRUB_ACPI_MADT_ENTRY_TYPE_SAPIC = 6,
-+    GRUB_ACPI_MADT_ENTRY_TYPE_LSAPIC = 7,
-+    GRUB_ACPI_MADT_ENTRY_TYPE_PLATFORM_INT_SOURCE = 8
-+  };
-+
-+struct grub_acpi_madt_entry_lapic
-+{
-+  struct grub_acpi_madt_entry_header hdr;
-+  grub_uint8_t acpiid;
-+  grub_uint8_t apicid;
-+  grub_uint32_t flags;
-+};
-+
-+struct grub_acpi_madt_entry_ioapic
-+{
-+  struct grub_acpi_madt_entry_header hdr;
-+  grub_uint8_t id;
-+  grub_uint8_t pad;
-+  grub_uint32_t address;
-+  grub_uint32_t global_sys_interrupt;
-+};
-+
-+struct grub_acpi_madt_entry_interrupt_override
-+{
-+  struct grub_acpi_madt_entry_header hdr;
-+  grub_uint8_t bus;
-+  grub_uint8_t source;
-+  grub_uint32_t global_sys_interrupt;
-+  grub_uint16_t flags;
-+} GRUB_PACKED;
-+
-+
-+struct grub_acpi_madt_entry_lapic_nmi
-+{
-+  struct grub_acpi_madt_entry_header hdr;
-+  grub_uint8_t acpiid;
-+  grub_uint16_t flags;
-+  grub_uint8_t lint;
-+} GRUB_PACKED;
-+
-+struct grub_acpi_madt_entry_sapic
-+{
-+  struct grub_acpi_madt_entry_header hdr;
-+  grub_uint8_t id;
-+  grub_uint8_t pad;
-+  grub_uint32_t global_sys_interrupt_base;
-+  grub_uint64_t addr;
-+};
-+
-+struct grub_acpi_madt_entry_lsapic
-+{
-+  struct grub_acpi_madt_entry_header hdr;
-+  grub_uint8_t cpu_id;
-+  grub_uint8_t id;
-+  grub_uint8_t eid;
-+  grub_uint8_t pad[3];
-+  grub_uint32_t flags;
-+  grub_uint32_t cpu_uid;
-+  grub_uint8_t cpu_uid_str[0];
-+};
-+
-+struct grub_acpi_madt_entry_platform_int_source
-+{
-+  struct grub_acpi_madt_entry_header hdr;
-+  grub_uint16_t flags;
-+  grub_uint8_t inttype;
-+  grub_uint8_t cpu_id;
-+  grub_uint8_t cpu_eid;
-+  grub_uint8_t sapic_vector;
-+  grub_uint32_t global_sys_int;
-+  grub_uint32_t src_flags;
-+};
-+
-+enum
-+  {
-+    GRUB_ACPI_MADT_ENTRY_SAPIC_FLAGS_ENABLED = 1
-+  };
-+
-+#ifndef GRUB_DSDT_TEST
-+struct grub_acpi_rsdp_v10 *grub_acpi_get_rsdpv1 (void);
-+struct grub_acpi_rsdp_v20 *grub_acpi_get_rsdpv2 (void);
-+struct grub_acpi_rsdp_v10 *grub_machine_acpi_get_rsdpv1 (void);
-+struct grub_acpi_rsdp_v20 *grub_machine_acpi_get_rsdpv2 (void);
-+grub_uint8_t grub_byte_checksum (void *base, grub_size_t size);
-+
-+grub_err_t grub_acpi_create_ebda (void);
-+
-+void grub_acpi_halt (void);
-+#endif
-+
-+#define GRUB_ACPI_SLP_EN (1 << 13)
-+#define GRUB_ACPI_SLP_TYP_OFFSET 10
-+
-+enum
-+  {
-+    GRUB_ACPI_OPCODE_ZERO = 0, GRUB_ACPI_OPCODE_ONE = 1,
-+    GRUB_ACPI_OPCODE_NAME = 8, GRUB_ACPI_OPCODE_BYTE_CONST = 0x0a,
-+    GRUB_ACPI_OPCODE_WORD_CONST = 0x0b,
-+    GRUB_ACPI_OPCODE_DWORD_CONST = 0x0c,
-+    GRUB_ACPI_OPCODE_STRING_CONST = 0x0d,
-+    GRUB_ACPI_OPCODE_SCOPE = 0x10,
-+    GRUB_ACPI_OPCODE_BUFFER = 0x11,
-+    GRUB_ACPI_OPCODE_PACKAGE = 0x12,
-+    GRUB_ACPI_OPCODE_METHOD = 0x14, GRUB_ACPI_OPCODE_EXTOP = 0x5b,
-+    GRUB_ACPI_OPCODE_CREATE_WORD_FIELD = 0x8b,
-+    GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD = 0x8c,
-+    GRUB_ACPI_OPCODE_IF = 0xa0, GRUB_ACPI_OPCODE_ONES = 0xff
-+  };
-+enum
-+  {
-+    GRUB_ACPI_EXTOPCODE_MUTEX = 0x01,
-+    GRUB_ACPI_EXTOPCODE_EVENT_OP = 0x02,
-+    GRUB_ACPI_EXTOPCODE_OPERATION_REGION = 0x80,
-+    GRUB_ACPI_EXTOPCODE_FIELD_OP = 0x81,
-+    GRUB_ACPI_EXTOPCODE_DEVICE_OP = 0x82,
-+    GRUB_ACPI_EXTOPCODE_PROCESSOR_OP = 0x83,
-+    GRUB_ACPI_EXTOPCODE_POWER_RES_OP = 0x84,
-+    GRUB_ACPI_EXTOPCODE_THERMAL_ZONE_OP = 0x85,
-+    GRUB_ACPI_EXTOPCODE_INDEX_FIELD_OP = 0x86,
-+    GRUB_ACPI_EXTOPCODE_BANK_FIELD_OP = 0x87,
-+  };
-+
-+#endif /* ! GRUB_ACPI_HEADER */
-diff --git a/i386/grub/compiler.h b/i386/grub/compiler.h
-new file mode 100644
-index 0000000..c9e1d7a
---- /dev/null
-+++ b/i386/grub/compiler.h
-@@ -0,0 +1,51 @@
-+/* compiler.h - macros for various compiler features */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010,2014  Free Software 
Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef GRUB_COMPILER_HEADER
-+#define GRUB_COMPILER_HEADER  1
-+
-+/* GCC version checking borrowed from glibc. */
-+#if defined(__GNUC__) && defined(__GNUC_MINOR__)
-+#  define GNUC_PREREQ(maj,min) \
-+      ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-+#else
-+#  define GNUC_PREREQ(maj,min) 0
-+#endif
-+
-+/* Does this compiler support compile-time error attributes? */
-+#if GNUC_PREREQ(4,3)
-+#  define ATTRIBUTE_ERROR(msg) \
-+      __attribute__ ((__error__ (msg)))
-+#else
-+#  define ATTRIBUTE_ERROR(msg) __attribute__ ((noreturn))
-+#endif
-+
-+#if GNUC_PREREQ(4,4)
-+#  define GNU_PRINTF gnu_printf
-+#else
-+#  define GNU_PRINTF printf
-+#endif
-+
-+#if GNUC_PREREQ(3,4)
-+#  define WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
-+#else
-+#  define WARN_UNUSED_RESULT
-+#endif
-+
-+#endif /* ! GRUB_COMPILER_HEADER */
-diff --git a/i386/grub/cpu/io.h b/i386/grub/cpu/io.h
-new file mode 100644
-index 0000000..ae12a3e
---- /dev/null
-+++ b/i386/grub/cpu/io.h
-@@ -0,0 +1,72 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 1996,2000,2002,2007  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+/* Based on sys/io.h from GNU libc. */
-+
-+#ifndef       GRUB_IO_H
-+#define       GRUB_IO_H       1
-+
-+typedef unsigned short int grub_port_t;
-+
-+static __inline unsigned char
-+grub_inb (unsigned short int port)
-+{
-+  unsigned char _v;
-+
-+  __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
-+  return _v;
-+}
-+
-+static __inline unsigned short int
-+grub_inw (unsigned short int port)
-+{
-+  unsigned short _v;
-+
-+  __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
-+  return _v;
-+}
-+
-+static __inline unsigned int
-+grub_inl (unsigned short int port)
-+{
-+  unsigned int _v;
-+
-+  __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port));
-+  return _v;
-+}
-+
-+static __inline void
-+grub_outb (unsigned char value, unsigned short int port)
-+{
-+  __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
-+}
-+
-+static __inline void
-+grub_outw (unsigned short int value, unsigned short int port)
-+{
-+  __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
-+
-+}
-+
-+static __inline void
-+grub_outl (unsigned int value, unsigned short int port)
-+{
-+  __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port));
-+}
-+
-+#endif /* _SYS_IO_H */
-diff --git a/i386/grub/cpu/time.h b/i386/grub/cpu/time.h
-new file mode 100644
-index 0000000..842882c
---- /dev/null
-+++ b/i386/grub/cpu/time.h
-@@ -0,0 +1,29 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2007  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef KERNEL_CPU_TIME_HEADER
-+#define KERNEL_CPU_TIME_HEADER        1
-+
-+static __inline void
-+grub_cpu_idle (void)
-+{
-+  /* FIXME: this can't work until we handle interrupts.  */
-+/*  __asm__ __volatile__ ("hlt"); */
-+}
-+
-+#endif /* ! KERNEL_CPU_TIME_HEADER */
-diff --git a/i386/grub/cpu/types.h b/i386/grub/cpu/types.h
-new file mode 100644
-index 0000000..c20063f
---- /dev/null
-+++ b/i386/grub/cpu/types.h
-@@ -0,0 +1,33 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2006,2007  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef GRUB_TYPES_CPU_HEADER
-+#define GRUB_TYPES_CPU_HEADER 1
-+
-+/* The size of void *.  */
-+#define GRUB_TARGET_SIZEOF_VOID_P     4
-+
-+/* The size of long.  */
-+#define GRUB_TARGET_SIZEOF_LONG               4
-+
-+/* i386 is little-endian.  */
-+#undef GRUB_TARGET_WORDS_BIGENDIAN
-+
-+#define GRUB_HAVE_UNALIGNED_ACCESS 1
-+
-+#endif /* ! GRUB_TYPES_CPU_HEADER */
-diff --git a/i386/grub/err.h b/i386/grub/err.h
-new file mode 100644
-index 0000000..1590c68
---- /dev/null
-+++ b/i386/grub/err.h
-@@ -0,0 +1,96 @@
-+/* err.h - error numbers and prototypes */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef GRUB_ERR_HEADER
-+#define GRUB_ERR_HEADER       1
-+
-+#include <grub/symbol.h>
-+
-+#define GRUB_MAX_ERRMSG               256
-+
-+typedef enum
-+  {
-+    GRUB_ERR_NONE = 0,
-+    GRUB_ERR_TEST_FAILURE,
-+    GRUB_ERR_BAD_MODULE,
-+    GRUB_ERR_OUT_OF_MEMORY,
-+    GRUB_ERR_BAD_FILE_TYPE,
-+    GRUB_ERR_FILE_NOT_FOUND,
-+    GRUB_ERR_FILE_READ_ERROR,
-+    GRUB_ERR_BAD_FILENAME,
-+    GRUB_ERR_UNKNOWN_FS,
-+    GRUB_ERR_BAD_FS,
-+    GRUB_ERR_BAD_NUMBER,
-+    GRUB_ERR_OUT_OF_RANGE,
-+    GRUB_ERR_UNKNOWN_DEVICE,
-+    GRUB_ERR_BAD_DEVICE,
-+    GRUB_ERR_READ_ERROR,
-+    GRUB_ERR_WRITE_ERROR,
-+    GRUB_ERR_UNKNOWN_COMMAND,
-+    GRUB_ERR_INVALID_COMMAND,
-+    GRUB_ERR_BAD_ARGUMENT,
-+    GRUB_ERR_BAD_PART_TABLE,
-+    GRUB_ERR_UNKNOWN_OS,
-+    GRUB_ERR_BAD_OS,
-+    GRUB_ERR_NO_KERNEL,
-+    GRUB_ERR_BAD_FONT,
-+    GRUB_ERR_NOT_IMPLEMENTED_YET,
-+    GRUB_ERR_SYMLINK_LOOP,
-+    GRUB_ERR_BAD_COMPRESSED_DATA,
-+    GRUB_ERR_MENU,
-+    GRUB_ERR_TIMEOUT,
-+    GRUB_ERR_IO,
-+    GRUB_ERR_ACCESS_DENIED,
-+    GRUB_ERR_EXTRACTOR,
-+    GRUB_ERR_NET_BAD_ADDRESS,
-+    GRUB_ERR_NET_ROUTE_LOOP,
-+    GRUB_ERR_NET_NO_ROUTE,
-+    GRUB_ERR_NET_NO_ANSWER,
-+    GRUB_ERR_NET_NO_CARD,
-+    GRUB_ERR_WAIT,
-+    GRUB_ERR_BUG,
-+    GRUB_ERR_NET_PORT_CLOSED,
-+    GRUB_ERR_NET_INVALID_RESPONSE,
-+    GRUB_ERR_NET_UNKNOWN_ERROR,
-+    GRUB_ERR_NET_PACKET_TOO_BIG,
-+    GRUB_ERR_NET_NO_DOMAIN,
-+    GRUB_ERR_EOF,
-+    GRUB_ERR_BAD_SIGNATURE
-+  }
-+grub_err_t;
-+
-+struct grub_error_saved
-+{
-+  grub_err_t grub_errno;
-+  char errmsg[GRUB_MAX_ERRMSG];
-+};
-+
-+extern grub_err_t EXPORT_VAR(grub_errno);
-+extern char EXPORT_VAR(grub_errmsg)[GRUB_MAX_ERRMSG];
-+
-+grub_err_t EXPORT_FUNC(grub_error) (grub_err_t n, const char *fmt, ...);
-+void EXPORT_FUNC(grub_fatal) (const char *fmt, ...) __attribute__ 
((noreturn));
-+void EXPORT_FUNC(grub_error_push) (void);
-+int EXPORT_FUNC(grub_error_pop) (void);
-+void EXPORT_FUNC(grub_print_error) (void);
-+extern int EXPORT_VAR(grub_err_printed_errors);
-+int grub_err_printf (const char *fmt, ...)
-+     __attribute__ ((format (__printf__, 1, 2)));
-+
-+#endif /* ! GRUB_ERR_HEADER */
-diff --git a/i386/grub/glue.h b/i386/grub/glue.h
-new file mode 100644
-index 0000000..e1c62eb
---- /dev/null
-+++ b/i386/grub/glue.h
-@@ -0,0 +1,31 @@
-+/*
-+ * Copyright (c) 2014 Free Software Foundation.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef _GRUB_GLUE_H
-+#define _GRUB_GLUE_H
-+
-+#define GRUB_FILE __FILE__
-+#define grub_memcmp memcmp
-+#define grub_printf printf
-+#define grub_puts_ puts
-+
-+#include <mach/mach_types.h>
-+#include <i386/vm_param.h>
-+
-+vm_offset_t io_map_cached(vm_offset_t phys_addr, vm_size_t size);
-+
-+#endif /* _GRUB_GLUE_H */
-diff --git a/i386/grub/i18n.h b/i386/grub/i18n.h
-new file mode 100644
-index 0000000..8b53357
---- /dev/null
-+++ b/i386/grub/i18n.h
-@@ -0,0 +1,25 @@
-+/*
-+ * Copyright (c) 2014 Free Software Foundation.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef _GRUB_I18N_H
-+#define _GRUB_I18N_H
-+
-+/* No i18n please.  */
-+#define _(x) x
-+#define N_(x) x
-+
-+#endif /* _GRUB_I18N_H */
-diff --git a/i386/grub/misc.h b/i386/grub/misc.h
-new file mode 100644
-index 0000000..c6cd456
---- /dev/null
-+++ b/i386/grub/misc.h
-@@ -0,0 +1,517 @@
-+/* misc.h - prototypes for misc functions */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010  Free Software 
Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef GRUB_MISC_HEADER
-+#define GRUB_MISC_HEADER      1
-+
-+#include <stdarg.h>
-+#include <grub/types.h>
-+#include <grub/symbol.h>
-+#include <grub/err.h>
-+#include <grub/i18n.h>
-+#include <grub/compiler.h>
-+
-+#define ALIGN_UP(addr, align) \
-+      ((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1))
-+#define ALIGN_UP_OVERHEAD(addr, align) ((-(addr)) & ((typeof (addr)) (align) 
- 1))
-+#define ALIGN_DOWN(addr, align) \
-+      ((addr) & ~((typeof (addr)) align - 1))
-+#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
-+#define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; }
-+
-+#define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, 
condition, __VA_ARGS__)
-+
-+void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n);
-+char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src);
-+
-+static inline char *
-+grub_strncpy (char *dest, const char *src, int c)
-+{
-+  char *p = dest;
-+
-+  while ((*p++ = *src++) != '\0' && --c)
-+    ;
-+
-+  return dest;
-+}
-+
-+static inline char *
-+grub_stpcpy (char *dest, const char *src)
-+{
-+  char *d = dest;
-+  const char *s = src;
-+
-+  do
-+    *d++ = *s;
-+  while (*s++ != '\0');
-+
-+  return d - 1;
-+}
-+
-+/* XXX: If grub_memmove is too slow, we must implement grub_memcpy.  */
-+static inline void *
-+grub_memcpy (void *dest, const void *src, grub_size_t n)
-+{
-+  return grub_memmove (dest, src, n);
-+}
-+
-+#if defined (__APPLE__) && defined(__i386__) && !defined (GRUB_UTIL)
-+#define GRUB_BUILTIN_ATTR  __attribute__ ((regparm(0)))
-+#else
-+#define GRUB_BUILTIN_ATTR
-+#endif
-+
-+#if defined(__x86_64__) && !defined (GRUB_UTIL)
-+#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (__MINGW64__)
-+#define GRUB_ASM_ATTR __attribute__ ((sysv_abi))
-+#else
-+#define GRUB_ASM_ATTR
-+#endif
-+#endif
-+
-+/* Prototypes for aliases.  */
-+#ifndef GRUB_UTIL
-+int GRUB_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, 
grub_size_t n);
-+void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memmove) (void *dest, const void *src, 
grub_size_t n);
-+void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memcpy) (void *dest, const void *src, 
grub_size_t n);
-+void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memset) (void *s, int c, grub_size_t n);
-+
-+#ifdef __APPLE__
-+void GRUB_BUILTIN_ATTR EXPORT_FUNC (__bzero) (void *s, grub_size_t n);
-+#endif
-+
-+#endif
-+
-+int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n);
-+int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2);
-+int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n);
-+
-+char *EXPORT_FUNC(grub_strchr) (const char *s, int c);
-+char *EXPORT_FUNC(grub_strrchr) (const char *s, int c);
-+int EXPORT_FUNC(grub_strword) (const char *s, const char *w);
-+
-+/* Copied from gnulib.
-+   Written by Bruno Haible <address@hidden>, 2005. */
-+static inline char *
-+grub_strstr (const char *haystack, const char *needle)
-+{
-+  /* Be careful not to look at the entire extent of haystack or needle
-+     until needed.  This is useful because of these two cases:
-+       - haystack may be very long, and a match of needle found early,
-+       - needle may be very long, and not even a short initial segment of
-+       needle may be found in haystack.  */
-+  if (*needle != '\0')
-+    {
-+      /* Speed up the following searches of needle by caching its first
-+       character.  */
-+      char b = *needle++;
-+
-+      for (;; haystack++)
-+      {
-+        if (*haystack == '\0')
-+          /* No match.  */
-+          return 0;
-+        if (*haystack == b)
-+          /* The first character matches.  */
-+          {
-+            const char *rhaystack = haystack + 1;
-+            const char *rneedle = needle;
-+
-+            for (;; rhaystack++, rneedle++)
-+              {
-+                if (*rneedle == '\0')
-+                  /* Found a match.  */
-+                  return (char *) haystack;
-+                if (*rhaystack == '\0')
-+                  /* No match.  */
-+                  return 0;
-+                if (*rhaystack != *rneedle)
-+                  /* Nothing in this round.  */
-+                  break;
-+              }
-+          }
-+      }
-+    }
-+  else
-+    return (char *) haystack;
-+}
-+
-+int EXPORT_FUNC(grub_isspace) (int c);
-+
-+static inline int
-+grub_isprint (int c)
-+{
-+  return (c >= ' ' && c <= '~');
-+}
-+
-+static inline int
-+grub_iscntrl (int c)
-+{
-+  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
-+}
-+
-+static inline int
-+grub_isalpha (int c)
-+{
-+  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
-+}
-+
-+static inline int
-+grub_islower (int c)
-+{
-+  return (c >= 'a' && c <= 'z');
-+}
-+
-+static inline int
-+grub_isupper (int c)
-+{
-+  return (c >= 'A' && c <= 'Z');
-+}
-+
-+static inline int
-+grub_isgraph (int c)
-+{
-+  return (c >= '!' && c <= '~');
-+}
-+
-+static inline int
-+grub_isdigit (int c)
-+{
-+  return (c >= '0' && c <= '9');
-+}
-+
-+static inline int
-+grub_isxdigit (int c)
-+{
-+  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c 
<= 'F');
-+}
-+
-+static inline int
-+grub_isalnum (int c)
-+{
-+  return grub_isalpha (c) || grub_isdigit (c);
-+}
-+
-+static inline int
-+grub_tolower (int c)
-+{
-+  if (c >= 'A' && c <= 'Z')
-+    return c - 'A' + 'a';
-+
-+  return c;
-+}
-+
-+static inline int
-+grub_toupper (int c)
-+{
-+  if (c >= 'a' && c <= 'z')
-+    return c - 'a' + 'A';
-+
-+  return c;
-+}
-+
-+static inline int
-+grub_strcasecmp (const char *s1, const char *s2)
-+{
-+  while (*s1 && *s2)
-+    {
-+      if (grub_tolower ((grub_uint8_t) *s1)
-+        != grub_tolower ((grub_uint8_t) *s2))
-+      break;
-+
-+      s1++;
-+      s2++;
-+    }
-+
-+  return (int) grub_tolower ((grub_uint8_t) *s1)
-+    - (int) grub_tolower ((grub_uint8_t) *s2);
-+}
-+
-+static inline int
-+grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
-+{
-+  if (n == 0)
-+    return 0;
-+
-+  while (*s1 && *s2 && --n)
-+    {
-+      if (grub_tolower (*s1) != grub_tolower (*s2))
-+      break;
-+
-+      s1++;
-+      s2++;
-+    }
-+
-+  return (int) grub_tolower ((grub_uint8_t) *s1)
-+    - (int) grub_tolower ((grub_uint8_t) *s2);
-+}
-+
-+unsigned long EXPORT_FUNC(grub_strtoul) (const char *str, char **end, int 
base);
-+unsigned long long EXPORT_FUNC(grub_strtoull) (const char *str, char **end, 
int base);
-+
-+static inline long
-+grub_strtol (const char *str, char **end, int base)
-+{
-+  int negative = 0;
-+  unsigned long long magnitude;
-+
-+  while (*str && grub_isspace (*str))
-+    str++;
-+
-+  if (*str == '-')
-+    {
-+      negative = 1;
-+      str++;
-+    }
-+
-+  magnitude = grub_strtoull (str, end, base);
-+  if (negative)
-+    {
-+      if (magnitude > (unsigned long) GRUB_LONG_MAX + 1)
-+        {
-+          grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected"));
-+          return GRUB_LONG_MIN;
-+        }
-+      return -((long) magnitude);
-+    }
-+  else
-+    {
-+      if (magnitude > GRUB_LONG_MAX)
-+        {
-+          grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected"));
-+          return GRUB_LONG_MAX;
-+        }
-+      return (long) magnitude;
-+    }
-+}
-+
-+char *EXPORT_FUNC(grub_strdup) (const char *s) WARN_UNUSED_RESULT;
-+char *EXPORT_FUNC(grub_strndup) (const char *s, grub_size_t n) 
WARN_UNUSED_RESULT;
-+void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n);
-+grub_size_t EXPORT_FUNC(grub_strlen) (const char *s) WARN_UNUSED_RESULT;
-+int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ ((format 
(GNU_PRINTF, 1, 2)));
-+int EXPORT_FUNC(grub_printf_) (const char *fmt, ...) __attribute__ ((format 
(GNU_PRINTF, 1, 2)));
-+
-+/* Replace all `ch' characters of `input' with `with' and copy the
-+   result into `output'; return EOS address of `output'. */
-+static inline char *
-+grub_strchrsub (char *output, const char *input, char ch, const char *with)
-+{
-+  while (*input)
-+    {
-+      if (*input == ch)
-+      {
-+        grub_strcpy (output, with);
-+        output += grub_strlen (with);
-+        input++;
-+        continue;
-+      }
-+      *output++ = *input++;
-+    }
-+  *output = '\0';
-+  return output;
-+}
-+
-+extern void (*EXPORT_VAR (grub_xputs)) (const char *str);
-+
-+static inline int
-+grub_puts (const char *s)
-+{
-+  const char nl[2] = "\n";
-+  grub_xputs (s);
-+  grub_xputs (nl);
-+
-+  return 1;   /* Cannot fail.  */
-+}
-+
-+int EXPORT_FUNC(grub_puts_) (const char *s);
-+void EXPORT_FUNC(grub_real_dprintf) (const char *file,
-+                                     const int line,
-+                                     const char *condition,
-+                                     const char *fmt, ...) __attribute__ 
((format (GNU_PRINTF, 4, 5)));
-+int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
-+int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, 
...)
-+     __attribute__ ((format (GNU_PRINTF, 3, 4)));
-+int EXPORT_FUNC(grub_vsnprintf) (char *str, grub_size_t n, const char *fmt,
-+                               va_list args);
-+char *EXPORT_FUNC(grub_xasprintf) (const char *fmt, ...)
-+     __attribute__ ((format (GNU_PRINTF, 1, 2))) WARN_UNUSED_RESULT;
-+char *EXPORT_FUNC(grub_xvasprintf) (const char *fmt, va_list args) 
WARN_UNUSED_RESULT;
-+void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn));
-+grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n,
-+                                        grub_uint64_t d,
-+                                        grub_uint64_t *r);
-+
-+#if (defined (__MINGW32__) || defined (__CYGWIN__)) && !defined(GRUB_UTIL)
-+void EXPORT_FUNC (__register_frame_info) (void);
-+void EXPORT_FUNC (__deregister_frame_info) (void);
-+void EXPORT_FUNC (___chkstk_ms) (void);
-+void EXPORT_FUNC (__chkstk_ms) (void);
-+#endif
-+
-+/* Inline functions.  */
-+
-+static inline char *
-+grub_memchr (const void *p, int c, grub_size_t len)
-+{
-+  const char *s = (const char *) p;
-+  const char *e = s + len;
-+
-+  for (; s < e; s++)
-+    if (*s == c)
-+      return (char *) s;
-+
-+  return 0;
-+}
-+
-+
-+static inline unsigned int
-+grub_abs (int x)
-+{
-+  if (x < 0)
-+    return (unsigned int) (-x);
-+  else
-+    return (unsigned int) x;
-+}
-+
-+/* Rounded-up division */
-+static inline unsigned int
-+grub_div_roundup (unsigned int x, unsigned int y)
-+{
-+  return (x + y - 1) / y;
-+}
-+
-+/* Reboot the machine.  */
-+#if defined (GRUB_MACHINE_EMU) || defined (GRUB_MACHINE_QEMU_MIPS)
-+void EXPORT_FUNC(grub_reboot) (void) __attribute__ ((noreturn));
-+#else
-+void grub_reboot (void) __attribute__ ((noreturn));
-+#endif
-+
-+#if defined (__clang__) && !defined (GRUB_UTIL)
-+void __attribute__ ((noreturn)) EXPORT_FUNC (abort) (void);
-+#endif
-+
-+#ifdef GRUB_MACHINE_PCBIOS
-+/* Halt the system, using APM if possible. If NO_APM is true, don't
-+ * use APM even if it is available.  */
-+void grub_halt (int no_apm) __attribute__ ((noreturn));
-+#elif defined (__mips__) && !defined (GRUB_MACHINE_EMU)
-+void EXPORT_FUNC (grub_halt) (void) __attribute__ ((noreturn));
-+#else
-+void grub_halt (void) __attribute__ ((noreturn));
-+#endif
-+
-+#ifdef GRUB_MACHINE_EMU
-+/* Flag to check if module loading is available.  */
-+extern const int EXPORT_VAR(grub_no_modules);
-+#else
-+#define grub_no_modules 0
-+#endif
-+
-+static inline void
-+grub_error_save (struct grub_error_saved *save)
-+{
-+  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
-+  save->grub_errno = grub_errno;
-+  grub_errno = GRUB_ERR_NONE;
-+}
-+
-+static inline void
-+grub_error_load (const struct grub_error_saved *save)
-+{
-+  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
-+  grub_errno = save->grub_errno;
-+}
-+
-+#ifndef GRUB_UTIL
-+
-+#if defined (__arm__)
-+
-+grub_uint32_t
-+EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b);
-+
-+grub_uint32_t
-+EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b);
-+
-+#endif
-+
-+#if defined (__sparc__) || defined (__powerpc__)
-+unsigned
-+EXPORT_FUNC (__ctzdi2) (grub_uint64_t x);
-+#define NEED_CTZDI2 1
-+#endif
-+
-+#if defined (__mips__) || defined (__arm__)
-+unsigned
-+EXPORT_FUNC (__ctzsi2) (grub_uint32_t x);
-+#define NEED_CTZSI2 1
-+#endif
-+
-+#ifdef __arm__
-+grub_uint32_t
-+EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b);
-+grub_uint32_t
-+EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b);
-+
-+/* Needed for allowing modules to be compiled as thumb.  */
-+grub_uint64_t
-+EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b);
-+grub_uint64_t
-+EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b);
-+
-+#endif
-+
-+#if defined (__ia64__)
-+
-+grub_uint64_t
-+EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b);
-+
-+grub_uint64_t
-+EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b);
-+
-+#endif
-+
-+#endif /* GRUB_UTIL */
-+
-+
-+#if BOOT_TIME_STATS
-+struct grub_boot_time
-+{
-+  struct grub_boot_time *next;
-+  grub_uint64_t tp;
-+  const char *file;
-+  int line;
-+  char *msg;
-+};
-+
-+extern struct grub_boot_time *EXPORT_VAR(grub_boot_time_head);
-+
-+void EXPORT_FUNC(grub_real_boot_time) (const char *file,
-+                                     const int line,
-+                                     const char *fmt, ...) __attribute__ 
((format (GNU_PRINTF, 3, 4)));
-+#define grub_boot_time(...) grub_real_boot_time(GRUB_FILE, __LINE__, 
__VA_ARGS__)
-+#else
-+#define grub_boot_time(...)
-+#endif
-+
-+#define grub_max(a, b) (((a) > (b)) ? (a) : (b))
-+#define grub_min(a, b) (((a) < (b)) ? (a) : (b))
-+
-+#endif /* ! GRUB_MISC_HEADER */
-diff --git a/i386/grub/mm.h b/i386/grub/mm.h
-new file mode 100644
-index 0000000..28e2e53
---- /dev/null
-+++ b/i386/grub/mm.h
-@@ -0,0 +1,77 @@
-+/* mm.h - prototypes and declarations for memory manager */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2007  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef GRUB_MM_H
-+#define GRUB_MM_H     1
-+
-+#include <grub/types.h>
-+#include <grub/symbol.h>
-+#include <config.h>
-+
-+#ifndef NULL
-+# define NULL ((void *) 0)
-+#endif
-+
-+void grub_mm_init_region (void *addr, grub_size_t size);
-+void *EXPORT_FUNC(grub_malloc) (grub_size_t size);
-+void *EXPORT_FUNC(grub_zalloc) (grub_size_t size);
-+void EXPORT_FUNC(grub_free) (void *ptr);
-+void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size);
-+#ifndef GRUB_MACHINE_EMU
-+void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size);
-+#endif
-+
-+void grub_mm_check_real (const char *file, int line);
-+#define grub_mm_check() grub_mm_check_real (GRUB_FILE, __LINE__);
-+
-+/* For debugging.  */
-+#if defined(MM_DEBUG) && !defined(GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
-+/* Set this variable to 1 when you want to trace all memory function calls.  
*/
-+extern int EXPORT_VAR(grub_mm_debug);
-+
-+void grub_mm_dump_free (void);
-+void grub_mm_dump (unsigned lineno);
-+
-+#define grub_malloc(size)     \
-+  grub_debug_malloc (GRUB_FILE, __LINE__, size)
-+
-+#define grub_zalloc(size)     \
-+  grub_debug_zalloc (GRUB_FILE, __LINE__, size)
-+
-+#define grub_realloc(ptr,size)        \
-+  grub_debug_realloc (GRUB_FILE, __LINE__, ptr, size)
-+
-+#define grub_memalign(align,size)     \
-+  grub_debug_memalign (GRUB_FILE, __LINE__, align, size)
-+
-+#define grub_free(ptr)        \
-+  grub_debug_free (GRUB_FILE, __LINE__, ptr)
-+
-+void *EXPORT_FUNC(grub_debug_malloc) (const char *file, int line,
-+                                    grub_size_t size);
-+void *EXPORT_FUNC(grub_debug_zalloc) (const char *file, int line,
-+                                     grub_size_t size);
-+void EXPORT_FUNC(grub_debug_free) (const char *file, int line, void *ptr);
-+void *EXPORT_FUNC(grub_debug_realloc) (const char *file, int line, void *ptr,
-+                                     grub_size_t size);
-+void *EXPORT_FUNC(grub_debug_memalign) (const char *file, int line,
-+                                      grub_size_t align, grub_size_t size);
-+#endif /* MM_DEBUG && ! GRUB_UTIL */
-+
-+#endif /* ! GRUB_MM_H */
-diff --git a/i386/grub/symbol.h b/i386/grub/symbol.h
-new file mode 100644
-index 0000000..ed19f70
---- /dev/null
-+++ b/i386/grub/symbol.h
-@@ -0,0 +1,72 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 1999,2000,2001,2002,2006,2007,2008,2009  Free Software 
Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef GRUB_SYMBOL_HEADER
-+#define GRUB_SYMBOL_HEADER    1
-+
-+#include <config.h>
-+
-+/* Apple assembler requires local labels to start with a capital L */
-+#define LOCAL(sym)    L_ ## sym
-+
-+/* Add an underscore to a C symbol in assembler code if needed. */
-+#ifndef GRUB_UTIL
-+
-+#ifdef __APPLE__
-+#define MACRO_DOLLAR(x) $$ ## x
-+#else
-+#define MACRO_DOLLAR(x) $ ## x
-+#endif
-+
-+#if HAVE_ASM_USCORE
-+#ifdef ASM_FILE
-+# define EXT_C(sym)   _ ## sym
-+#else
-+# define EXT_C(sym)   "_" sym
-+#endif
-+#else
-+# define EXT_C(sym)   sym
-+#endif
-+
-+#ifdef __arm__
-+#define END .end
-+#endif
-+
-+#if defined (__APPLE__)
-+#define FUNCTION(x)   .globl EXT_C(x) ; EXT_C(x):
-+#define VARIABLE(x)   .globl EXT_C(x) ; EXT_C(x):
-+#elif defined (__CYGWIN__) || defined (__MINGW32__)
-+/* .type not supported for non-ELF targets.  XXX: Check this in configure? */
-+#define FUNCTION(x)   .globl EXT_C(x) ; .def EXT_C(x); .scl 2; .type 32; 
.endef; EXT_C(x):
-+#define VARIABLE(x)   .globl EXT_C(x) ; .def EXT_C(x); .scl 2; .type 0; 
.endef; EXT_C(x):
-+#elif defined (__arm__)
-+#define FUNCTION(x)   .globl EXT_C(x) ; .type EXT_C(x), %function ; EXT_C(x):
-+#define VARIABLE(x)   .globl EXT_C(x) ; .type EXT_C(x), %object ; EXT_C(x):
-+#else
-+#define FUNCTION(x)   .globl EXT_C(x) ; .type EXT_C(x), @function ; EXT_C(x):
-+#define VARIABLE(x)   .globl EXT_C(x) ; .type EXT_C(x), @object ; EXT_C(x):
-+#endif
-+#endif
-+
-+/* Mark an exported symbol.  */
-+#ifndef GRUB_SYMBOL_GENERATOR
-+# define EXPORT_FUNC(x)       x
-+# define EXPORT_VAR(x)        x
-+#endif /* ! GRUB_SYMBOL_GENERATOR */
-+
-+#endif /* ! GRUB_SYMBOL_HEADER */
-diff --git a/i386/grub/time.h b/i386/grub/time.h
-new file mode 100644
-index 0000000..64ac99a
---- /dev/null
-+++ b/i386/grub/time.h
-@@ -0,0 +1,46 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2007, 2008  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef KERNEL_TIME_HEADER
-+#define KERNEL_TIME_HEADER    1
-+
-+#include <grub/types.h>
-+#include <grub/symbol.h>
-+#ifndef GRUB_MACHINE_EMU
-+#include <grub/cpu/time.h>
-+#else
-+static inline void
-+grub_cpu_idle(void)
-+{
-+}
-+#endif
-+
-+void EXPORT_FUNC(grub_millisleep) (grub_uint32_t ms);
-+grub_uint64_t EXPORT_FUNC(grub_get_time_ms) (void);
-+
-+grub_uint64_t grub_rtc_get_time_ms (void);
-+
-+static __inline void
-+grub_sleep (grub_uint32_t s)
-+{
-+  grub_millisleep (1000 * s);
-+}
-+
-+void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void));
-+
-+#endif /* ! KERNEL_TIME_HEADER */
-diff --git a/i386/grub/types.h b/i386/grub/types.h
-new file mode 100644
-index 0000000..79f765c
---- /dev/null
-+++ b/i386/grub/types.h
-@@ -0,0 +1,325 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2005,2006,2007,2008,2009  Free Software Foundation, 
Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef GRUB_TYPES_HEADER
-+#define GRUB_TYPES_HEADER     1
-+
-+#include <config.h>
-+#ifndef GRUB_UTIL
-+#include <grub/cpu/types.h>
-+#endif
-+
-+#ifdef __MINGW32__
-+#define GRUB_PACKED __attribute__ ((packed,gcc_struct))
-+#else
-+#define GRUB_PACKED __attribute__ ((packed))
-+#endif
-+
-+#ifdef GRUB_BUILD
-+# define GRUB_CPU_SIZEOF_VOID_P       BUILD_SIZEOF_VOID_P
-+# define GRUB_CPU_SIZEOF_LONG BUILD_SIZEOF_LONG
-+# if BUILD_WORDS_BIGENDIAN
-+#  define GRUB_CPU_WORDS_BIGENDIAN    1
-+# else
-+#  undef GRUB_CPU_WORDS_BIGENDIAN
-+# endif
-+#elif defined (GRUB_UTIL)
-+# define GRUB_CPU_SIZEOF_VOID_P       SIZEOF_VOID_P
-+# define GRUB_CPU_SIZEOF_LONG SIZEOF_LONG
-+# ifdef WORDS_BIGENDIAN
-+#  define GRUB_CPU_WORDS_BIGENDIAN    1
-+# else
-+#  undef GRUB_CPU_WORDS_BIGENDIAN
-+# endif
-+#else /* ! GRUB_UTIL */
-+# define GRUB_CPU_SIZEOF_VOID_P       GRUB_TARGET_SIZEOF_VOID_P
-+# define GRUB_CPU_SIZEOF_LONG GRUB_TARGET_SIZEOF_LONG
-+# ifdef GRUB_TARGET_WORDS_BIGENDIAN
-+#  define GRUB_CPU_WORDS_BIGENDIAN    1
-+# else
-+#  undef GRUB_CPU_WORDS_BIGENDIAN
-+# endif
-+#endif /* ! GRUB_UTIL */
-+
-+#if GRUB_CPU_SIZEOF_VOID_P != 4 && GRUB_CPU_SIZEOF_VOID_P != 8
-+# error "This architecture is not supported because sizeof(void *) != 4 and 
sizeof(void *) != 8"
-+#endif
-+
-+#if GRUB_CPU_SIZEOF_LONG != 4 && GRUB_CPU_SIZEOF_LONG != 8
-+# error "This architecture is not supported because sizeof(long) != 4 and 
sizeof(long) != 8"
-+#endif
-+
-+#if !defined (GRUB_UTIL) && !defined (GRUB_TARGET_WORDSIZE)
-+# if GRUB_TARGET_SIZEOF_VOID_P == 4
-+#  define GRUB_TARGET_WORDSIZE 32
-+# elif GRUB_TARGET_SIZEOF_VOID_P == 8
-+#  define GRUB_TARGET_WORDSIZE 64
-+# endif
-+#endif
-+
-+/* Define various wide integers.  */
-+typedef signed char           grub_int8_t;
-+typedef short                 grub_int16_t;
-+typedef int                   grub_int32_t;
-+#if GRUB_CPU_SIZEOF_LONG == 8
-+typedef long                  grub_int64_t;
-+#else
-+typedef long long             grub_int64_t;
-+#endif
-+
-+typedef unsigned char         grub_uint8_t;
-+typedef unsigned short                grub_uint16_t;
-+typedef unsigned              grub_uint32_t;
-+# define PRIxGRUB_UINT32_T    "x"
-+# define PRIuGRUB_UINT32_T    "u"
-+#if GRUB_CPU_SIZEOF_LONG == 8
-+typedef unsigned long         grub_uint64_t;
-+# define PRIxGRUB_UINT64_T    "lx"
-+# define PRIuGRUB_UINT64_T    "lu"
-+#else
-+typedef unsigned long long    grub_uint64_t;
-+# define PRIxGRUB_UINT64_T    "llx"
-+# define PRIuGRUB_UINT64_T    "llu"
-+#endif
-+
-+/* Misc types.  */
-+
-+#if GRUB_CPU_SIZEOF_VOID_P == 8
-+typedef grub_uint64_t grub_addr_t;
-+typedef grub_uint64_t grub_size_t;
-+typedef grub_int64_t  grub_ssize_t;
-+
-+# define GRUB_SIZE_MAX 18446744073709551615UL
-+
-+# if GRUB_CPU_SIZEOF_LONG == 8
-+#  define PRIxGRUB_SIZE        "lx"
-+#  define PRIxGRUB_ADDR        "lx"
-+#  define PRIuGRUB_SIZE        "lu"
-+#  define PRIdGRUB_SSIZE "ld"
-+# else
-+#  define PRIxGRUB_SIZE        "llx"
-+#  define PRIxGRUB_ADDR        "llx"
-+#  define PRIuGRUB_SIZE  "llu"
-+#  define PRIdGRUB_SSIZE "lld"
-+# endif
-+#else
-+typedef grub_uint32_t grub_addr_t;
-+typedef grub_uint32_t grub_size_t;
-+typedef grub_int32_t  grub_ssize_t;
-+
-+# define GRUB_SIZE_MAX 4294967295UL
-+
-+# define PRIxGRUB_SIZE        "x"
-+# define PRIxGRUB_ADDR        "x"
-+# define PRIuGRUB_SIZE        "u"
-+# define PRIdGRUB_SSIZE       "d"
-+#endif
-+
-+#define GRUB_UCHAR_MAX 0xFF
-+#define GRUB_USHRT_MAX 65535
-+#define GRUB_SHRT_MAX 0x7fff
-+#define GRUB_UINT_MAX 4294967295U
-+#define GRUB_INT_MAX 0x7fffffff
-+#define GRUB_INT32_MIN (-2147483647 - 1)
-+#define GRUB_INT32_MAX 2147483647
-+
-+#if GRUB_CPU_SIZEOF_LONG == 8
-+# define GRUB_ULONG_MAX 18446744073709551615UL
-+# define GRUB_LONG_MAX 9223372036854775807L
-+# define GRUB_LONG_MIN (-9223372036854775807L - 1)
-+#else
-+# define GRUB_ULONG_MAX 4294967295UL
-+# define GRUB_LONG_MAX 2147483647L
-+# define GRUB_LONG_MIN (-2147483647L - 1)
-+#endif
-+
-+typedef grub_uint64_t grub_properly_aligned_t;
-+
-+#define GRUB_PROPERLY_ALIGNED_ARRAY(name, size) grub_properly_aligned_t 
name[((size) + sizeof (grub_properly_aligned_t) - 1) / sizeof 
(grub_properly_aligned_t)]
-+
-+/* The type for representing a file offset.  */
-+typedef grub_uint64_t grub_off_t;
-+
-+/* The type for representing a disk block address.  */
-+typedef grub_uint64_t grub_disk_addr_t;
-+
-+/* Byte-orders.  */
-+static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
-+{
-+   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
-+}
-+
-+#define grub_swap_bytes16_compile_time(x) ((((x) & 0xff) << 8) | (((x) & 
0xff00) >> 8))
-+#define grub_swap_bytes32_compile_time(x) ((((x) & 0xff) << 24) | (((x) & 
0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000UL) >> 24))
-+#define grub_swap_bytes64_compile_time(x)     \
-+({ \
-+   grub_uint64_t _x = (x); \
-+   (grub_uint64_t) ((_x << 56) \
-+                    | ((_x & (grub_uint64_t) 0xFF00ULL) << 40) \
-+                    | ((_x & (grub_uint64_t) 0xFF0000ULL) << 24) \
-+                    | ((_x & (grub_uint64_t) 0xFF000000ULL) << 8) \
-+                    | ((_x & (grub_uint64_t) 0xFF00000000ULL) >> 8) \
-+                    | ((_x & (grub_uint64_t) 0xFF0000000000ULL) >> 24) \
-+                    | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40) \
-+                    | (_x >> 56)); \
-+})
-+
-+#if defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 
3)
-+static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
-+{
-+      return __builtin_bswap32(x);
-+}
-+
-+static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
-+{
-+      return __builtin_bswap64(x);
-+}
-+#else                                 /* not gcc 4.3 or newer */
-+static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t _x)
-+{
-+   return ((_x << 24)
-+         | ((_x & (grub_uint32_t) 0xFF00UL) << 8)
-+         | ((_x & (grub_uint32_t) 0xFF0000UL) >> 8)
-+         | (_x >> 24));
-+}
-+
-+static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t _x)
-+{
-+   return ((_x << 56)
-+         | ((_x & (grub_uint64_t) 0xFF00ULL) << 40)
-+         | ((_x & (grub_uint64_t) 0xFF0000ULL) << 24)
-+         | ((_x & (grub_uint64_t) 0xFF000000ULL) << 8)
-+         | ((_x & (grub_uint64_t) 0xFF00000000ULL) >> 8)
-+         | ((_x & (grub_uint64_t) 0xFF0000000000ULL) >> 24)
-+         | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40)
-+         | (_x >> 56));
-+}
-+#endif                                        /* not gcc 4.3 or newer */
-+
-+#ifdef GRUB_CPU_WORDS_BIGENDIAN
-+# define grub_cpu_to_le16(x)  grub_swap_bytes16(x)
-+# define grub_cpu_to_le32(x)  grub_swap_bytes32(x)
-+# define grub_cpu_to_le64(x)  grub_swap_bytes64(x)
-+# define grub_le_to_cpu16(x)  grub_swap_bytes16(x)
-+# define grub_le_to_cpu32(x)  grub_swap_bytes32(x)
-+# define grub_le_to_cpu64(x)  grub_swap_bytes64(x)
-+# define grub_cpu_to_be16(x)  ((grub_uint16_t) (x))
-+# define grub_cpu_to_be32(x)  ((grub_uint32_t) (x))
-+# define grub_cpu_to_be64(x)  ((grub_uint64_t) (x))
-+# define grub_be_to_cpu16(x)  ((grub_uint16_t) (x))
-+# define grub_be_to_cpu32(x)  ((grub_uint32_t) (x))
-+# define grub_be_to_cpu64(x)  ((grub_uint64_t) (x))
-+# define grub_cpu_to_be16_compile_time(x)     ((grub_uint16_t) (x))
-+# define grub_cpu_to_be32_compile_time(x)     ((grub_uint32_t) (x))
-+# define grub_cpu_to_be64_compile_time(x)     ((grub_uint64_t) (x))
-+# define grub_be_to_cpu64_compile_time(x)     ((grub_uint64_t) (x))
-+# define grub_cpu_to_le32_compile_time(x)     
grub_swap_bytes32_compile_time(x)
-+# define grub_cpu_to_le64_compile_time(x)     
grub_swap_bytes64_compile_time(x)
-+# define grub_cpu_to_le16_compile_time(x)     
grub_swap_bytes16_compile_time(x)
-+#else /* ! WORDS_BIGENDIAN */
-+# define grub_cpu_to_le16(x)  ((grub_uint16_t) (x))
-+# define grub_cpu_to_le32(x)  ((grub_uint32_t) (x))
-+# define grub_cpu_to_le64(x)  ((grub_uint64_t) (x))
-+# define grub_le_to_cpu16(x)  ((grub_uint16_t) (x))
-+# define grub_le_to_cpu32(x)  ((grub_uint32_t) (x))
-+# define grub_le_to_cpu64(x)  ((grub_uint64_t) (x))
-+# define grub_cpu_to_be16(x)  grub_swap_bytes16(x)
-+# define grub_cpu_to_be32(x)  grub_swap_bytes32(x)
-+# define grub_cpu_to_be64(x)  grub_swap_bytes64(x)
-+# define grub_be_to_cpu16(x)  grub_swap_bytes16(x)
-+# define grub_be_to_cpu32(x)  grub_swap_bytes32(x)
-+# define grub_be_to_cpu64(x)  grub_swap_bytes64(x)
-+# define grub_cpu_to_be16_compile_time(x)     
grub_swap_bytes16_compile_time(x)
-+# define grub_cpu_to_be32_compile_time(x)     
grub_swap_bytes32_compile_time(x)
-+# define grub_cpu_to_be64_compile_time(x)     
grub_swap_bytes64_compile_time(x)
-+# define grub_be_to_cpu64_compile_time(x)     
grub_swap_bytes64_compile_time(x)
-+# define grub_cpu_to_le16_compile_time(x)     ((grub_uint16_t) (x))
-+# define grub_cpu_to_le32_compile_time(x)     ((grub_uint32_t) (x))
-+# define grub_cpu_to_le64_compile_time(x)     ((grub_uint64_t) (x))
-+
-+#endif /* ! WORDS_BIGENDIAN */
-+
-+static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
-+{
-+  struct grub_unaligned_uint16_t
-+  {
-+    grub_uint16_t d;
-+  } GRUB_PACKED;
-+  const struct grub_unaligned_uint16_t *dd
-+    = (const struct grub_unaligned_uint16_t *) ptr;
-+  return dd->d;
-+}
-+
-+static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
-+{
-+  struct grub_unaligned_uint16_t
-+  {
-+    grub_uint16_t d;
-+  } GRUB_PACKED;
-+  struct grub_unaligned_uint16_t *dd = (struct grub_unaligned_uint16_t *) ptr;
-+  dd->d = val;
-+}
-+
-+static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
-+{
-+  struct grub_unaligned_uint32_t
-+  {
-+    grub_uint32_t d;
-+  } GRUB_PACKED;
-+  const struct grub_unaligned_uint32_t *dd
-+    = (const struct grub_unaligned_uint32_t *) ptr;
-+  return dd->d;
-+}
-+
-+static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
-+{
-+  struct grub_unaligned_uint32_t
-+  {
-+    grub_uint32_t d;
-+  } GRUB_PACKED;
-+  struct grub_unaligned_uint32_t *dd = (struct grub_unaligned_uint32_t *) ptr;
-+  dd->d = val;
-+}
-+
-+struct grub_unaligned_uint64
-+{
-+  grub_uint64_t val;
-+} GRUB_PACKED;
-+
-+typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;
-+
-+static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
-+{
-+  const struct grub_unaligned_uint64 *dd
-+    = (const struct grub_unaligned_uint64 *) ptr;
-+  return dd->val;
-+}
-+
-+static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
-+{
-+  struct grub_unaligned_uint64_t
-+  {
-+    grub_uint64_t d;
-+  } GRUB_PACKED;
-+  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
-+  dd->d = val;
-+}
-+
-+#define GRUB_CHAR_BIT 8
-+
-+#endif /* ! GRUB_TYPES_HEADER */
-diff --git a/i386/i386at/acpi.c b/i386/i386at/acpi.c
-new file mode 100644
-index 0000000..ec8aeb1
---- /dev/null
-+++ b/i386/i386at/acpi.c
-@@ -0,0 +1,82 @@
-+/* acpi.c - get acpi tables. */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2009  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <grub/glue.h>
-+#include <grub/acpi.h>
-+#include <grub/misc.h>
-+
-+struct grub_acpi_rsdp_v10 *
-+grub_machine_acpi_get_rsdpv1 (void)
-+{
-+  int ebda_len;
-+  grub_uint8_t *ebda, *ptr;
-+
-+  grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n");
-+  ebda = (grub_uint8_t *) phystokv ((* ((grub_uint16_t *) phystokv (0x40e))) 
<< 4);
-+  ebda_len = * (grub_uint16_t *) ebda;
-+  if (! ebda_len)
-+    return 0;
-+  for (ptr = ebda; ptr < ebda + 0x400; ptr += 16)
-+    if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
-+      && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0
-+      && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0)
-+      return (struct grub_acpi_rsdp_v10 *) ptr;
-+
-+  grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n");
-+  for (ptr = (grub_uint8_t *) phystokv (0xe0000); ptr < (grub_uint8_t *) 
phystokv (0x100000);
-+       ptr += 16)
-+    if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
-+      && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0
-+      && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0)
-+      return (struct grub_acpi_rsdp_v10 *) ptr;
-+  return 0;
-+}
-+
-+struct grub_acpi_rsdp_v20 *
-+grub_machine_acpi_get_rsdpv2 (void)
-+{
-+  int ebda_len;
-+  grub_uint8_t *ebda, *ptr;
-+
-+  grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n");
-+  ebda = (grub_uint8_t *) phystokv ((* ((grub_uint16_t *) phystokv (0x40e))) 
<< 4);
-+  ebda_len = * (grub_uint16_t *) ebda;
-+  if (! ebda_len)
-+    return 0;
-+  for (ptr = ebda; ptr < ebda + 0x400; ptr += 16)
-+    if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
-+      && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0
-+      && ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0
-+      && ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024
-+      && grub_byte_checksum (ptr, ((struct grub_acpi_rsdp_v20 *) ptr)->length)
-+      == 0)
-+      return (struct grub_acpi_rsdp_v20 *) ptr;
-+
-+  grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n");
-+  for (ptr = (grub_uint8_t *) phystokv (0xe0000); ptr < (grub_uint8_t *) 
phystokv (0x100000);
-+       ptr += 16)
-+    if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
-+      && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0
-+      && ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0
-+      && ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024
-+      && grub_byte_checksum (ptr, ((struct grub_acpi_rsdp_v20 *) ptr)->length)
-+      == 0)
-+      return (struct grub_acpi_rsdp_v20 *) ptr;
-+  return 0;
-+}
-diff --git a/i386/i386at/acpihalt.c b/i386/i386at/acpihalt.c
-new file mode 100644
-index 0000000..23df44f
---- /dev/null
-+++ b/i386/i386at/acpihalt.c
-@@ -0,0 +1,409 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2010  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  GRUB is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <grub/glue.h>
-+
-+#ifdef GRUB_DSDT_TEST
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <stdlib.h>
-+#include <stdint.h>
-+#include <string.h>
-+#include <errno.h>
-+
-+#define grub_dprintf(cond, args...) printf ( args )
-+#define grub_printf printf
-+typedef uint64_t grub_uint64_t;
-+typedef uint32_t grub_uint32_t;
-+typedef uint16_t grub_uint16_t;
-+typedef uint8_t grub_uint8_t;
-+
-+#endif
-+
-+#include <grub/acpi.h>
-+#ifndef GRUB_DSDT_TEST
-+#include <grub/i18n.h>
-+#else
-+#define _(x) x
-+#define N_(x) x
-+#endif
-+
-+#ifndef GRUB_DSDT_TEST
-+#include <grub/mm.h>
-+#include <grub/misc.h>
-+#include <grub/time.h>
-+#include <grub/cpu/io.h>
-+#endif
-+
-+static inline grub_uint32_t
-+decode_length (const grub_uint8_t *ptr, int *numlen)
-+{
-+  int num_bytes, i;
-+  grub_uint32_t ret;
-+  if (*ptr < 64)
-+    {
-+      if (numlen)
-+      *numlen = 1;
-+      return *ptr;
-+    }
-+  num_bytes = *ptr >> 6;
-+  if (numlen)
-+    *numlen = num_bytes + 1;
-+  ret = *ptr & 0xf;
-+  ptr++;
-+  for (i = 0; i < num_bytes; i++)
-+    {
-+      ret |= *ptr << (8 * i + 4);
-+      ptr++;
-+    }
-+  return ret;
-+}
-+
-+static inline grub_uint32_t
-+skip_name_string (const grub_uint8_t *ptr, const grub_uint8_t *end)
-+{
-+  const grub_uint8_t *ptr0 = ptr;
-+  
-+  while (ptr < end && (*ptr == '^' || *ptr == '\\'))
-+    ptr++;
-+  switch (*ptr)
-+    {
-+    case '.':
-+      ptr++;
-+      ptr += 8;
-+      break;
-+    case '/':
-+      ptr++;
-+      ptr += 1 + (*ptr) * 4;
-+      break;
-+    case 0:
-+      ptr++;
-+      break;
-+    default:
-+      ptr += 4;
-+      break;
-+    }
-+  return ptr - ptr0;
-+}
-+
-+static inline grub_uint32_t
-+skip_data_ref_object (const grub_uint8_t *ptr, const grub_uint8_t *end)
-+{
-+  grub_dprintf ("acpi", "data type = 0x%x\n", *ptr);
-+  switch (*ptr)
-+    {
-+    case GRUB_ACPI_OPCODE_PACKAGE:
-+    case GRUB_ACPI_OPCODE_BUFFER:
-+      return 1 + decode_length (ptr + 1, 0);
-+    case GRUB_ACPI_OPCODE_ZERO:
-+    case GRUB_ACPI_OPCODE_ONES:
-+    case GRUB_ACPI_OPCODE_ONE:
-+      return 1;
-+    case GRUB_ACPI_OPCODE_BYTE_CONST:
-+      return 2;
-+    case GRUB_ACPI_OPCODE_WORD_CONST:
-+      return 3;
-+    case GRUB_ACPI_OPCODE_DWORD_CONST:
-+      return 5;
-+    case GRUB_ACPI_OPCODE_STRING_CONST:
-+      {
-+      const grub_uint8_t *ptr0 = ptr;
-+      for (ptr++; ptr < end && *ptr; ptr++);
-+      if (ptr == end)
-+        return 0;
-+      return ptr - ptr0 + 1;
-+      }
-+    default:
-+      if (*ptr == '^' || *ptr == '\\' || *ptr == '_'
-+        || (*ptr >= 'A' && *ptr <= 'Z'))
-+      return skip_name_string (ptr, end);
-+      grub_printf ("Unknown opcode 0x%x\n", *ptr);
-+      return 0;
-+    }
-+}
-+
-+static inline grub_uint32_t
-+skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end)
-+{
-+  const grub_uint8_t *ptr0 = ptr;
-+  int add;
-+  grub_dprintf ("acpi", "Extended opcode: 0x%x\n", *ptr);
-+  switch (*ptr)
-+    {
-+    case GRUB_ACPI_EXTOPCODE_MUTEX:
-+      ptr++;
-+      ptr += skip_name_string (ptr, end);
-+      ptr++;
-+      break;
-+    case GRUB_ACPI_EXTOPCODE_EVENT_OP:
-+      ptr++;
-+      ptr += skip_name_string (ptr, end);
-+      break;
-+    case GRUB_ACPI_EXTOPCODE_OPERATION_REGION:
-+      ptr++;
-+      ptr += skip_name_string (ptr, end);
-+      ptr++;
-+      ptr += add = skip_data_ref_object (ptr, end);
-+      if (!add)
-+      return 0;
-+      ptr += add = skip_data_ref_object (ptr, end);
-+      if (!add)
-+      return 0;
-+      break;
-+    case GRUB_ACPI_EXTOPCODE_FIELD_OP:
-+    case GRUB_ACPI_EXTOPCODE_DEVICE_OP:
-+    case GRUB_ACPI_EXTOPCODE_PROCESSOR_OP:
-+    case GRUB_ACPI_EXTOPCODE_POWER_RES_OP:
-+    case GRUB_ACPI_EXTOPCODE_THERMAL_ZONE_OP:
-+    case GRUB_ACPI_EXTOPCODE_INDEX_FIELD_OP:
-+    case GRUB_ACPI_EXTOPCODE_BANK_FIELD_OP:
-+      ptr++;
-+      ptr += decode_length (ptr, 0);
-+      break;
-+    default:
-+      grub_printf ("Unexpected extended opcode: 0x%x\n", *ptr);
-+      return 0;
-+    }
-+  return ptr - ptr0;
-+}
-+
-+static int
-+get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end,
-+              grub_uint8_t *scope, int scope_len)
-+{
-+  grub_uint8_t *prev = table;
-+  
-+  if (!ptr)
-+    ptr = table + sizeof (struct grub_acpi_table_header);
-+  while (ptr < end && prev < ptr)
-+    {
-+      int add;
-+      prev = ptr;
-+      grub_dprintf ("acpi", "Opcode 0x%x\n", *ptr);
-+      grub_dprintf ("acpi", "Tell %x\n", (unsigned) (ptr - table));
-+      switch (*ptr)
-+      {
-+      case GRUB_ACPI_OPCODE_EXTOP:
-+        ptr++;
-+        ptr += add = skip_ext_op (ptr, end);
-+        if (!add)
-+          return -1;
-+        break;
-+      case GRUB_ACPI_OPCODE_CREATE_WORD_FIELD:
-+      case GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD:
-+        {
-+          ptr += 5;
-+          ptr += add = skip_data_ref_object (ptr, end);
-+          if (!add)
-+            return -1;
-+          ptr += 4;
-+          break;
-+        }
-+      case GRUB_ACPI_OPCODE_NAME:
-+        ptr++;
-+        if ((!scope || grub_memcmp (scope, "\\", scope_len) == 0) &&
-+            (grub_memcmp (ptr, "_S5_", 4) == 0 || grub_memcmp (ptr, "\\_S5_", 
4) == 0))
-+          {
-+            int ll;
-+            grub_uint8_t *ptr2 = ptr;
-+            grub_dprintf ("acpi", "S5 found\n");
-+            ptr2 += skip_name_string (ptr, end);
-+            if (*ptr2 != 0x12)
-+              {
-+                grub_printf ("Unknown opcode in _S5: 0x%x\n", *ptr2);
-+                return -1;
-+              }
-+            ptr2++;
-+            decode_length (ptr2, &ll);
-+            ptr2 += ll;
-+            ptr2++;
-+            switch (*ptr2)
-+              {
-+              case GRUB_ACPI_OPCODE_ZERO:
-+                return 0;
-+              case GRUB_ACPI_OPCODE_ONE:
-+                return 1;
-+              case GRUB_ACPI_OPCODE_BYTE_CONST:
-+                return ptr2[1];
-+              default:
-+                grub_printf ("Unknown data type in _S5: 0x%x\n", *ptr2);
-+                return -1;
-+              }
-+          }
-+        ptr += add = skip_name_string (ptr, end);
-+        if (!add)
-+          return -1;
-+        ptr += add = skip_data_ref_object (ptr, end);
-+        if (!add)
-+          return -1;
-+        break;
-+      case GRUB_ACPI_OPCODE_SCOPE:
-+        {
-+          int scope_sleep_type;
-+          int ll;
-+          grub_uint8_t *name;
-+          int name_len;
-+
-+          ptr++;
-+          add = decode_length (ptr, &ll);
-+          name = ptr + ll;
-+          name_len = skip_name_string (name, ptr + add);
-+          if (!name_len)
-+            return -1;
-+          scope_sleep_type = get_sleep_type (table, name + name_len,
-+                                             ptr + add, name, name_len);
-+          if (scope_sleep_type != -2)
-+            return scope_sleep_type;
-+          ptr += add;
-+          break;
-+        }
-+      case GRUB_ACPI_OPCODE_IF:
-+      case GRUB_ACPI_OPCODE_METHOD:
-+        {
-+          ptr++;
-+          ptr += decode_length (ptr, 0);
-+          break;
-+        }
-+      default:
-+        grub_printf ("Unknown opcode 0x%x\n", *ptr);
-+        return -1;      
-+      }
-+    }
-+
-+  return -2;
-+}
-+
-+#ifdef GRUB_DSDT_TEST
-+int
-+main (int argc, char **argv)
-+{
-+  FILE *f;
-+  size_t len;
-+  unsigned char *buf;
-+  if (argc < 2)
-+    printf ("Usage: %s FILE\n", argv[0]);
-+  f = grub_util_fopen (argv[1], "rb");
-+  if (!f)
-+    {
-+      printf ("Couldn't open file\n");
-+      return 1;
-+    }
-+  fseek (f, 0, SEEK_END);
-+  len = ftell (f);
-+  fseek (f, 0, SEEK_SET);
-+  buf = malloc (len);
-+  if (!buf)
-+    {
-+      printf (_("error: %s.\n"), _("out of memory"));
-+      fclose (f);
-+      return 2;
-+    }
-+  if (fread (buf, 1, len, f) != len)
-+    {
-+      printf (_("cannot read `%s': %s"), argv[1], strerror (errno));
-+      free (buf);
-+      fclose (f);
-+      return 2;
-+    }
-+
-+  printf ("Sleep type = %d\n", get_sleep_type (buf, NULL, buf + len, NULL, 
0));
-+  free (buf);
-+  fclose (f);
-+  return 0;
-+}
-+
-+#else
-+
-+void
-+grub_acpi_halt (void)
-+{
-+  struct grub_acpi_rsdp_v20 *rsdp2;
-+  struct grub_acpi_rsdp_v10 *rsdp1;
-+  struct grub_acpi_table_header *rsdt;
-+  grub_uint32_t *entry_ptr;
-+  grub_uint32_t port = 0;
-+  int sleep_type = -1;
-+
-+  rsdp2 = grub_acpi_get_rsdpv2 ();
-+  if (rsdp2)
-+    rsdp1 = &(rsdp2->rsdpv1);
-+  else
-+    rsdp1 = grub_acpi_get_rsdpv1 ();
-+  grub_dprintf ("acpi", "rsdp1=%p\n", rsdp1);
-+  if (!rsdp1)
-+    return;
-+
-+  rsdt = (struct grub_acpi_table_header *)
-+    io_map_cached (rsdp1->rsdt_addr, sizeof *rsdt);
-+  rsdt = (struct grub_acpi_table_header *)
-+    io_map_cached (rsdp1->rsdt_addr, rsdt->length);
-+
-+  for (entry_ptr = (grub_uint32_t *) (rsdt + 1);
-+       entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt)
-+                                    + rsdt->length);
-+       entry_ptr++)
-+    {
-+      if (grub_memcmp ((void *) io_map_cached (*entry_ptr, 4),
-+                     "FACP", 4) == 0)
-+      {
-+        struct grub_acpi_fadt *fadt = (struct grub_acpi_fadt *)
-+          io_map_cached (*entry_ptr, sizeof *fadt);
-+
-+        struct grub_acpi_table_header *dsdt =
-+          (struct grub_acpi_table_header *)
-+          io_map_cached (fadt->dsdt_addr, sizeof *dsdt);
-+        grub_uint8_t *buf = (grub_uint8_t *)
-+          io_map_cached (fadt->dsdt_addr, dsdt->length);
-+
-+        port = fadt->pm1a;
-+
-+        grub_dprintf ("acpi", "PM1a port=%x\n", port);
-+
-+        if (grub_memcmp (dsdt->signature, "DSDT",
-+                         sizeof (dsdt->signature)) == 0
-+            && sleep_type < 0)
-+          sleep_type = get_sleep_type (buf, NULL, buf + dsdt->length,
-+                                       NULL, 0);
-+      }
-+      else
-+      if (grub_memcmp ((void *) io_map_cached (*entry_ptr, 4), "SSDT", 4) == 0
-+          && sleep_type < 0)
-+      {
-+        struct grub_acpi_table_header *ssdt
-+          = (struct grub_acpi_table_header *) (grub_addr_t)
-+          io_map_cached (*entry_ptr, sizeof *ssdt);
-+        grub_uint8_t *buf = (grub_uint8_t *)
-+          io_map_cached (*entry_ptr, ssdt->length);
-+
-+        grub_dprintf ("acpi", "SSDT = %p\n", ssdt);
-+
-+        sleep_type = get_sleep_type (buf, NULL, buf + ssdt->length, NULL, 0);
-+      }
-+    }
-+
-+  grub_dprintf ("acpi", "SLP_TYP = %d, port = 0x%x\n", sleep_type, port);
-+  if (port && sleep_type >= 0 && sleep_type < 8)
-+    grub_outw (GRUB_ACPI_SLP_EN | (sleep_type << GRUB_ACPI_SLP_TYP_OFFSET),
-+             port & 0xffff);
-+
-+  grub_millisleep (1500);
-+
-+  /* TRANSLATORS: It's computer shutdown using ACPI, not disabling ACPI.  */
-+  grub_puts_ (N_("ACPI shutdown failed"));
-+}
-+#endif
-diff --git a/i386/i386at/acpihalt.h b/i386/i386at/acpihalt.h
-new file mode 100644
-index 0000000..a4fdb07
---- /dev/null
-+++ b/i386/i386at/acpihalt.h
-@@ -0,0 +1,23 @@
-+/*
-+ * Copyright (c) 2014 Free Software Foundation.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef _ACPIHALT_H_
-+#define _ACPIHALT_H_
-+
-+void grub_acpi_halt (void);
-+
-+#endif /* _ACPIHALT_H_ */
-diff --git a/i386/i386at/grub_glue.c b/i386/i386at/grub_glue.c
-new file mode 100644
-index 0000000..68a4cb1
---- /dev/null
-+++ b/i386/i386at/grub_glue.c
-@@ -0,0 +1,67 @@
-+/*
-+ * Copyright (c) 2014 Free Software Foundation.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <kern/printf.h>
-+#include <stdarg.h>
-+#include <i386/vm_param.h>
-+
-+#include <grub/glue.h>
-+#include <grub/acpi.h>
-+
-+#define GRUB_DEBUG 0
-+
-+void
-+grub_real_dprintf (const char *file, const int line, const char *condition,
-+                 const char *fmt, ...)
-+{
-+#if GRUB_DEBUG
-+  va_list     listp;
-+  va_start(listp, fmt);
-+  vprintf (fmt, listp);
-+  va_end(listp);
-+#endif
-+}
-+
-+void
-+grub_millisleep (grub_uint32_t ms)
-+{
-+  /* Do nothing.  */
-+}
-+
-+struct grub_acpi_rsdp_v20 *
-+grub_acpi_get_rsdpv2 (void)
-+{
-+  return grub_machine_acpi_get_rsdpv2 ();
-+}
-+
-+struct grub_acpi_rsdp_v10 *
-+grub_acpi_get_rsdpv1 (void)
-+{
-+  return grub_machine_acpi_get_rsdpv1 ();
-+}
-+
-+/* Simple checksum by summing all bytes. Used by ACPI and SMBIOS. */
-+grub_uint8_t
-+grub_byte_checksum (void *base, grub_size_t size)
-+{
-+  grub_uint8_t *ptr;
-+  grub_uint8_t ret = 0;
-+  for (ptr = (grub_uint8_t *) base; ptr < ((grub_uint8_t *) base) + size;
-+       ptr++)
-+    ret += *ptr;
-+  return ret;
-+}
-diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
-index 95752fa..6093a66 100644
---- a/i386/i386at/model_dep.c
-+++ b/i386/i386at/model_dep.c
-@@ -69,6 +69,7 @@
- #include <i386at/int_init.h>
- #include <i386at/kd.h>
- #include <i386at/rtc.h>
-+#include <i386at/acpihalt.h>
- #ifdef        MACH_XEN
- #include <xen/console.h>
- #include <xen/store.h>
-@@ -231,6 +232,7 @@ void halt_all_cpus(boolean_t reboot)
- #ifdef        MACH_HYP
-           hyp_halt();
- #endif        /* MACH_HYP */
-+          grub_acpi_halt();
-           printf("In tight loop: hit ctl-alt-del to reboot\n");
-           (void) spl0();
-       }
-commit 97447914d6dcc32ada4ee028e1e2bab262501316
-Author: Samuel Thibault <address@hidden>
-Date:   Sun Jul 6 18:48:45 2014 +0200
-
-    Document that io_map_cached leaks memory
-
-diff --git a/i386/grub/glue.h b/i386/grub/glue.h
-index e1c62eb..ae41014 100644
---- a/i386/grub/glue.h
-+++ b/i386/grub/glue.h
-@@ -26,6 +26,8 @@
- #include <mach/mach_types.h>
- #include <i386/vm_param.h>
- 
-+/* Warning: this leaks memory maps for now, do not use it yet for something
-+ * else than Mach shutdown. */
- vm_offset_t io_map_cached(vm_offset_t phys_addr, vm_size_t size);
- 
- #endif /* _GRUB_GLUE_H */
-diff --git a/i386/i386/io_map.c b/i386/i386/io_map.c
-index 03d7152..2c2aa72 100644
---- a/i386/i386/io_map.c
-+++ b/i386/i386/io_map.c
-@@ -66,6 +66,9 @@ io_map(
-  * This maps the all pages containing [PHYS_ADDR:PHYS_ADDR + SIZE].
-  * For contiguous requests to those pages will reuse the previously
-  * established mapping.
-+ *
-+ * Warning: this leaks memory maps for now, do not use it yet for something
-+ * else than Mach shutdown.
-  */
- vm_offset_t
- io_map_cached(
-commit 859c342d11a2d018e7b220e955bbe1ba1940f02f
-Author: Samuel Thibault <address@hidden>
-Date:   Sun Jul 6 18:49:55 2014 +0200
-
-    Do not unmap page 0 when not needed
-    
-    Since we need it to access some BIOS information, e.g. at ACPI shutdown.  
When
-    the kernel VM is not starting at 0, there is already nothing mapped there 
in
-    user tasks, anyway.
-    
-    * i386/i386at/model_dep.c (machine_init) [VM_MIN_KERNEL_ADDRESS != 0]:
-    Do not call pmap_unmap_page_zero.
-    * i386/intel/pmap.c (pmap_unmap_page_zero): Warn that unmapping page
-    zero may break some BIOS functions.
-
-diff --git a/i386/i386at/acpi.c b/i386/i386at/acpi.c
-index ec8aeb1..986b3a2 100644
---- a/i386/i386at/acpi.c
-+++ b/i386/i386at/acpi.c
-@@ -55,8 +55,11 @@ grub_machine_acpi_get_rsdpv2 (void)
-   grub_uint8_t *ebda, *ptr;
- 
-   grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n");
-+  printf("ptr is %p\n", (* ((grub_uint16_t *) phystokv (0x40e))) << 4);
-+  printf("len is %u\n", *( (grub_uint16_t *) phystokv ((* ((grub_uint16_t *) 
phystokv (0x40e))) << 4)));
-   ebda = (grub_uint8_t *) phystokv ((* ((grub_uint16_t *) phystokv (0x40e))) 
<< 4);
-   ebda_len = * (grub_uint16_t *) ebda;
-+  printf("EBDA len %d\n", ebda_len);
-   if (! ebda_len)
-     return 0;
-   for (ptr = ebda; ptr < ebda + 0x400; ptr += 16)
-diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
-index 6093a66..209cfb1 100644
---- a/i386/i386at/model_dep.c
-+++ b/i386/i386at/model_dep.c
-@@ -180,10 +180,14 @@ void machine_init(void)
-       *(unsigned short *)phystokv(0x472) = 0x1234;
- #endif        /* MACH_HYP */
- 
-+#if VM_MIN_KERNEL_ADDRESS == 0
-       /*
-        * Unmap page 0 to trap NULL references.
-+       *
-+       * Note that this breaks accessing some BIOS areas stored there.
-        */
-       pmap_unmap_page_zero();
-+#endif
- }
- 
- /* Conserve power on processor CPU.  */
-diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
-index 8a23a44..62b33cf 100644
---- a/i386/intel/pmap.c
-+++ b/i386/intel/pmap.c
-@@ -2835,6 +2835,7 @@ pmap_unmap_page_zero (void)
- {
-   int *pte;
- 
-+  printf("Unmapping the zero page.  Some BIOS functions may not be working 
any more.\n");
-   pte = (int *) pmap_pte (kernel_pmap, 0);
-   if (!pte)
-     return;
diff --git a/debian/patches/git-kentry_data_size.patch 
b/debian/patches/git-kentry_data_size.patch
deleted file mode 100644
index d7529d2..0000000
--- a/debian/patches/git-kentry_data_size.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit dd0989ad8e7526844fcbc2e26bbcc4cc37a010ac
-Author: Richard Braun <address@hidden>
-Date:   Thu Oct 10 20:21:17 2013 +0200
-
-    Increase kernel map entry pool size
-    
-    * vm/vm_map.h (KENTRY_DATA_SIZE): Set to 256 pages.
-
-diff --git a/vm/vm_map.h b/vm/vm_map.h
-index 5fdac4e..1caf9ae 100644
---- a/vm/vm_map.h
-+++ b/vm/vm_map.h
-@@ -55,7 +55,7 @@
- #include <kern/macro_help.h>
- 
- /* TODO: make it dynamic */
--#define KENTRY_DATA_SIZE (64*PAGE_SIZE)
-+#define KENTRY_DATA_SIZE (256*PAGE_SIZE)
- 
- /*
-  *    Types defined:
-
-
-Additionally reduce the slab size to 64MiB to make room for that.
-
-diff --git a/kern/slab.c b/kern/slab.c
-index 47c2c8f..4034579 100644
---- a/kern/slab.c
-+++ b/kern/slab.c
-@@ -165,7 +165,7 @@
- /*
-  * Size of the VM submap from which default backend functions allocate.
-  */
--#define KMEM_MAP_SIZE (128 * 1024 * 1024)
-+#define KMEM_MAP_SIZE (96 * 1024 * 1024)
- 
- /*
-  * Shift for the first kalloc cache size.
diff --git a/debian/patches/git-mach_debug.patch 
b/debian/patches/git-mach_debug.patch
deleted file mode 100644
index 883ea06..0000000
--- a/debian/patches/git-mach_debug.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit d12207fb5a8cef131f262878f98da923af1f8fea
-Author: Justus Winter <address@hidden>
-Date:   Wed Apr 30 13:02:29 2014 +0200
-
-    Install the mach_debug header files
-    
-    The task_set_name RPC introduced in 877a319c changed
-    include/mach/gnumach.defs to include mach_debug/mach_debug_types.defs.
-    Previously though, the debug headers were not installed.
-    
-    * Makefrag.am: Install the mach_debug header files.
-
-diff --git a/Makefrag.am b/Makefrag.am
-index c1387bd..d6dd77f 100644
---- a/Makefrag.am
-+++ b/Makefrag.am
-@@ -419,9 +419,18 @@ include_mach_eXec_HEADERS = \
-       include/mach/exec/elf.h \
-       include/mach/exec/exec.h
- 
--# mach-debug-headers:= $(addprefix mach_debug/, hash_info.h ipc_info.h \
--#             mach_debug.defs mach_debug_types.defs mach_debug_types.h \
--#             pc_info.h vm_info.h slab_info.h)
-+include_mach_debugdir = $(includedir)/mach_debug
-+include_mach_debug_HEADERS = \
-+      $(addprefix include/mach_debug/, \
-+              hash_info.h \
-+              ipc_info.h \
-+              mach_debug.defs \
-+              mach_debug_types.defs \
-+              mach_debug_types.h \
-+              pc_info.h \
-+              vm_info.h \
-+              slab_info.h \
-+      )
- 
- # Other headers for the distribution.  We don't install these, because the
- # GNU C library has correct versions for users to use.
diff --git a/debian/patches/git-mach_debug2.patch 
b/debian/patches/git-mach_debug2.patch
deleted file mode 100644
index bb5146d..0000000
--- a/debian/patches/git-mach_debug2.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-commit 32b5d3ceb7a120b76f10f69afb6acbf453a76bbc
-Author: Justus Winter <address@hidden>
-Date:   Wed Apr 30 13:52:47 2014 +0200
-
-    include: do not guard the host_slab_info RPC with MACH_VM_DEBUG
-    
-    Previously, the definition of the host_slab_info RPC was guarded with
-    MACH_VM_DEBUG, even though it is not at all concerned with the VM
-    subsystem.  Furthermore, there was no "skip" directive for
-    host_slab_info.
-    
-    The function host_slab_info is guarded with MACH_DEBUG.  The server
-    for the RPCs in mach_debug.defs is only used if MACH_DEBUG is
-    defined. There is no need to guard host_slab_info.
-    
-    * include/mach_debug/mach_debug.defs (host_slab_info): Unconditionally
-    include the RPC.
-
-diff --git a/include/mach_debug/mach_debug.defs 
b/include/mach_debug/mach_debug.defs
-index 053c3fe..fb6e3a9 100644
---- a/include/mach_debug/mach_debug.defs
-+++ b/include/mach_debug/mach_debug.defs
-@@ -218,6 +218,12 @@ routine mach_vm_object_pages(
-       out     pages           : vm_page_info_array_t,
-                                       CountInOut, Dealloc);
- 
-+#else /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
-+skip; /* mach_vm_region_info */
-+skip; /* mach_vm_object_info */
-+skip; /* mach_vm_object_pages */
-+#endif        /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
-+
- /*
-  *    Returns information about the memory allocation caches.
-  */
-@@ -225,9 +231,3 @@ routine host_slab_info(
-               host            : host_t;
-       out     info            : cache_info_array_t,
-                                       CountInOut, Dealloc);
--
--#else /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
--skip; /* mach_vm_region_info */
--skip; /* mach_vm_object_info */
--skip; /* mach_vm_object_pages */
--#endif        /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
diff --git a/debian/patches/git-memory_object_translatable.patch 
b/debian/patches/git-memory_object_translatable.patch
deleted file mode 100644
index 37df93c..0000000
--- a/debian/patches/git-memory_object_translatable.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-commit 50cc5152ebb4872b57a764d7b5ad62636f674e01
-Author: Justus Winter <address@hidden>
-Date:   Mon Mar 3 19:12:52 2014 +0100
-
-    include: make the memory_object_t types translation functions mutable
-    
-    Make the intran, outtran and destructor functions mutable using
-    preprocessor macros.  Make it possible to inject imports using the
-    MEMORY_OBJECT_IMPORTS macro.  This way, userspace servers can provide
-    their own translation functions.
-    
-    * include/mach/mach_types.defs (memory_object_t): Make the translation
-    mutable using preprocessor macros.
-    * include/mach/memory_object.defs: Likewise for the inlined type 
declarations.
-    Honor MEMORY_OBJECT_IMPORTS.
-    * include/mach/memory_object_default.defs: Likewise.
-
-diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs
-index 607d5d9..bfce6cb 100644
---- a/include/mach/mach_types.defs
-+++ b/include/mach/mach_types.defs
-@@ -135,6 +135,16 @@ type memory_object_t = mach_port_t
-               ctype: mach_port_t
- #if   KERNEL_SERVER
-               intran: ipc_port_t null_conversion(mach_port_t)
-+#else /* KERNEL_SERVER */
-+#ifdef        MEMORY_OBJECT_INTRAN
-+              intran: MEMORY_OBJECT_INTRAN
-+#endif
-+#ifdef        MEMORY_OBJECT_OUTTRAN
-+              outtran: MEMORY_OBJECT_OUTTRAN
-+#endif
-+#ifdef        MEMORY_OBJECT_DESTRUCTOR
-+              destructor: MEMORY_OBJECT_DESTRUCTOR
-+#endif
- #endif        /* KERNEL_SERVER */
-               ;
- 
-diff --git a/include/mach/memory_object.defs b/include/mach/memory_object.defs
-index ea7989a..0ed8dbc 100644
---- a/include/mach/memory_object.defs
-+++ b/include/mach/memory_object.defs
-@@ -42,6 +42,10 @@ subsystem
- #include <mach/std_types.defs>
- #include <mach/mach_types.defs>
- 
-+#ifdef        MEMORY_OBJECT_IMPORTS
-+MEMORY_OBJECT_IMPORTS
-+#endif
-+
- #if   SEQNOS
- serverprefix seqnos_;
- serverdemux seqnos_memory_object_server;
-@@ -85,7 +89,11 @@ simpleroutine       memory_object_init(
- simpleroutine memory_object_terminate(
-               memory_object           : memory_object_t =
-                                               MACH_MSG_TYPE_MOVE_SEND
--                                              ctype: mach_port_t;
-+                                              ctype: mach_port_t
-+#ifdef        MEMORY_OBJECT_INTRAN
-+                                              intran: MEMORY_OBJECT_INTRAN
-+#endif
-+                                              ;
- #if   SEQNOS
-       msgseqno seqno                  : mach_port_seqno_t;
- #endif        /* SEQNOS */
-@@ -221,7 +229,11 @@ simpleroutine     memory_object_data_write(
- simpleroutine memory_object_lock_completed(
-               memory_object           : memory_object_t =
-                       polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
--                      ctype: mach_port_t;
-+                      ctype: mach_port_t
-+#ifdef        MEMORY_OBJECT_INTRAN
-+                      intran: MEMORY_OBJECT_INTRAN
-+#endif
-+                      ;
- #if   SEQNOS
-       msgseqno seqno                  : mach_port_seqno_t;
- #endif        /* SEQNOS */
-@@ -252,7 +264,11 @@ simpleroutine     memory_object_lock_completed(
- simpleroutine memory_object_supply_completed(
-               memory_object           : memory_object_t =
-                       polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
--                      ctype: mach_port_t;
-+                      ctype: mach_port_t
-+#ifdef        MEMORY_OBJECT_INTRAN
-+                      intran: MEMORY_OBJECT_INTRAN
-+#endif
-+                      ;
- #if   SEQNOS
-       msgseqno seqno                  : mach_port_seqno_t;
- #endif        /* SEQNOS */
-@@ -298,7 +314,11 @@ simpleroutine   memory_object_data_return(
- simpleroutine memory_object_change_completed(
-               memory_object           : memory_object_t =
-                       polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
--                      ctype: mach_port_t;
-+                      ctype: mach_port_t
-+#ifdef        MEMORY_OBJECT_INTRAN
-+                      intran: MEMORY_OBJECT_INTRAN
-+#endif
-+                      ;
- #if   SEQNOS
-       msgseqno seqno                  : mach_port_seqno_t;
- #endif        /* SEQNOS */
-diff --git a/include/mach/memory_object_default.defs 
b/include/mach/memory_object_default.defs
-index 0eac271..cfd54a4 100644
---- a/include/mach/memory_object_default.defs
-+++ b/include/mach/memory_object_default.defs
-@@ -40,6 +40,10 @@ subsystem
- #include <mach/std_types.defs>
- #include <mach/mach_types.defs>
- 
-+#ifdef        MEMORY_OBJECT_IMPORTS
-+MEMORY_OBJECT_IMPORTS
-+#endif
-+
- #if   SEQNOS
- serverprefix seqnos_;
- serverdemux seqnos_memory_object_default_server;
diff --git a/debian/patches/git-memory_object_translatable2.patch 
b/debian/patches/git-memory_object_translatable2.patch
deleted file mode 100644
index c8e361d..0000000
--- a/debian/patches/git-memory_object_translatable2.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-In order to use MIG translation functions to lookup memory objects,
-preprocessor macros have been introduced into the definition of
-memory_object_t in 50cc5152.
-
-The procedure definitions contain inlined type definitions in order to
-change the type of the argument in question (i.e. to make it
-polymorphic).  The inline definitions however lack the destructor
-function, leading to reference leaks when a reference is acquired in
-the intran function.
-
-* include/mach/memory_object.defs: Add the destructor functions to the
-inlined type definitions.
----
- include/mach/memory_object.defs | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/include/mach/memory_object.defs b/include/mach/memory_object.defs
-index 0ed8dbc..1ae36aa 100644
---- a/include/mach/memory_object.defs
-+++ b/include/mach/memory_object.defs
-@@ -93,6 +93,9 @@ simpleroutine        memory_object_terminate(
- #ifdef        MEMORY_OBJECT_INTRAN
-                                               intran: MEMORY_OBJECT_INTRAN
- #endif
-+#ifdef        MEMORY_OBJECT_DESTRUCTOR
-+                                      destructor: MEMORY_OBJECT_DESTRUCTOR
-+#endif
-                                               ;
- #if   SEQNOS
-       msgseqno seqno                  : mach_port_seqno_t;
-@@ -233,6 +236,9 @@ simpleroutine      memory_object_lock_completed(
- #ifdef        MEMORY_OBJECT_INTRAN
-                       intran: MEMORY_OBJECT_INTRAN
- #endif
-+#ifdef        MEMORY_OBJECT_DESTRUCTOR
-+                      destructor: MEMORY_OBJECT_DESTRUCTOR
-+#endif
-                       ;
- #if   SEQNOS
-       msgseqno seqno                  : mach_port_seqno_t;
-@@ -268,6 +274,9 @@ simpleroutine      memory_object_supply_completed(
- #ifdef        MEMORY_OBJECT_INTRAN
-                       intran: MEMORY_OBJECT_INTRAN
- #endif
-+#ifdef        MEMORY_OBJECT_DESTRUCTOR
-+                      destructor: MEMORY_OBJECT_DESTRUCTOR
-+#endif
-                       ;
- #if   SEQNOS
-       msgseqno seqno                  : mach_port_seqno_t;
-@@ -318,6 +327,9 @@ simpleroutine      memory_object_change_completed(
- #ifdef        MEMORY_OBJECT_INTRAN
-                       intran: MEMORY_OBJECT_INTRAN
- #endif
-+#ifdef        MEMORY_OBJECT_DESTRUCTOR
-+                      destructor: MEMORY_OBJECT_DESTRUCTOR
-+#endif
-                       ;
- #if   SEQNOS
-       msgseqno seqno                  : mach_port_seqno_t;
--- 
-2.0.0.rc2
-
diff --git a/debian/patches/git-mig-inlines.patch 
b/debian/patches/git-mig-inlines.patch
deleted file mode 100644
index 983c0da..0000000
--- a/debian/patches/git-mig-inlines.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-commit 1b929c6f3ac51372914c4c0d49be8f27caee5ca5
-Author: Justus Winter <address@hidden>
-Date:   Thu Jan 16 14:47:38 2014 +0100
-
-    vm: remove the declaration of memory_object_create_proxy
-    
-    It is not clear to me why the declaration was put there in the first
-    place.  It is not used anywhere, and it conflicts with the declaration
-    generated by mig.
-    
-    * vm/memory_object_proxy.h (memory_object_create_proxy): Remove 
declaration.
-
-diff --git a/vm/memory_object_proxy.h b/vm/memory_object_proxy.h
-index 3de6996..dc0ea74 100644
---- a/vm/memory_object_proxy.h
-+++ b/vm/memory_object_proxy.h
-@@ -30,17 +30,6 @@
- 
- extern void memory_object_proxy_init (void);
- extern boolean_t memory_object_proxy_notify (mach_msg_header_t *msg);
--extern kern_return_t memory_object_create_proxy (ipc_space_t space,
--                                                 vm_prot_t max_protection,
--                                                 ipc_port_t *object,
--                                                 natural_t object_count,
--                                                 vm_offset_t *offset,
--                                                 natural_t offset_count,
--                                                 vm_offset_t *start,
--                                                 natural_t start_count,
--                                                 vm_offset_t *len,
--                                                 natural_t len_count,
--                                                 ipc_port_t *port);
- extern kern_return_t memory_object_proxy_lookup (ipc_port_t port,
-                                                  ipc_port_t *object,
-                                                  vm_prot_t *max_protection);
-commit 62ca925c9a6b0d12bdf17ac4ab93f5434575cedc
-Author: Justus Winter <address@hidden>
-Date:   Thu Jan 16 14:50:31 2014 +0100
-
-    kern: include the mig-generated server headers in ipc_kobject.c
-    
-    GNU MIG recently gained support for emitting x_server_routine
-    declarations in the generated server header file.  Using this
-    declaration, the x_server_routine functions can be inlined into the
-    ipc_kobject_server function.
-    
-    * kern/ipc_kobject.c: Include the mig-generated server headers.
-
-diff --git a/kern/ipc_kobject.c b/kern/ipc_kobject.c
-index 37d4eb9..13af820 100644
---- a/kern/ipc_kobject.c
-+++ b/kern/ipc_kobject.c
-@@ -49,6 +49,19 @@
- #include <vm/memory_object_proxy.h>
- #include <device/ds_routines.h>
- 
-+#include <kern/mach.server.h>
-+#include <ipc/mach_port.server.h>
-+#include <kern/mach_host.server.h>
-+#include <device/device.server.h>
-+#include <device/device_pager.server.h>
-+#include <kern/mach4.server.h>
-+#include <kern/gnumach.server.h>
-+#include <kern/experimental.server.h>
-+
-+#if MACH_DEBUG
-+#include <kern/mach_debug.server.h>
-+#endif
-+
- #if   MACH_MACHINE_ROUTINES
- #include <machine/machine_routines.h>
- #endif
-@@ -146,18 +158,6 @@ ipc_kobject_server(request)
-        * to perform the kernel function
-        */
-     {
--      extern mig_routine_t    mach_server_routine(),
--                              mach_port_server_routine(),
--                              mach_host_server_routine(),
--                              device_server_routine(),
--                              device_pager_server_routine(),
--                              mach4_server_routine(),
--                              gnumach_server_routine(),
--                              experimental_server_routine();
--#if   MACH_DEBUG
--      extern mig_routine_t    mach_debug_server_routine();
--#endif
--
- #if   MACH_MACHINE_ROUTINES
-       extern mig_routine_t    MACHINE_SERVER_ROUTINE();
- #endif
diff --git a/debian/patches/git-notify_translatable.patch 
b/debian/patches/git-notify_translatable.patch
deleted file mode 100644
index dd58913..0000000
--- a/debian/patches/git-notify_translatable.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-commit 119294278af2390971305224c9772d89525d97e1
-Author: Justus Winter <address@hidden>
-Date:   Sat Apr 5 15:08:06 2014 +0200
-
-    include: make the notify_port_t types translation functions mutable
-    
-    Make the intran, outtran and destructor functions mutable using
-    preprocessor macros.  Make it possible to inject imports using the
-    NOTIFY_IMPORTS macro.  This way, userspace servers can provide their
-    own translation functions.
-    
-    * include/mach/notify.defs: Honor NOTIFY_IMPORTS.
-    (notify_port_t): Make the translation mutable using preprocessor macros.
-
-diff --git a/include/mach/notify.defs b/include/mach/notify.defs
-index e06f6b4..fdf35e9 100644
---- a/include/mach/notify.defs
-+++ b/include/mach/notify.defs
-@@ -28,6 +28,10 @@ subsystem notify 64;
- 
- #include <mach/std_types.defs>
- 
-+#ifdef NOTIFY_IMPORTS
-+NOTIFY_IMPORTS
-+#endif
-+
- #if   SEQNOS
- serverprefix do_seqnos_;
- serverdemux seqnos_notify_server;
-@@ -37,7 +41,17 @@ serverdemux notify_server;
- #endif        SEQNOS
- 
- type notify_port_t = MACH_MSG_TYPE_MOVE_SEND_ONCE
--      ctype: mach_port_t;
-+      ctype: mach_port_t
-+#ifdef        NOTIFY_INTRAN
-+      intran: NOTIFY_INTRAN
-+#endif
-+#ifdef        NOTIFY_OUTTRAN
-+      outtran: NOTIFY_OUTTRAN
-+#endif
-+#ifdef        NOTIFY_DESTRUCTOR
-+      destructor: NOTIFY_DESTRUCTOR
-+#endif
-+;
- 
- /* MACH_NOTIFY_FIRST: 0100 */
- skip;
diff --git a/debian/patches/git-physical-access.patch 
b/debian/patches/git-physical-access.patch
deleted file mode 100644
index 73484a6..0000000
--- a/debian/patches/git-physical-access.patch
+++ /dev/null
@@ -1,267 +0,0 @@
-commit b9a59e483225093dec4e28ee5841b5b7f5e73562
-Author: Samuel Thibault <address@hidden>
-Date:   Mon Mar 3 00:50:33 2014 +0100
-
-    Keep two virtual pages as mapping windows to access physical memory
-    
-    PCI devices expose their memory etc. way beyond last_phys_addr. Userland
-    drivers opening /dev/mem need to open those too, even if phystokv() will
-    not work for them.
-    
-    * i386/intel/pmap.h (pmap_mapwindow_t): New type.
-    (pmap_get_mapwindow, pmap_put_mapwindow): New prototypes.
-    (PMAP_NMAPWINDOWS): New macro.
-    * i386/intel/pmap.c (mapwindows): New array.
-    (pmap_get_mapwindow, pmap_put_mapwindow): New functions.
-    (pmap_bootstrap, pmap_virtual_space): Reserve virtual pages for the mapping
-    windows.
-    * i386/i386/phys.c: Include <i386/model_dep.h>
-    (INTEL_PTE_W, INTEL_PTE_R): New macros
-    (pmap_zero_page, pmap_copy_page, copy_to_phys, copy_from_phys): Use
-    `pmap_get_mapwindow' to temporarily map physical pages beyond 
last_phys_addr.
-
-diff --git a/i386/i386/phys.c b/i386/i386/phys.c
-index ed4a309..d4bd6c3 100644
---- a/i386/i386/phys.c
-+++ b/i386/i386/phys.c
-@@ -37,8 +37,12 @@
- #include <vm/vm_page.h>
- 
- #include <i386/pmap.h>
-+#include <i386/model_dep.h>
- #include <mach/machine/vm_param.h>
- 
-+#define INTEL_PTE_W(p) (INTEL_PTE_VALID | INTEL_PTE_WRITE | INTEL_PTE_REF | 
INTEL_PTE_MOD | pa_to_pte(p))
-+#define INTEL_PTE_R(p) (INTEL_PTE_VALID | INTEL_PTE_REF | pa_to_pte(p))
-+
- /*
-  *    pmap_zero_page zeros the specified (machine independent) page.
-  */
-@@ -47,7 +51,21 @@ pmap_zero_page(p)
-       vm_offset_t p;
- {
-       assert(p != vm_page_fictitious_addr);
--      memset((void *)phystokv(p), 0, PAGE_SIZE);
-+      vm_offset_t v;
-+      pmap_mapwindow_t *map;
-+
-+      if (p >= phys_last_addr)
-+      {
-+              map = pmap_get_mapwindow(INTEL_PTE_W(p));
-+              v = map->vaddr;
-+      }
-+      else
-+              v = phystokv(p);
-+
-+      memset((void*) v, 0, PAGE_SIZE);
-+
-+      if (p >= phys_last_addr)
-+              pmap_put_mapwindow(map);
- }
- 
- /*
-@@ -57,10 +75,33 @@ void
- pmap_copy_page(src, dst)
-       vm_offset_t src, dst;
- {
-+      vm_offset_t src_addr_v, dst_addr_v;
-+      pmap_mapwindow_t *src_map, *dst_map;
-       assert(src != vm_page_fictitious_addr);
-       assert(dst != vm_page_fictitious_addr);
- 
--      memcpy((void *)phystokv(dst), (void *)phystokv(src), PAGE_SIZE);
-+      if (src >= phys_last_addr)
-+      {
-+              src_map = pmap_get_mapwindow(INTEL_PTE_R(src));
-+              src_addr_v = src_map->vaddr;
-+      }
-+      else
-+              src_addr_v = phystokv(src);
-+
-+      if (dst >= phys_last_addr)
-+      {
-+              dst_map = pmap_get_mapwindow(INTEL_PTE_W(dst));
-+              dst_addr_v = dst_map->vaddr;
-+      }
-+      else
-+              dst_addr_v = phystokv(dst);
-+
-+      memcpy((void *) dst_addr_v, (void *) src_addr_v, PAGE_SIZE);
-+
-+      if (src >= phys_last_addr)
-+              pmap_put_mapwindow(src_map);
-+      if (dst >= phys_last_addr)
-+              pmap_put_mapwindow(dst_map);
- }
- 
- /*
-@@ -73,8 +114,23 @@ copy_to_phys(src_addr_v, dst_addr_p, count)
-       vm_offset_t src_addr_v, dst_addr_p;
-       int count;
- {
-+      vm_offset_t dst_addr_v;
-+      pmap_mapwindow_t *dst_map;
-       assert(dst_addr_p != vm_page_fictitious_addr);
--      memcpy((void *)phystokv(dst_addr_p), (void *)src_addr_v, count);
-+      assert(pa_to_pte(dst_addr_p + count-1) == pa_to_pte(dst_addr_p));
-+
-+      if (dst_addr_p >= phys_last_addr)
-+      {
-+              dst_map = pmap_get_mapwindow(INTEL_PTE_W(dst_addr_p));
-+              dst_addr_v = dst_map->vaddr;
-+      }
-+      else
-+              dst_addr_v = phystokv(dst_addr_p);
-+
-+      memcpy((void *)dst_addr_v, (void *)src_addr_v, count);
-+
-+      if (dst_addr_p >= phys_last_addr)
-+              pmap_put_mapwindow(dst_map);
- }
- 
- /*
-@@ -88,8 +144,23 @@ copy_from_phys(src_addr_p, dst_addr_v, count)
-       vm_offset_t src_addr_p, dst_addr_v;
-       int count;
- {
-+      vm_offset_t src_addr_v;
-+      pmap_mapwindow_t *src_map;
-       assert(src_addr_p != vm_page_fictitious_addr);
--      memcpy((void *)dst_addr_v, (void *)phystokv(src_addr_p), count);
-+      assert(pa_to_pte(src_addr_p + count-1) == pa_to_pte(src_addr_p));
-+
-+      if (src_addr_p >= phys_last_addr)
-+      {
-+              src_map = pmap_get_mapwindow(INTEL_PTE_R(src_addr_p));
-+              src_addr_v = src_map->vaddr;
-+      }
-+      else
-+              src_addr_v = phystokv(src_addr_p);
-+
-+      memcpy((void *)dst_addr_v, (void *)src_addr_v, count);
-+
-+      if (src_addr_p >= phys_last_addr)
-+              pmap_put_mapwindow(src_map);
- }
- 
- /*
-diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
-index 2943d26..a3d9630 100644
---- a/i386/intel/pmap.c
-+++ b/i386/intel/pmap.c
-@@ -419,6 +419,12 @@ unsigned int      inuse_ptepages_count = 0;       /* 
debugging */
-  */
- pt_entry_t *kernel_page_dir;
- 
-+/*
-+ * Two slots for temporary physical page mapping, to allow for
-+ * physical-to-physical transfers.
-+ */
-+static pmap_mapwindow_t mapwindows[PMAP_NMAPWINDOWS];
-+
- void pmap_remove_range();     /* forward */
- #if   NCPUS > 1
- void signal_cpus();           /* forward */
-@@ -774,6 +780,12 @@ void pmap_bootstrap(void)
-                       }
-                       for (; pte < ptable+NPTES; pte++)
-                       {
-+                              if (va >= kernel_virtual_end - PMAP_NMAPWINDOWS 
* PAGE_SIZE);
-+                              {
-+                                      pmap_mapwindow_t *win = 
&mapwindows[atop(va - (kernel_virtual_end - PMAP_NMAPWINDOWS * PAGE_SIZE))];
-+                                      win->entry = pte;
-+                                      win->vaddr = va;
-+                              }
-                               WRITE_PTE(pte, 0);
-                               va += INTEL_PGBYTES;
-                       }
-@@ -884,12 +896,41 @@ void pmap_clear_bootstrap_pagetable(pt_entry_t *base) {
- }
- #endif        /* MACH_PV_PAGETABLES */
- 
-+/*
-+ * Create a temporary mapping for a given physical entry
-+ *
-+ * This can be used to access physical pages which are not mapped 1:1 by
-+ * phystokv().
-+ */
-+pmap_mapwindow_t *pmap_get_mapwindow(pt_entry_t entry)
-+{
-+      pmap_mapwindow_t *map;
-+
-+      /* Find an empty one.  */
-+      for (map = &mapwindows[0]; map < &mapwindows[sizeof (mapwindows) / 
sizeof (*mapwindows)]; map++)
-+              if (!(*map->entry))
-+                      break;
-+      assert(map < &mapwindows[sizeof (mapwindows) / sizeof (*mapwindows)]);
-+
-+      WRITE_PTE(map->entry, entry);
-+      return map;
-+}
-+
-+/*
-+ * Destroy a temporary mapping for a physical entry
-+ */
-+void pmap_put_mapwindow(pmap_mapwindow_t *map)
-+{
-+      WRITE_PTE(map->entry, 0);
-+      PMAP_UPDATE_TLBS(kernel_pmap, map->vaddr, map->vaddr + PAGE_SIZE);
-+}
-+
- void pmap_virtual_space(startp, endp)
-       vm_offset_t *startp;
-       vm_offset_t *endp;
- {
-       *startp = kernel_virtual_start;
--      *endp = kernel_virtual_end;
-+      *endp = kernel_virtual_end - PMAP_NMAPWINDOWS * PAGE_SIZE;
- }
- 
- /*
-diff --git a/i386/intel/pmap.h b/i386/intel/pmap.h
-index 047a384..382cd5f 100644
---- a/i386/intel/pmap.h
-+++ b/i386/intel/pmap.h
-@@ -192,6 +192,16 @@ extern void pmap_clear_bootstrap_pagetable(pt_entry_t 
*addr);
- #define       set_pmap(pmap)  set_cr3(kvtophys((vm_offset_t)(pmap)->dirbase))
- #endif        /* PAE */
- 
-+typedef struct {
-+      pt_entry_t      *entry;
-+      vm_offset_t     vaddr;
-+} pmap_mapwindow_t;
-+
-+extern pmap_mapwindow_t *pmap_get_mapwindow(pt_entry_t entry);
-+extern void pmap_put_mapwindow(pmap_mapwindow_t *map);
-+
-+#define PMAP_NMAPWINDOWS 2
-+
- #if   NCPUS > 1
- /*
-  *    List of cpus that are actively using mapped memory.  Any
-
-commit 7e59fbeb2f05e1400dadbbd2d9c93d8bd2ad8178
-Author: Samuel Thibault <address@hidden>
-Date:   Sat Mar 22 16:33:25 2014 +0100
-
-    Fix overflow
-    
-    We were filling much more than the mapwindows array, thus overwriting in
-    at least debugger variables.
-    
-    * i386/intel/pmap.c (pmap_bootstrap): Make sure to limit mapwindows
-    initialization within PMAP_NMAPWINDOWS.
-
-diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
-index a3d9630..4b2892a 100644
---- a/i386/intel/pmap.c
-+++ b/i386/intel/pmap.c
-@@ -780,7 +780,7 @@ void pmap_bootstrap(void)
-                       }
-                       for (; pte < ptable+NPTES; pte++)
-                       {
--                              if (va >= kernel_virtual_end - PMAP_NMAPWINDOWS 
* PAGE_SIZE);
-+                              if (va >= kernel_virtual_end - PMAP_NMAPWINDOWS 
* PAGE_SIZE && va < kernel_virtual_end)
-                               {
-                                       pmap_mapwindow_t *win = 
&mapwindows[atop(va - (kernel_virtual_end - PMAP_NMAPWINDOWS * PAGE_SIZE))];
-                                       win->entry = pte;
diff --git a/debian/patches/git-quiet-cd-floppy.patch 
b/debian/patches/git-quiet-cd-floppy.patch
deleted file mode 100644
index ff43fc5..0000000
--- a/debian/patches/git-quiet-cd-floppy.patch
+++ /dev/null
@@ -1,370 +0,0 @@
-commit abb50be5ea5c374cdb25f05eafdf8afac9b854b1
-Author: Samuel Thibault <address@hidden>
-Date:   Mon Feb 10 00:04:34 2014 +0100
-
-    Add quiet flag to block I/O
-    
-    This avoids grub & such making Mach print flurries of floppy errors.
-    
-    * linux/dev/include/linux/blkdev.h (request): Add `quiet' field.
-    * linux/dev/include/linux/blk.h (end_request): Print I/O error only if
-    the `quiet' field of the request is 0.
-    * linux/dev/include/linux/fs.h (ll_rw_block): Add `quiet' parameter.
-    * linux/dev/glue/block.c (ll_rw_block): Add `quiet' parameter, copied into
-    the request.
-    (bread, rdwr_partial, rdwr_full): Pass 0 to `ll_rw_block''s `quiet' 
parameter.
-    * linux/dev/drivers/block/floppy.c (floppy_revalidate): Pass 1 to
-    `ll_rw_block''s `quiet' parameter.
-
-diff --git a/linux/dev/drivers/block/floppy.c 
b/linux/dev/drivers/block/floppy.c
-index 4c0977a..83d66f0 100644
---- a/linux/dev/drivers/block/floppy.c
-+++ b/linux/dev/drivers/block/floppy.c
-@@ -3723,7 +3723,7 @@ static int floppy_revalidate(kdev_t dev)
-                               return 1;
-                       }
-                       if (bh && !buffer_uptodate(bh))
--                              ll_rw_block(READ, 1, &bh);
-+                              ll_rw_block(READ, 1, &bh, 1);
-                       process_fd_request();
-                       wait_on_buffer(bh);
-                       brelse(bh);
-diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c
-index 011b6f5..ce4c633 100644
---- a/linux/dev/glue/block.c
-+++ b/linux/dev/glue/block.c
-@@ -384,7 +384,7 @@ bread (kdev_t dev, int block, int size)
-   bh = getblk (dev, block, size);
-   if (bh)
-     {
--      ll_rw_block (READ, 1, &bh);
-+      ll_rw_block (READ, 1, &bh, 0);
-       wait_on_buffer (bh);
-       if (! buffer_uptodate (bh))
-       {
-@@ -444,7 +444,7 @@ enqueue_request (struct request *req)
- /* Perform the I/O operation RW on the buffer list BH
-    containing NR buffers.  */
- void
--ll_rw_block (int rw, int nr, struct buffer_head **bh)
-+ll_rw_block (int rw, int nr, struct buffer_head **bh, int quiet)
- {
-   int i, bshift, bsize;
-   unsigned major;
-@@ -476,6 +476,7 @@ ll_rw_block (int rw, int nr, struct buffer_head **bh)
-   r->rq_dev = bh[0]->b_dev;
-   r->cmd = rw;
-   r->errors = 0;
-+  r->quiet = quiet;
-   r->sector = bh[0]->b_blocknr << (bshift - 9);
-   r->current_nr_sectors = bh[0]->b_size >> 9;
-   r->buffer = bh[0]->b_data;
-@@ -528,7 +529,7 @@ rdwr_partial (int rw, kdev_t dev, loff_t *off,
-   bh->b_data = alloc_buffer (bh->b_size);
-   if (! bh->b_data)
-     return -ENOMEM;
--  ll_rw_block (READ, 1, &bh);
-+  ll_rw_block (READ, 1, &bh, 0);
-   wait_on_buffer (bh);
-   if (buffer_uptodate (bh))
-     {
-@@ -542,7 +543,7 @@ rdwr_partial (int rw, kdev_t dev, loff_t *off,
-       {
-         memcpy (bh->b_data + o, *buf, c);
-         bh->b_state = (1 << BH_Dirty) | (1 << BH_Lock);
--        ll_rw_block (WRITE, 1, &bh);
-+        ll_rw_block (WRITE, 1, &bh, 0);
-         wait_on_buffer (bh);
-         if (! buffer_uptodate (bh))
-           {
-@@ -623,7 +624,7 @@ rdwr_full (int rw, kdev_t dev, loff_t *off, char **buf, 
int *resid, int bshift)
-     }
-   if (! err)
-     {
--      ll_rw_block (rw, i, bhp);
-+      ll_rw_block (rw, i, bhp, 0);
-       wait_on_buffer (bhp[i - 1]);
-     }
-   for (bh = bhead, cc = 0, j = 0; j < i; cc += bh->b_size, bh++, j++)
-diff --git a/linux/dev/include/linux/blk.h b/linux/dev/include/linux/blk.h
-index 412b864..156d91c 100644
---- a/linux/dev/include/linux/blk.h
-+++ b/linux/dev/include/linux/blk.h
-@@ -391,8 +391,9 @@ static void end_request(int uptodate) {
- 
-       req->errors = 0;
-       if (!uptodate) {
--              printk("end_request: I/O error, dev %s, sector %lu\n",
--                      kdevname(req->rq_dev), req->sector);
-+              if (!req->quiet)
-+                      printk("end_request: I/O error, dev %s, sector %lu\n",
-+                              kdevname(req->rq_dev), req->sector);
- #ifdef MACH
-               for (bh = req->bh; bh; )
-                 {
-diff --git a/linux/dev/include/linux/blkdev.h 
b/linux/dev/include/linux/blkdev.h
-index e9a40d7..5bf0a28 100644
---- a/linux/dev/include/linux/blkdev.h
-+++ b/linux/dev/include/linux/blkdev.h
-@@ -23,6 +23,7 @@ struct request {
-       kdev_t rq_dev;
-       int cmd;                /* READ or WRITE */
-       int errors;
-+      int quiet;
-       unsigned long sector;
-       unsigned long nr_sectors;
-       unsigned long current_nr_sectors;
-diff --git a/linux/dev/include/linux/fs.h b/linux/dev/include/linux/fs.h
-index 740ebb5..37f7173 100644
---- a/linux/dev/include/linux/fs.h
-+++ b/linux/dev/include/linux/fs.h
-@@ -733,7 +733,7 @@ extern struct file * get_empty_filp(void);
- extern int close_fp(struct file *filp);
- extern struct buffer_head * get_hash_table(kdev_t dev, int block, int size);
- extern struct buffer_head * getblk(kdev_t dev, int block, int size);
--extern void ll_rw_block(int rw, int nr, struct buffer_head * bh[]);
-+extern void ll_rw_block(int rw, int nr, struct buffer_head * bh[], int quiet);
- extern void ll_rw_page(int rw, kdev_t dev, unsigned long nr, char * buffer);
- extern void ll_rw_swap_file(int rw, kdev_t dev, unsigned int *b, int nb, char 
*buffer);
- extern int is_read_only(kdev_t dev);
-commit 55cdcf3ad3ebec3d9899130fe435a59f8e9e1617
-Author: Samuel Thibault <address@hidden>
-Date:   Mon Feb 10 00:19:30 2014 +0100
-
-    Add quiet flag to CD I/O
-    
-    * linux/src/drivers/block/ide-cd.c (cdrom_queue_packet_command): Add 
`quiet'
-    parameter, copied into the request.
-    (cdrom_decode_status): Do not print I/O error when `quiet' field of
-    request is non-zero.
-    (cdrom_end_request): Do not print sense results when `quiet' field of
-    request is non-zero.
-    (cdrom_check_status, cdrom_read_capacity, cdrom_read_tocentry): Pass 1 to
-    `cdrom_queue_packet_command''s `quiet' parameter.
-    (cdrom_lockdoor, cdrom_eject, cdrom_pause, cdrom_startstop,
-    cdrom_read_subchannel, cdrom_mode_sense, cdrom_mode_select,
-    cdrom_play_lba_range_1, cdrom_read_block, cdrom_load_unload,
-    ide_cdrom_ioctl): Pass 0 to `cdrom_queue_packet_command''s `quiet' 
parameter.
-
-diff --git a/linux/src/drivers/block/ide-cd.c 
b/linux/src/drivers/block/ide-cd.c
-index e4548f5..ccf7954 100644
---- a/linux/src/drivers/block/ide-cd.c
-+++ b/linux/src/drivers/block/ide-cd.c
-@@ -649,7 +649,7 @@ static void cdrom_end_request (int uptodate, ide_drive_t 
*drive)
- {
-       struct request *rq = HWGROUP(drive)->rq;
- 
--      if (rq->cmd == REQUEST_SENSE_COMMAND && uptodate) {
-+      if (rq->cmd == REQUEST_SENSE_COMMAND && uptodate && !rq->quiet) {
-               struct packet_command *pc = (struct packet_command *)
-                                             rq->buffer;
-               cdrom_analyze_sense_data (drive,
-@@ -727,16 +727,18 @@ static int cdrom_decode_status (ide_drive_t *drive, int 
good_stat,
-                                  because workman constantly polls the drive
-                                  with this command, and we don't want
-                                  to uselessly fill up the syslog. */
--                              if (pc->c[0] != SCMD_READ_SUBCHANNEL)
-+                              if (pc->c[0] != SCMD_READ_SUBCHANNEL && 
!rq->quiet)
-                                       printk ("%s : tray open or drive not 
ready\n",
-                                               drive->name);
-                       } else if (sense_key == UNIT_ATTENTION) {
-                               /* Check for media change. */
-                               cdrom_saw_media_change (drive);
--                              printk ("%s: media changed\n", drive->name);
-+                              if (!rq->quiet)
-+                                      printk ("%s: media changed\n", 
drive->name);
-                       } else {
-                               /* Otherwise, print an error. */
--                              ide_dump_status (drive, "packet command error",
-+                              if (!rq->quiet)
-+                                      ide_dump_status (drive, "packet command 
error",
-                                                stat);
-                       }
-                       
-@@ -768,7 +770,8 @@ static int cdrom_decode_status (ide_drive_t *drive, int 
good_stat,
-                               cdrom_saw_media_change (drive);
- 
-                               /* Fail the request. */
--                              printk ("%s : tray open\n", drive->name);
-+                              if (!rq->quiet)
-+                                      printk ("%s : tray open\n", 
drive->name);
-                               cdrom_end_request (0, drive);
-                       } else if (sense_key == UNIT_ATTENTION) {
-                               /* Media change. */
-@@ -783,7 +786,8 @@ static int cdrom_decode_status (ide_drive_t *drive, int 
good_stat,
-                                  sense_key == DATA_PROTECT) {
-                               /* No point in retrying after an illegal
-                                  request or data protect error.*/
--                              ide_dump_status (drive, "command error", stat);
-+                              if (!rq->quiet)
-+                                      ide_dump_status (drive, "command 
error", stat);
-                               cdrom_end_request (0, drive);
-                       } else if ((err & ~ABRT_ERR) != 0) {
-                               /* Go to the default handler
-@@ -1406,7 +1410,7 @@ void cdrom_sleep (int time)
- #endif
- 
- static
--int cdrom_queue_packet_command (ide_drive_t *drive, struct packet_command *pc)
-+int cdrom_queue_packet_command (ide_drive_t *drive, struct packet_command 
*pc, int quiet)
- {
-       struct atapi_request_sense my_reqbuf;
-       int retries = 10;
-@@ -1423,6 +1427,7 @@ int cdrom_queue_packet_command (ide_drive_t *drive, 
struct packet_command *pc)
-               ide_init_drive_cmd (&req);
-               req.cmd = PACKET_COMMAND;
-               req.buffer = (char *)pc;
-+              req.quiet = quiet;
-               (void) ide_do_drive_cmd (drive, &req, ide_wait);
- 
-               if (pc->stat != 0) {
-@@ -1563,7 +1568,7 @@ cdrom_check_status (ide_drive_t  *drive,
- 
-         pc.c[7] = CDROM_STATE_FLAGS (drive)->sanyo_slot % 3;
- 
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 1);
- }
- 
- 
-@@ -1588,7 +1593,7 @@ cdrom_lockdoor (ide_drive_t *drive, int lockflag,
- 
-               pc.c[0] = ALLOW_MEDIUM_REMOVAL;
-               pc.c[4] = (lockflag != 0);
--              stat = cdrom_queue_packet_command (drive, &pc);
-+              stat = cdrom_queue_packet_command (drive, &pc, 0);
-       }
- 
-       if (stat == 0)
-@@ -1622,7 +1627,7 @@ cdrom_eject (ide_drive_t *drive, int ejectflag,
- 
-       pc.c[0] = START_STOP;
-       pc.c[4] = 2 + (ejectflag != 0);
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 0);
- }
- 
- 
-@@ -1637,7 +1642,7 @@ cdrom_pause (ide_drive_t *drive, int pauseflag,
- 
-       pc.c[0] = SCMD_PAUSE_RESUME;
-       pc.c[8] = !pauseflag;
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 0);
- }
- 
- 
-@@ -1653,7 +1658,7 @@ cdrom_startstop (ide_drive_t *drive, int startflag,
-       pc.c[0] = START_STOP;
-       pc.c[1] = 1;
-       pc.c[4] = startflag;
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 0);
- }
- 
- 
-@@ -1676,7 +1681,7 @@ cdrom_read_capacity (ide_drive_t *drive, unsigned 
*capacity,
-       pc.buffer = (unsigned char *)&capbuf;
-       pc.buflen = sizeof (capbuf);
- 
--      stat = cdrom_queue_packet_command (drive, &pc);
-+      stat = cdrom_queue_packet_command (drive, &pc, 1);
-       if (stat == 0)
-               *capacity = ntohl (capbuf.lba);
- 
-@@ -1702,7 +1707,7 @@ cdrom_read_tocentry (ide_drive_t *drive, int trackno, 
int msf_flag,
-       pc.c[8] = (buflen & 0xff);
-       pc.c[9] = (format << 6);
-       if (msf_flag) pc.c[1] = 2;
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 1);
- }
- 
- 
-@@ -1834,7 +1839,7 @@ cdrom_read_subchannel (ide_drive_t *drive, int format,
-       pc.c[3] = format,
-       pc.c[7] = (buflen >> 8);
-       pc.c[8] = (buflen & 0xff);
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 0);
- }
- 
- 
-@@ -1855,7 +1860,7 @@ cdrom_mode_sense (ide_drive_t *drive, int pageno, int 
modeflag,
-       pc.c[2] = pageno | (modeflag << 6);
-       pc.c[7] = (buflen >> 8);
-       pc.c[8] = (buflen & 0xff);
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 0);
- }
- 
- 
-@@ -1875,7 +1880,7 @@ cdrom_mode_select (ide_drive_t *drive, int pageno, char 
*buf, int buflen,
-       pc.c[2] = pageno;
-       pc.c[7] = (buflen >> 8);
-       pc.c[8] = (buflen & 0xff);
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 0);
- }
- 
- 
-@@ -1903,7 +1908,7 @@ cdrom_play_lba_range_1 (ide_drive_t *drive, int 
lba_start, int lba_end,
-       }
- #endif /* not STANDARD_ATAPI */
- 
--      return cdrom_queue_packet_command (drive, &pc);
-+      return cdrom_queue_packet_command (drive, &pc, 0);
- }
- 
- 
-@@ -2004,7 +2009,7 @@ cdrom_read_block (ide_drive_t *drive, int format, int 
lba, int nblocks,
-       else
-               pc.c[9] = 0x10;
- 
--      stat = cdrom_queue_packet_command (drive, &pc);
-+      stat = cdrom_queue_packet_command (drive, &pc, 0);
- 
- #if ! STANDARD_ATAPI
-       /* If the drive doesn't recognize the READ CD opcode, retry the command
-@@ -2059,7 +2064,7 @@ cdrom_load_unload (ide_drive_t *drive, int slot,
-               pc.c[0] = LOAD_UNLOAD;
-               pc.c[4] = 2 + (slot >= 0);
-               pc.c[8] = slot;
--              return cdrom_queue_packet_command (drive, &pc);
-+              return cdrom_queue_packet_command (drive, &pc, 0);
- 
-       }
- }
-@@ -2575,7 +2580,7 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode 
*inode,
-                               pc.buffer = buf;
-                       }
- 
--                      stat = cdrom_queue_packet_command (drive, &pc);
-+                      stat = cdrom_queue_packet_command (drive, &pc, 0);
- 
-                       if (len > 0)
-                               memcpy_tofs ((void *)arg, buf, len);
-commit be41c805265881172e8004c81dd646ad579c8009
-Author: Samuel Thibault <address@hidden>
-Date:   Mon Feb 10 00:41:49 2014 +0100
-
-    Make open return ENXIO on missing CD-ROM
-    
-    * linux/src/drivers/block/ide-cd.c (ide_cdrom_open): Return -ENXIO when
-    CD sense failed.
-
-diff --git a/linux/src/drivers/block/ide-cd.c 
b/linux/src/drivers/block/ide-cd.c
-index ccf7954..020a831 100644
---- a/linux/src/drivers/block/ide-cd.c
-+++ b/linux/src/drivers/block/ide-cd.c
-@@ -2643,6 +2643,10 @@ int ide_cdrom_open (struct inode *ip, struct file *fp, 
ide_drive_t *drive)
-               if (stat == 0 || my_reqbuf.sense_key == UNIT_ATTENTION) {
-                       (void) cdrom_lockdoor (drive, 1, &my_reqbuf);
-                       (void) cdrom_read_toc (drive, &my_reqbuf);
-+              } else {
-+                      /* Otherwise return as missing */
-+                      --drive->usage;
-+                      return -ENXIO;
-               }
-       }
- 
diff --git a/debian/patches/git-task_set_name.patch 
b/debian/patches/git-task_set_name.patch
deleted file mode 100644
index c99ea95..0000000
--- a/debian/patches/git-task_set_name.patch
+++ /dev/null
@@ -1,280 +0,0 @@
-commit fe7cd805567e1f4d1ed92d87b216e2dc78249892
-Author: Justus Winter <address@hidden>
-Date:   Sat Feb 1 02:02:02 2014 +0100
-
-    kern: add snprintf
-    
-    * kern/printf.c (snprintf): New function.
-    * kern/printf.h (snprintf): New declaration.
-
-diff --git a/kern/printf.c b/kern/printf.c
-index af59d5a..ea78d48 100644
---- a/kern/printf.c
-+++ b/kern/printf.c
-@@ -615,6 +615,16 @@ vsnprintf(char *buf, size_t size, const char *fmt, 
va_list args)
-   return cookie.index;
- }
- 
-+int
-+snprintf(char *buf, size_t size, const char *fmt, ...)
-+{
-+      int written;
-+      va_list listp;
-+      va_start(listp, fmt);
-+      written = vsnprintf(buf, size, fmt, listp);
-+      va_end(listp);
-+      return written;
-+}
- 
- void safe_gets(str, maxlen)
-       char *str;
-diff --git a/kern/printf.h b/kern/printf.h
-index 8b4e760..0f8b328 100644
---- a/kern/printf.h
-+++ b/kern/printf.h
-@@ -40,6 +40,7 @@ extern void printnum (unsigned long u, int base,
-                       vm_offset_t putc_arg);
- 
- extern int sprintf (char *buf, const char *fmt, ...);
-+extern int snprintf (char *buf, size_t size, const char *fmt, ...);
- extern int vsnprintf (char *buf, size_t size, const char *fmt, va_list args);
- 
- extern int printf (const char *fmt, ...);
-
-commit 7353f589daccb7fb61880d6994f6471e103da902
-Author: Justus Winter <address@hidden>
-Date:   Sat Feb 1 02:09:02 2014 +0100
-
-    include: add a fixed-size string type for debugging purposes
-    
-    * include/mach/debug.defs: New file.
-    * include/mach/debug.h: Likewise.
-
-diff --git a/include/mach_debug/mach_debug_types.defs 
b/include/mach_debug/mach_debug_types.defs
-index f60125a..d24b6f9 100644
---- a/include/mach_debug/mach_debug_types.defs
-+++ b/include/mach_debug/mach_debug_types.defs
-@@ -57,6 +57,8 @@ type vm_page_info_array_t = array[] of vm_page_info_t;
- 
- type symtab_name_t = (MACH_MSG_TYPE_STRING_C, 8*32);
- 
-+type kernel_debug_name_t = c_string[*: 64];
-+
- import <mach_debug/mach_debug_types.h>;
- 
- #endif        /* _MACH_DEBUG_MACH_DEBUG_TYPES_DEFS_ */
-diff --git a/include/mach_debug/mach_debug_types.h 
b/include/mach_debug/mach_debug_types.h
-index 5d4efcd..9c7d1fd 100644
---- a/include/mach_debug/mach_debug_types.h
-+++ b/include/mach_debug/mach_debug_types.h
-@@ -37,4 +37,15 @@
- 
- typedef       char    symtab_name_t[32];
- 
-+/*
-+ *    A fixed-length string data type intended for names given to
-+ *    kernel objects.
-+ *
-+ *    Note that it is not guaranteed that the in-kernel data
-+ *    structure will hold KERNEL_DEBUG_NAME_MAX bytes.  The given
-+ *    name will be truncated to fit into the target data structure.
-+ */
-+#define KERNEL_DEBUG_NAME_MAX (64)
-+typedef char  kernel_debug_name_t[KERNEL_DEBUG_NAME_MAX];
-+
- #endif        /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */
-
-commit df47f83ed98e4ce356af8d34de05b549f4f9c912
-Author: Justus Winter <address@hidden>
-Date:   Sat Feb 1 02:15:05 2014 +0100
-
-    kern: add a name field to struct task
-    
-    * kern/task.c (task_create): Initialize name with the address of the task.
-    * kern/task.h (TASK_NAME_SIZE): New definition.
-    (struct task): Add field name.
-
-diff --git a/kern/task.c b/kern/task.c
-index 13b3c76..0b5a6f7 100644
---- a/kern/task.c
-+++ b/kern/task.c
-@@ -45,6 +45,7 @@
- #include <kern/slab.h>
- #include <kern/kalloc.h>
- #include <kern/processor.h>
-+#include <kern/printf.h>
- #include <kern/sched_prim.h>  /* for thread_wakeup */
- #include <kern/ipc_tt.h>
- #include <vm/vm_kern.h>               /* for kernel_map, ipc_kernel_map */
-@@ -164,6 +165,8 @@ kern_return_t task_create(
-       }
- #endif        /* FAST_TAS */
- 
-+      snprintf (new_task->name, sizeof new_task->name, "%p", new_task);
-+
-       ipc_task_enable(new_task);
- 
-       *child_task = new_task;
-diff --git a/kern/task.h b/kern/task.h
-index e852033..7ae10cd 100644
---- a/kern/task.h
-+++ b/kern/task.h
-@@ -48,6 +48,13 @@
- #include <vm/vm_types.h>
- #include <machine/task.h>
- 
-+/*
-+ * Task name buffer size.  The size is chosen so that struct task fits
-+ * into three cache lines.  The size of a cache line on a typical CPU
-+ * is 64 bytes.
-+ */
-+#define TASK_NAME_SIZE 32
-+
- struct task {
-       /* Synchronization/destruction information */
-       decl_simple_lock_data(,lock)    /* Task's lock */
-@@ -113,6 +120,8 @@ struct task {
-       natural_t       cow_faults;     /* copy-on-write faults counter */
-       natural_t       messages_sent;  /* messages sent counter */
-       natural_t       messages_received; /* messages received counter */
-+
-+      char    name[TASK_NAME_SIZE];
- };
- 
- #define task_lock(task)               simple_lock(&(task)->lock)
-commit 42b8f0e06f9b3a4a089ddbebd851988e095b0c72
-Author: Justus Winter <address@hidden>
-Date:   Sat Feb 1 02:19:43 2014 +0100
-
-    ipc: use the name of the task for error messages
-    
-    * ipc/mach_port.c (mach_port_destroy): Use the name of the task for
-    error messages.
-    (mach_port_deallocate): Likewise.
-
-diff --git a/ipc/mach_port.c b/ipc/mach_port.c
-index fbc5e69..13572a1 100644
---- a/ipc/mach_port.c
-+++ b/ipc/mach_port.c
-@@ -571,7 +571,7 @@ mach_port_destroy(
-       kr = ipc_right_lookup_write(space, name, &entry);
-       if (kr != KERN_SUCCESS) {
-               if (name != MACH_PORT_NULL && name != MACH_PORT_DEAD && space 
== current_space()) {
--                      printf("task %p destroying an invalid port %lu, most 
probably a bug.\n", current_task(), name);
-+                      printf("task %.*s destroying an invalid port %lu, most 
probably a bug.\n", sizeof current_task()->name, current_task()->name, name);
-                       if (mach_port_deallocate_debug)
-                               SoftDebugger("mach_port_deallocate");
-               }
-@@ -615,7 +615,7 @@ mach_port_deallocate(
-       kr = ipc_right_lookup_write(space, name, &entry);
-       if (kr != KERN_SUCCESS) {
-               if (name != MACH_PORT_NULL && name != MACH_PORT_DEAD && space 
== current_space()) {
--                      printf("task %p deallocating an invalid port %lu, most 
probably a bug.\n", current_task(), name);
-+                      printf("task %.*s deallocating an invalid port %lu, 
most probably a bug.\n", sizeof current_task()->name, current_task()->name, 
name);
-                       if (mach_port_deallocate_debug)
-                               SoftDebugger("mach_port_deallocate");
-               }
-commit de74f85990dc39bc6723f046f83d4e53c45f4343
-Author: Justus Winter <address@hidden>
-Date:   Sat Feb 1 02:23:07 2014 +0100
-
-    kern: implement task_set_name
-    
-    task_set_name sets the name of a task.  This is a debugging aid.  The
-    name will be used in error messages printed by the kernel.
-    
-    * kern/task.c (task_set_name): New function.
-    * kern/task.h (task_set_name): New declaration.
-
-diff --git a/kern/task.c b/kern/task.c
-index 0b5a6f7..66eb25c 100644
---- a/kern/task.c
-+++ b/kern/task.c
-@@ -37,6 +37,7 @@
- #include <mach/vm_param.h>
- #include <mach/task_info.h>
- #include <mach/task_special_ports.h>
-+#include <mach_debug/mach_debug_types.h>
- #include <ipc/ipc_space.h>
- #include <ipc/ipc_types.h>
- #include <kern/debug.h>
-@@ -1071,6 +1072,22 @@ task_priority(
- }
- 
- /*
-+ *    task_set_name
-+ *
-+ *    Set the name of task TASK to NAME.  This is a debugging aid.
-+ *    NAME will be used in error messages printed by the kernel.
-+ */
-+kern_return_t
-+task_set_name(
-+      task_t                  task,
-+      kernel_debug_name_t     name)
-+{
-+      strncpy(task->name, name, sizeof task->name - 1);
-+      task->name[sizeof task->name - 1] = '\0';
-+      return KERN_SUCCESS;
-+}
-+
-+/*
-  *    task_collect_scan:
-  *
-  *    Attempt to free resources owned by tasks.
-diff --git a/kern/task.h b/kern/task.h
-index 7ae10cd..3c10dc0 100644
---- a/kern/task.h
-+++ b/kern/task.h
-@@ -39,6 +39,7 @@
- #include <mach/time_value.h>
- #include <mach/mach_param.h>
- #include <mach/task_info.h>
-+#include <mach_debug/mach_debug_types.h>
- #include <kern/kern_types.h>
- #include <kern/lock.h>
- #include <kern/queue.h>
-@@ -169,6 +170,9 @@ extern kern_return_t       task_assign(
- extern kern_return_t  task_assign_default(
-       task_t          task,
-       boolean_t       assign_threads);
-+extern kern_return_t  task_set_name(
-+      task_t                  task,
-+      kernel_debug_name_t     name);
- extern void consider_task_collect(void);
- 
- /*
-commit 877a319c94619e51a0103b9f201523b269588eb0
-Author: Justus Winter <address@hidden>
-Date:   Sat Feb 1 02:25:45 2014 +0100
-
-    include: add task_set_name
-    
-    task_set_name sets the name of a task.  This is a debugging aid.  The
-    name will be used in error messages printed by the kernel.
-    
-    * include/mach/gnumach.defs (task_set_name): New procedure.
-
-diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs
-index 12c4e99..6cfbb0d 100644
---- a/include/mach/gnumach.defs
-+++ b/include/mach/gnumach.defs
-@@ -27,6 +27,7 @@ subsystem
- 
- #include <mach/std_types.defs>
- #include <mach/mach_types.defs>
-+#include <mach_debug/mach_debug_types.defs>
- 
- type vm_cache_statistics_data_t = struct[11] of integer_t;
- 
-@@ -63,3 +64,11 @@ simpleroutine thread_terminate_release(
-               reply_port      : mach_port_name_t;
-               address         : vm_address_t;
-               size            : vm_size_t);
-+
-+/*
-+ *    Set the name of task TASK to NAME.  This is a debugging aid.
-+ *    NAME will be used in error messages printed by the kernel.
-+ */
-+simpleroutine task_set_name(
-+              task    : task_t;
-+              name    : kernel_debug_name_t);
diff --git a/debian/patches/git-thread_terminate_release.patch 
b/debian/patches/git-thread_terminate_release.patch
deleted file mode 100644
index bd76488..0000000
--- a/debian/patches/git-thread_terminate_release.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-commit 22495036a354e209a7f2085bdd2e1fc82895208b
-Author: Richard Braun <address@hidden>
-Date:   Sun Nov 24 11:17:54 2013 +0100
-
-    New RPC for thread destruction
-    
-    A new call, thread_terminate_release, is added to support self
-    destruction in threading libraries.
-    
-    * include/mach/gnumach.defs (thread_terminate_release): New
-    simpleroutine declaration.
-    * kern/thread.c: Include vm/vm_user.h and ipc/mach_port.h.
-    (thread_terminate_release): New function.
-    * kern/thread.h (thread_terminate_release): New prototype.
-
-diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs
-index 7331334..12c4e99 100644
---- a/include/mach/gnumach.defs
-+++ b/include/mach/gnumach.defs
-@@ -37,3 +37,29 @@ type vm_cache_statistics_data_t = struct[11] of integer_t;
- routine vm_cache_statistics(
-               target_task     : vm_task_t;
-       out     vm_cache_stats  : vm_cache_statistics_data_t);
-+
-+/*
-+ * Terminate a thread and release rights and memory.
-+ *
-+ * Intended to be used by threading libraries to provide a clean way for
-+ * threads to terminate themselves. The resources a thread wouldn't be able
-+ * to release without this call when terminating itself are its
-+ * last reference to its kernel port, its reply port, and its stack.
-+ *
-+ * This call is semantically equivalent to :
-+ *  - mach_port_deallocate(task, thread_name);
-+ *  - if (reply_port != MACH_PORT_NULL)
-+ *      mach_port_destroy(task, reply_port);
-+ *  - if ((address != 0) || (size != 0))
-+ *      vm_deallocate(task, address, size)
-+ *  - thread_terminate(thread)
-+ *
-+ * Implemented as a simple routine so a reply port isn't required.
-+ */
-+simpleroutine thread_terminate_release(
-+              thread          : thread_t;
-+              task            : task_t;
-+              thread_name     : mach_port_name_t;
-+              reply_port      : mach_port_name_t;
-+              address         : vm_address_t;
-+              size            : vm_size_t);
-diff --git a/kern/thread.c b/kern/thread.c
-index eb8a8bb..67fd41e 100644
---- a/kern/thread.c
-+++ b/kern/thread.c
-@@ -57,9 +57,11 @@
- #include <kern/slab.h>
- #include <kern/mach_clock.h>
- #include <vm/vm_kern.h>
-+#include <vm/vm_user.h>
- #include <ipc/ipc_kmsg.h>
- #include <ipc/ipc_port.h>
- #include <ipc/mach_msg.h>
-+#include <ipc/mach_port.h>
- #include <machine/machspl.h>          /* for splsched */
- #include <machine/pcb.h>
- #include <machine/thread.h>           /* for MACHINE_STACK */
-@@ -850,6 +852,28 @@ kern_return_t thread_terminate(
-       return KERN_SUCCESS;
- }
- 
-+kern_return_t thread_terminate_release(
-+      thread_t thread,
-+      task_t task,
-+      mach_port_t thread_name,
-+      mach_port_t reply_port,
-+      vm_offset_t address,
-+      vm_size_t size)
-+{
-+      if (task == NULL)
-+              return KERN_INVALID_ARGUMENT;
-+
-+      mach_port_deallocate(task->itk_space, thread_name);
-+
-+      if (reply_port != MACH_PORT_NULL)
-+              mach_port_destroy(task->itk_space, reply_port);
-+
-+      if ((address != 0) || (size != 0))
-+              vm_deallocate(task->map, address, size);
-+
-+      return thread_terminate(thread);
-+}
-+
- /*
-  *    thread_force_terminate:
-  *
-diff --git a/kern/thread.h b/kern/thread.h
-index 3959dfc..beb2dbc 100644
---- a/kern/thread.h
-+++ b/kern/thread.h
-@@ -259,6 +259,13 @@ extern kern_return_t      thread_create(
-       thread_t        *child_thread);
- extern kern_return_t  thread_terminate(
-       thread_t        thread);
-+extern kern_return_t  thread_terminate_release(
-+      thread_t        thread,
-+      task_t          task,
-+      mach_port_t     thread_name,
-+      mach_port_t     reply_port,
-+      vm_offset_t     address,
-+      vm_size_t       size);
- extern kern_return_t  thread_suspend(
-       thread_t        thread);
- extern kern_return_t  thread_resume(
diff --git a/debian/patches/git-vm-tune.patch b/debian/patches/git-vm-tune.patch
deleted file mode 100644
index 26128c7..0000000
--- a/debian/patches/git-vm-tune.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-commit ed32cdc81be98287e4678bdb4a71a578b548580d
-Author: Samuel Thibault <address@hidden>
-Date:   Sat Aug 30 12:48:44 2014 +0200
-
-    Bump NR_GRANT_PAGES
-    
-    This has shown needed on buildds with several disks and network
-    interfaces.
-    
-    * xen/grant.c (NR_GRANT_PAGES): Increase from 4 to 8.
-
---- a/xen/grant.c
-+++ b/xen/grant.c
-@@ -25,7 +25,7 @@
- #include "grant.h"
- 
- #define NR_RESERVED_ENTRIES 8
--#define NR_GRANT_PAGES 4
-+#define NR_GRANT_PAGES 8
- 
- decl_simple_lock_data(static,lock);
- static struct grant_entry *grants;
---- a/vm/vm_pageout.c
-+++ b/vm/vm_pageout.c
-@@ -98,7 +98,7 @@
-  */
- 
- #ifndef       VM_PAGE_FREE_TARGET
--#define       VM_PAGE_FREE_TARGET(free)       (15 + (free) / 80)
-+#define       VM_PAGE_FREE_TARGET(free)       (150 + (free) * 10 / 100)
- #endif        /* VM_PAGE_FREE_TARGET */
- 
- /*
-@@ -107,7 +107,7 @@
-  */
- 
- #ifndef       VM_PAGE_FREE_MIN
--#define       VM_PAGE_FREE_MIN(free)  (10 + (free) / 100)
-+#define       VM_PAGE_FREE_MIN(free)  (100 + (free) * 8 / 100)
- #endif        /* VM_PAGE_FREE_MIN */
- 
- /*      When vm_page_external_count exceeds vm_page_external_limit, 
-@@ -133,7 +133,7 @@
-  *    operation by dipping into the reserved pool of pages.  */
- 
- #ifndef       VM_PAGE_FREE_RESERVED
--#define       VM_PAGE_FREE_RESERVED                   50
-+#define       VM_PAGE_FREE_RESERVED                   500
- #endif        /* VM_PAGE_FREE_RESERVED */
- 
- /*
-@@ -145,7 +145,7 @@
-  */
- 
- #ifndef       VM_PAGEOUT_RESERVED_INTERNAL
--#define       VM_PAGEOUT_RESERVED_INTERNAL(reserve)   ((reserve) - 25)
-+#define       VM_PAGEOUT_RESERVED_INTERNAL(reserve)   ((reserve) - 250)
- #endif        /* VM_PAGEOUT_RESERVED_INTERNAL */
- 
- /*
-@@ -157,7 +157,7 @@
-  */
- 
- #ifndef       VM_PAGEOUT_RESERVED_REALLY
--#define       VM_PAGEOUT_RESERVED_REALLY(reserve)     ((reserve) - 40)
-+#define       VM_PAGEOUT_RESERVED_REALLY(reserve)     ((reserve) - 400)
- #endif        /* VM_PAGEOUT_RESERVED_REALLY */
- 
- extern void vm_pageout_continue();
-@@ -916,6 +916,7 @@ void vm_pageout()
- 
-       current_thread()->vm_privilege = TRUE;
-       stack_privilege(current_thread());
-+      thread_set_own_priority(0);
- 
-       /*
-        *      Initialize some paging parameters.
diff --git a/debian/patches/git-vm_map.patch b/debian/patches/git-vm_map.patch
deleted file mode 100644
index 006cce9..0000000
--- a/debian/patches/git-vm_map.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 5ae510e35c54009626999a88f0f1cb34d6dfc94f
-Author: Samuel Thibault <address@hidden>
-Date:   Sat Sep 6 11:55:48 2014 +0200
-
-    Make vm_map really ignore `address' when `anywhere' is true
-    
-    As vm_allocate does.
-    
-    * vm/vm_user.c (vm_map): When `anywhere' is true, set `address' to the
-    minimum address of the `target_map'.
-
-diff --git a/vm/vm_user.c b/vm/vm_user.c
-index f7c87cc..1d8f37b 100644
---- a/vm/vm_user.c
-+++ b/vm/vm_user.c
-@@ -336,7 +336,10 @@ kern_return_t vm_map(
-       if (size == 0)
-               return KERN_INVALID_ARGUMENT;
- 
--      *address = trunc_page(*address);
-+      if (anywhere)
-+              *address = vm_map_min(target_map);
-+      else
-+              *address = trunc_page(*address);
-       size = round_page(size);
- 
-       if (!IP_VALID(memory_object)) {
diff --git a/debian/patches/git-xen_clock_overflow.patch 
b/debian/patches/git-xen_clock_overflow.patch
deleted file mode 100644
index ce83da5..0000000
--- a/debian/patches/git-xen_clock_overflow.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-commit e2dde67c3f46f5bbe7deb90e52b61977df30a52c
-Author: Vladimir 'φ-coder/phcoder' Serbinenko <address@hidden>
-Date:   Sat Nov 9 18:52:21 2013 +0100
-
-    Fix overflow in Xen clock computation
-    
-    * xen/time.c (hyp_get_stime): Split `delta` into `delta_high` and
-    `delta_low`, as it may overflow 4 second timing nowadays.
-
-diff --git a/xen/time.c b/xen/time.c
-index a11e7eb..93d87d4 100644
---- a/xen/time.c
-+++ b/xen/time.c
-@@ -34,6 +34,7 @@ static unsigned64_t lastnsec;
- static unsigned64_t hyp_get_stime(void) {
-       unsigned32_t version;
-       unsigned64_t cpu_clock, last_cpu_clock, delta, system_time;
-+      unsigned64_t delta_high, delta_low;
-       unsigned32_t mul;
-       signed8_t shift;
-       volatile struct vcpu_time_info *time = 
&hyp_shared_info.vcpu_info[0].time;
-@@ -54,7 +55,10 @@ static unsigned64_t hyp_get_stime(void) {
-               delta >>= -shift;
-       else
-               delta <<= shift;
--      return system_time + ((delta * (unsigned64_t) mul) >> 32);
-+      delta_high = delta >> 32;
-+      delta_low = (unsigned32_t) delta;
-+      return system_time + ((delta_low * (unsigned64_t) mul) >> 32)
-+        + (delta_high * (unsigned64_t) mul);
- }
- 
- unsigned64_t hyp_get_time(void) {
diff --git a/debian/patches/git-xen_races.patch 
b/debian/patches/git-xen_races.patch
deleted file mode 100644
index 187b4dd..0000000
--- a/debian/patches/git-xen_races.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-commit dc1631b7dc508cb67fa6983007ddba3a2314d6bf
-Author: Samuel Thibault <address@hidden>
-Date:   Tue May 27 20:28:56 2014 +0200
-
-    Add missing memory clobber
-    
-    * i386/i386/xen.h (mb, rmb, wmb): Add memory clobber.
-
-diff --git a/i386/i386/xen.h b/i386/i386/xen.h
-index 5bdaf0b..638d671 100644
---- a/i386/i386/xen.h
-+++ b/i386/i386/xen.h
-@@ -33,7 +33,7 @@
- 
- /* TODO: this should be moved in appropriate non-Xen place.  */
- #define barrier() __asm__ __volatile__ ("": : :"memory")
--#define mb() __asm__ __volatile__("lock; addl $0,0(%esp)")
-+#define mb() __asm__ __volatile__("lock; addl $0,0(%%esp)":::"memory")
- #define rmb() mb()
- #define wmb() mb()
- MACH_INLINE unsigned long xchgl(volatile unsigned long *ptr, unsigned long x)
diff --git a/debian/patches/series b/debian/patches/series
index c6e15ba..a95f927 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,25 +3,3 @@
 50_initrd.patch
 60_bigmem.patch
 70_dde.patch
-80_missing_files.patch
-git-kentry_data_size.patch
-git-thread_terminate_release.patch
-git-xen_clock_overflow.patch
-git-cursor_init.patch
-git-coverity-fixes.patch
-git-mig-inlines.patch
-git-quiet-cd-floppy.patch
-git-task_set_name.patch
-git-physical-access.patch
-git-memory_object_translatable.patch
-git-memory_object_translatable2.patch
-git-notify_translatable.patch
-git-device_translatable.patch
-git-device_translatable2.patch
-git-mach_debug.patch
-git-mach_debug2.patch
-git-halt.patch
-git-xen_races.patch
-git-vm-tune.patch
-git-vm_map.patch
-git-gdb_hw_watch.patch
diff --git a/debian/rules b/debian/rules
index e8873d3..6e0b453 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,8 @@ FULL_VERSION     := $(shell dpkg-parsechangelog | grep 
^Version: | sed -e 's/^.*
 NOEPOCH_VERSION  := $(shell echo $(FULL_VERSION) | sed -e 's/.*://g')
 TAR_VERSION      := $(shell echo $(NOEPOCH_VERSION) | sed -e 's/-.*//g')
 UPSTREAM_VERSION := $(shell echo $(TAR_VERSION) | sed -e 's/\.dfsg.*//g')
-VERSION          := $(UPSTREAM_VERSION)
+NOGIT_VERSION    := $(shell echo $(UPSTREAM_VERSION) | sed -e 
's/+git[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]//g')
+VERSION          := $(NOGIT_VERSION)
 MAJOR            := $(shell echo $(VERSION) | sed -e 's/\..*//g')
 DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/gnumach.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]