summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2022-02-27 09:10:36 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-03-01 01:44:01 +0100
commitc06be8fd568acef58888e6f702c648316ef0ef64 (patch)
tree8279d852ac13d1eed1a1992fafd1fa2861fea237
parent05ff8d177f87007df0579952d6cce421b494198b (diff)
libmachdev: Export demuxer as machdev_demuxer and bucket pointer
This will allow callers to manage their own server routine. Message-Id: <20220227091013.33112-3-damien@zamaudio.com>
-rw-r--r--libmachdev/ds_routines.c6
-rw-r--r--libmachdev/machdev.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
index e89ceee0..0f8db7ed 100644
--- a/libmachdev/ds_routines.c
+++ b/libmachdev/ds_routines.c
@@ -328,8 +328,8 @@ machdev_device_sync()
}
}
-static int
-demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
+int
+machdev_demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
{
mig_routine_t routine;
if ((routine = device_server_routine (inp)) ||
@@ -355,7 +355,7 @@ machdev_server(void *arg)
/* Launch. */
do
{
- ports_manage_port_operations_one_thread (machdev_device_bucket, demuxer, 0);
+ ports_manage_port_operations_one_thread (machdev_device_bucket, machdev_demuxer, 0);
} while (1);
return NULL;
diff --git a/libmachdev/machdev.h b/libmachdev/machdev.h
index 7ac42eed..e1833cff 100644
--- a/libmachdev/machdev.h
+++ b/libmachdev/machdev.h
@@ -27,6 +27,8 @@
#include "machdev-device_emul.h"
#include "machdev-dev_hdr.h"
+extern struct port_bucket *machdev_device_bucket;
+
void machdev_register (struct machdev_device_emulation_ops *ops);
void machdev_device_init(void);
@@ -34,6 +36,7 @@ void machdev_device_sync(void);
void * machdev_server(void *);
error_t machdev_create_device_port (size_t size, void *result);
int machdev_trivfs_init(int argc, char **argv, mach_port_t bootstrap_resume_task, const char *name, const char *path, mach_port_t *bootstrap);
+int machdev_demuxer(mach_msg_header_t *inp, mach_msg_header_t *outp);
void machdev_trivfs_server(mach_port_t bootstrap);
boolean_t machdev_is_master_device (mach_port_t port);