summaryrefslogtreecommitdiff
path: root/debian/patches/0009-proc-move-translation-functions-to-mig-decls.h.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0009-proc-move-translation-functions-to-mig-decls.h.patch')
-rw-r--r--debian/patches/0009-proc-move-translation-functions-to-mig-decls.h.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/debian/patches/0009-proc-move-translation-functions-to-mig-decls.h.patch b/debian/patches/0009-proc-move-translation-functions-to-mig-decls.h.patch
new file mode 100644
index 00000000..6c987238
--- /dev/null
+++ b/debian/patches/0009-proc-move-translation-functions-to-mig-decls.h.patch
@@ -0,0 +1,107 @@
+From 063455e5215efd9e6c7b256fcf8be441c3481a27 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Fri, 16 May 2014 10:13:02 +0200
+Subject: [PATCH 09/20] proc: move translation functions to mig-decls.h
+
+* proc/hash.c (reqport_find): Move this function...
+* proc/proc.h (process_drop): ... and this...
+* proc/mig-decls.h: ... here and rename them.
+* proc/mig-mutate.h: Update accordingly.
+---
+ proc/hash.c | 11 -----------
+ proc/mig-decls.h | 18 ++++++++++++++++++
+ proc/mig-mutate.h | 6 +++---
+ proc/proc.h | 7 -------
+ 4 files changed, 21 insertions(+), 21 deletions(-)
+
+diff --git a/proc/hash.c b/proc/hash.c
+index ed670a1..e4dc5ff 100644
+--- a/proc/hash.c
++++ b/proc/hash.c
+@@ -76,17 +76,6 @@ task_find_nocreate (task_t task)
+ return (!p || p->p_dead) ? 0 : p;
+ }
+
+-/* Find the process corresponding to a given request port. */
+-struct proc *
+-reqport_find (mach_port_t reqport)
+-{
+- struct proc *p;
+- p = ports_lookup_port (proc_bucket, reqport, proc_class);
+- if (p && p->p_dead)
+- ports_port_deref (p);
+- return (!p || p->p_dead) ? 0 : p;
+-}
+-
+ /* Find the process group corresponding to a given pgid. */
+ struct pgrp *
+ pgrp_find (pid_t pgid)
+diff --git a/proc/mig-decls.h b/proc/mig-decls.h
+index 0d5bd4d..7d36a87 100644
+--- a/proc/mig-decls.h
++++ b/proc/mig-decls.h
+@@ -24,6 +24,24 @@
+
+ #include "proc.h"
+
++/* Find the process corresponding to a given request port. */
++static inline struct proc * __attribute__ ((unused))
++begin_using_proc_port (mach_port_t port)
++{
++ struct proc *p;
++ p = ports_lookup_port (proc_bucket, port, proc_class);
++ if (p && p->p_dead)
++ ports_port_deref (p);
++ return (!p || p->p_dead) ? NULL : p;
++}
++
++static inline void __attribute__ ((unused))
++end_using_proc (struct proc *p)
++{
++ if (p)
++ ports_port_deref (p);
++}
++
+ typedef struct exc* exc_t;
+
+ static inline exc_t __attribute__ ((unused))
+diff --git a/proc/mig-mutate.h b/proc/mig-mutate.h
+index ad6eb32..ce9f88e 100644
+--- a/proc/mig-mutate.h
++++ b/proc/mig-mutate.h
+@@ -19,11 +19,11 @@
+
+
+ #define PROCESS_INTRAN \
+- pstruct_t reqport_find (process_t)
++ pstruct_t begin_using_proc_port (process_t)
+ #define PROCESS_DESTRUCTOR \
+- process_drop (pstruct_t)
++ end_using_proc (pstruct_t)
+ #define PROCESS_IMPORTS \
+- import "proc.h";
++ import "mig-decls.h";
+
+ #define NOTIFY_INTRAN \
+ port_info_t begin_using_port_info_port (mach_port_t)
+diff --git a/proc/proc.h b/proc/proc.h
+index 12f56da..a2e3c53 100644
+--- a/proc/proc.h
++++ b/proc/proc.h
+@@ -145,13 +145,6 @@ mach_port_t generic_port; /* messages not related to a specific proc */
+
+ pthread_mutex_t global_lock;
+
+-static inline void __attribute__ ((unused))
+-process_drop (struct proc *p)
+-{
+- if (p)
+- ports_port_deref (p);
+-}
+-
+ /* Forward declarations */
+ void complete_wait (struct proc *, int);
+ int check_uid (struct proc *, uid_t);
+--
+2.0.0.rc0
+