summaryrefslogtreecommitdiff
path: root/proc/mig-decls.h
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-11-28 10:31:08 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-07 15:38:18 +0100
commit07db92f65a7b49f97bc43ed94ff02586b75e21c6 (patch)
treed82e06734ab2c4e6fbef60fd5cff79c21da8bb35 /proc/mig-decls.h
parentab741d845af6fac6313ed40b8f2ae148d96aa716 (diff)
proc: add payload-aware intrans functions
* proc/mig-decls.h (begin_using_proc_payload): New function. (begin_using_exc_payload): Likewise. * proc/mig-mutate.h: Add mutators. * proc/proc_exc.defs (exception_t): Add payload-aware in-translator function.
Diffstat (limited to 'proc/mig-decls.h')
-rw-r--r--proc/mig-decls.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/proc/mig-decls.h b/proc/mig-decls.h
index 7d36a870..eb33ef31 100644
--- a/proc/mig-decls.h
+++ b/proc/mig-decls.h
@@ -35,6 +35,17 @@ begin_using_proc_port (mach_port_t port)
return (!p || p->p_dead) ? NULL : p;
}
+static inline struct proc * __attribute__ ((unused))
+begin_using_proc_payload (unsigned long payload)
+{
+ struct proc *p;
+ p = ports_lookup_payload (proc_bucket, payload, proc_class);
+ if (p && p->p_dead)
+ ports_port_deref (p);
+ return (!p || p->p_dead) ? 0 : p;
+}
+
+
static inline void __attribute__ ((unused))
end_using_proc (struct proc *p)
{
@@ -50,6 +61,12 @@ begin_using_exc_port (mach_port_t port)
return ports_lookup_port (NULL, port, exc_class);
}
+static inline exc_t __attribute__ ((unused))
+begin_using_exc_payload (unsigned long payload)
+{
+ return ports_lookup_payload (NULL, payload, exc_class);
+}
+
static inline void __attribute__ ((unused))
end_using_exc (exc_t exc)
{