diff options
Diffstat (limited to 'libmachdev')
-rw-r--r-- | libmachdev/Makefile | 1 | ||||
-rw-r--r-- | libmachdev/mig-decls.h | 6 | ||||
-rw-r--r-- | libmachdev/mig-mutate.h | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/libmachdev/Makefile b/libmachdev/Makefile index 345c004f..221e4ed3 100644 --- a/libmachdev/Makefile +++ b/libmachdev/Makefile @@ -29,5 +29,6 @@ HURDLIBS = ports trivfs ddekit bpf OTHERLIBS = -lpthread OBJS = $(SRCS:.c=.o) $(MIGSTUBS) MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h +device-MIGSFLAGS="-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name" include ../Makeconf diff --git a/libmachdev/mig-decls.h b/libmachdev/mig-decls.h index b3dc43d2..8302029d 100644 --- a/libmachdev/mig-decls.h +++ b/libmachdev/mig-decls.h @@ -34,6 +34,12 @@ begin_using_device_port (mach_port_t port) return ports_lookup_port (device_bucket, port, dev_class); } +static inline struct mach_device * __attribute__ ((unused)) +begin_using_device_payload (unsigned long payload) +{ + return ports_lookup_payload (device_bucket, payload, dev_class); +} + static inline void __attribute__ ((unused)) end_using_device (struct mach_device *p) { diff --git a/libmachdev/mig-mutate.h b/libmachdev/mig-mutate.h index 56c6965a..902ff166 100644 --- a/libmachdev/mig-mutate.h +++ b/libmachdev/mig-mutate.h @@ -19,6 +19,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 \ @@ -26,6 +28,8 @@ #define DEVICE_INTRAN \ mach_device_t begin_using_device_port (mach_port_t) +#define DEVICE_INTRAN_PAYLOAD \ + mach_device_t begin_using_device_payload #define DEVICE_DESTRUCTOR \ end_using_device (mach_device_t) #define DEVICE_IMPORTS \ |