[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH hurd 18/30] proc: add payload-aware intrans functions
From: |
Justus Winter |
Subject: |
[PATCH hurd 18/30] proc: add payload-aware intrans functions |
Date: |
Thu, 27 Nov 2014 14:18:58 +0100 |
* 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.
---
proc/mig-decls.h | 17 +++++++++++++++++
proc/mig-mutate.h | 4 ++++
proc/proc_exc.defs | 1 +
3 files changed, 22 insertions(+)
diff --git a/proc/mig-decls.h b/proc/mig-decls.h
index 7d36a87..eb33ef3 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)
{
diff --git a/proc/mig-mutate.h b/proc/mig-mutate.h
index ce9f88e..62dc2a5 100644
--- a/proc/mig-mutate.h
+++ b/proc/mig-mutate.h
@@ -20,6 +20,8 @@
#define PROCESS_INTRAN \
pstruct_t begin_using_proc_port (process_t)
+#define PROCESS_INTRAN_PAYLOAD \
+ pstruct_t begin_using_proc_payload
#define PROCESS_DESTRUCTOR \
end_using_proc (pstruct_t)
#define PROCESS_IMPORTS \
@@ -27,6 +29,8 @@
#define NOTIFY_INTRAN \
port_info_t begin_using_port_info_port (mach_port_t)
+#define NOTIFY_INTRAN_PAYLOAD \
+ port_info_t begin_using_port_info_payload
#define NOTIFY_DESTRUCTOR \
end_using_port_info (port_info_t)
#define NOTIFY_IMPORTS \
diff --git a/proc/proc_exc.defs b/proc/proc_exc.defs
index c910824..9dc3626 100644
--- a/proc/proc_exc.defs
+++ b/proc/proc_exc.defs
@@ -38,6 +38,7 @@ import "mig-decls.h";
type exception_t = mach_port_copy_send_t
cusertype: mach_port_t
intran: exc_t begin_using_exc_port (exception_t)
+ intranpayload: exc_t begin_using_exc_payload
destructor: end_using_exc (exc_t);
routine proc_exception_raise (
--
2.1.3
- [PATCH hurd 08/30] libtrivfs: add payload-aware intrans functions, (continued)
- [PATCH hurd 08/30] libtrivfs: add payload-aware intrans functions, Justus Winter, 2014/11/27
- [PATCH hurd 11/30] auth: add a payload-aware intrans function, Justus Winter, 2014/11/27
- [PATCH hurd 10/30] libcons: add a payload-aware intrans function, Justus Winter, 2014/11/27
- [PATCH hurd 12/30] console: add a payload-aware intrans function, Justus Winter, 2014/11/27
- [PATCH hurd 13/30] console-client: make the demuxer payload-aware, Justus Winter, 2014/11/27
- [PATCH hurd 15/30] pfinet: add payload-aware intrans functions, Justus Winter, 2014/11/27
- [PATCH hurd 14/30] exec: add payload-aware intrans functions, Justus Winter, 2014/11/27
- [PATCH hurd 16/30] pfinet: make the demuxers payload-aware, Justus Winter, 2014/11/27
- [PATCH hurd 17/30] pflocal: add payload-aware intrans functions, Justus Winter, 2014/11/27
- [PATCH hurd 19/30] startup: disable default payload to port mapping, Justus Winter, 2014/11/27
- [PATCH hurd 18/30] proc: add payload-aware intrans functions,
Justus Winter <=
- [PATCH hurd 23/30] trans/password: add a payload-aware intrans function, Justus Winter, 2014/11/27
- [PATCH hurd 21/30] trans/fakeroot: make the demuxer payload-aware, Justus Winter, 2014/11/27
- [PATCH hurd 22/30] trans/ifsock: add a payload-aware intrans function, Justus Winter, 2014/11/27
- [PATCH hurd 20/30] term: add a payload-aware intrans function, Justus Winter, 2014/11/27
- [PATCH hurd 24/30] trans/streamio: make the translator payload-aware, Justus Winter, 2014/11/27
- [PATCH hurd 29/30] libports: Fix build, Justus Winter, 2014/11/27
- [PATCH hurd 25/30] trans/symlink: disable default payload to port mapping, Justus Winter, 2014/11/27
- [PATCH hurd 27/30] hurd: add intranpayload functions to all hurd types, Justus Winter, 2014/11/27
- [PATCH hurd 26/30] utils/rpctrace: make `trace_and_forward' payload-aware, Justus Winter, 2014/11/27
- [PATCH hurd 30/30] mach-defpager: fix build, Justus Winter, 2014/11/27