summaryrefslogtreecommitdiff
path: root/debian/patches/ttr20001-ttr2.diff.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/ttr20001-ttr2.diff.patch')
-rw-r--r--debian/patches/ttr20001-ttr2.diff.patch104
1 files changed, 104 insertions, 0 deletions
diff --git a/debian/patches/ttr20001-ttr2.diff.patch b/debian/patches/ttr20001-ttr2.diff.patch
new file mode 100644
index 0000000..bd5424d
--- /dev/null
+++ b/debian/patches/ttr20001-ttr2.diff.patch
@@ -0,0 +1,104 @@
+From 0ee124fa2288f4bb98436d340fa380a09a142834 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@gnupg.org>
+Date: Sun, 24 Apr 2016 02:09:40 +0200
+Subject: [PATCH gnumach] ttr2.diff
+
+---
+ include/mach/gnumach.defs | 9 +++++++++
+ kern/thread.c | 24 +++++++++++++++++++++---
+ kern/thread.h | 8 ++++++++
+ 3 files changed, 38 insertions(+), 3 deletions(-)
+
+diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs
+index 5235df6..37cb54b 100644
+--- a/include/mach/gnumach.defs
++++ b/include/mach/gnumach.defs
+@@ -136,3 +136,12 @@ simpleroutine gsync_requeue(
+ wake_one : boolean_t;
+ flags : int);
+
++/* XXX */
++simpleroutine thread_terminate_release2(
++ 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;
++ death_event : vm_offset_t);
+diff --git a/kern/thread.c b/kern/thread.c
+index ce44ed1..d5f52ea 100644
+--- a/kern/thread.c
++++ b/kern/thread.c
+@@ -43,6 +43,7 @@
+ #include <kern/counters.h>
+ #include <kern/debug.h>
+ #include <kern/eventcount.h>
++#include <kern/gsync.h>
+ #include <kern/ipc_mig.h>
+ #include <kern/ipc_tt.h>
+ #include <kern/processor.h>
+@@ -848,13 +849,14 @@ kern_return_t thread_terminate(
+ return KERN_SUCCESS;
+ }
+
+-kern_return_t thread_terminate_release(
++kern_return_t thread_terminate_release2(
+ thread_t thread,
+ task_t task,
+ mach_port_t thread_name,
+ mach_port_t reply_port,
+ vm_offset_t address,
+- vm_size_t size)
++ vm_size_t size,
++ vm_offset_t death_event)
+ {
+ if (task == NULL)
+ return KERN_INVALID_ARGUMENT;
+@@ -867,7 +869,23 @@ kern_return_t thread_terminate_release(
+ if ((address != 0) || (size != 0))
+ vm_deallocate(task->map, address, size);
+
+- return thread_terminate(thread);
++ kern_return_t ret = thread_terminate (thread);
++ if (death_event != 0)
++ gsync_wake (task, death_event, 0, GSYNC_MUTATE);
++
++ return (ret);
++}
++
++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)
++{
++ return (thread_terminate_release2 (thread,
++ task, thread_name, reply_port, address, size, 0));
+ }
+
+ /*
+diff --git a/kern/thread.h b/kern/thread.h
+index 7106fd2..b04bd75 100644
+--- a/kern/thread.h
++++ b/kern/thread.h
+@@ -285,6 +285,14 @@ extern kern_return_t thread_terminate_release(
+ mach_port_t reply_port,
+ vm_offset_t address,
+ vm_size_t size);
++extern kern_return_t thread_terminate_release2(
++ thread_t thread,
++ task_t task,
++ mach_port_t thread_name,
++ mach_port_t reply_port,
++ vm_offset_t address,
++ vm_size_t size,
++ vm_offset_t death_event);
+ extern kern_return_t thread_suspend(
+ thread_t thread);
+ extern kern_return_t thread_resume(
+--
+2.1.4
+