summaryrefslogtreecommitdiff
path: root/libmachdev/ds_routines.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmachdev/ds_routines.c')
-rw-r--r--libmachdev/ds_routines.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
index 1cd06359..9152c72e 100644
--- a/libmachdev/ds_routines.c
+++ b/libmachdev/ds_routines.c
@@ -68,8 +68,8 @@
#include "util.h"
#include "queue.h"
-struct port_bucket *port_bucket;
-struct port_class *dev_class;
+static struct port_bucket *port_bucket;
+static struct port_class *dev_class;
extern struct device_emulation_ops linux_net_emulation_ops;
@@ -783,6 +783,12 @@ static any_t io_done_thread(any_t unused)
return 0;
}
+int create_device_port (int size, void *result)
+{
+ return ports_create_port (dev_class, port_bucket,
+ size, result);
+}
+
void mach_device_init()
{
int i;
@@ -800,3 +806,22 @@ void mach_device_init()
cthread_detach (cthread_fork (io_done_thread, 0));
}
+
+static int
+demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
+{
+ int ret;
+ extern int device_server (mach_msg_header_t *, mach_msg_header_t *);
+ extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
+ ret = device_server (inp, outp) || notify_server (inp, outp);
+ return ret;
+}
+
+void ds_server()
+{
+ /* Launch. */
+ do
+ {
+ ports_manage_port_operations_one_thread (port_bucket, demuxer, 0);
+ } while (1);
+}