summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2020-07-25 11:18:45 +1000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-07-25 13:14:18 +0200
commit06906d97984e6de0567b652e108cc4d8d764e561 (patch)
treec7d42424294d115431abf2766a4ed1a234415f25
parent67c9d475e7204296ca9bcfbd08a896df1a87e74a (diff)
libmachdev: Implement S_i386_io_perm_create
Now that machdev redirects the device master port, it has to implement the i386 permission RPCs on it. Message-Id: <20200725011847.186969-2-damien@zamaudio.com> Message-Id: <20200725011847.186969-3-damien@zamaudio.com>
-rw-r--r--Makeconf4
-rw-r--r--libmachdev/Makefile2
-rw-r--r--libmachdev/trivfs_server.c60
3 files changed, 65 insertions, 1 deletions
diff --git a/Makeconf b/Makeconf
index f68ff6e3..b4a5dbd5 100644
--- a/Makeconf
+++ b/Makeconf
@@ -582,15 +582,19 @@ mach_defs_names = bootstrap exc mach mach4 \
gnumach \
task_notify \
+mach_i386_defs_names = mach_i386
mach_debug_defs_names = mach_debug
device_defs_names = dev_forward device device_reply device_request
mach_defs = $(addsuffix .defs,$(mach_defs_names))
+mach_i386_defs = $(addsuffix .defs,$(mach_i386_defs_names))
mach_debug_defs = $(addsuffix .defs,$(mach_debug_defs_names))
device_defs = $(addsuffix .defs,$(device_defs_names))
$(mach_defs): %.defs:
echo '#include <mach/$@>' > $@
+$(mach_i386_defs): %.defs:
+ echo '#include <mach/i386/$@>' > $@
$(mach_debug_defs): %.defs:
echo '#include <mach_debug/$@>' > $@
$(device_defs): %.defs:
diff --git a/libmachdev/Makefile b/libmachdev/Makefile
index db275cce..15b98cf1 100644
--- a/libmachdev/Makefile
+++ b/libmachdev/Makefile
@@ -20,7 +20,7 @@ makemode := library
libname = libmachdev
SRCS = ds_routines.c trivfs_server.c \
- deviceServer.c notifyServer.c
+ deviceServer.c notifyServer.c mach_i386Server.c
LCLHDRS = machdev.h machdev-device_emul.h machdev-dev_hdr.h mach_device.h
installhdrs = machdev.h machdev-device_emul.h machdev-dev_hdr.h
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c
index 05efde2e..93d498ad 100644
--- a/libmachdev/trivfs_server.c
+++ b/libmachdev/trivfs_server.c
@@ -33,6 +33,7 @@
#include "device_S.h"
#include "notify_S.h"
#include "fsys_S.h"
+#include "mach_i386_S.h"
static struct port_bucket *port_bucket;
@@ -135,6 +136,64 @@ trivfs_append_args (struct trivfs_control *fsys, char **argz, size_t *argz_len)
return err;
}
+
+kern_return_t
+S_i386_set_ldt (mach_port_t target_thread,
+ int first_selector,
+ descriptor_list_t desc_list,
+ mach_msg_type_number_t desc_listCnt,
+ boolean_t desc_listSCopy)
+{
+ return EOPNOTSUPP;
+}
+
+kern_return_t
+S_i386_get_ldt (mach_port_t target_thread,
+ int first_selector,
+ int selector_count,
+ descriptor_list_t *desc_list,
+ mach_msg_type_number_t *desc_listCnt)
+{
+ return EOPNOTSUPP;
+}
+
+kern_return_t
+S_i386_io_perm_modify (mach_port_t target_task,
+ mach_port_t io_perm,
+ boolean_t enable)
+{
+ return EOPNOTSUPP;
+}
+
+kern_return_t
+S_i386_set_gdt (mach_port_t target_thread,
+ int *selector,
+ descriptor_t desc)
+{
+ return EOPNOTSUPP;
+}
+
+kern_return_t
+S_i386_get_gdt (mach_port_t target_thread,
+ int selector,
+ descriptor_t *desc)
+{
+ return EOPNOTSUPP;
+}
+
+kern_return_t
+S_i386_io_perm_create (mach_port_t master_port,
+ io_port_t from,
+ io_port_t to,
+ io_perm_t *io_perm)
+{
+ /* Make sure we are the master device */
+ if (! machdev_is_master_device(master_port))
+ return EINVAL;
+
+ return i386_io_perm_create (_hurd_device_master, from, to, io_perm);
+}
+
/* This is fraud */
kern_return_t
trivfs_S_fsys_startup (mach_port_t bootport,
@@ -267,6 +326,7 @@ demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
mig_routine_t routine;
if ((routine = device_server_routine (inp)) ||
(routine = notify_server_routine (inp)) ||
+ (routine = mach_i386_server_routine (inp)) ||
(routine = NULL, trivfs_demuxer (inp, outp)))
{
if (routine)