summaryrefslogtreecommitdiff
path: root/proc/mig-decls.h
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-05-16 10:13:02 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-05-16 18:55:08 +0200
commit868a820a19ff66c370cf40573ac89738386513c3 (patch)
tree5707998734db6f10ec8d133bf3a5da3df7cf6cbc /proc/mig-decls.h
parent820241ead7e31082fa99f3e756c6aa73aae7d88b (diff)
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.
Diffstat (limited to 'proc/mig-decls.h')
-rw-r--r--proc/mig-decls.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/proc/mig-decls.h b/proc/mig-decls.h
index 0d5bd4df..7d36a870 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))