summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-05-07 13:15:02 -0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-07 19:25:00 +0200
commitadd3d8afc7fd199c0fe6bf40a46462c2f77f9ef5 (patch)
tree31830f8669c960601925aecac7f0012bd1092251
parent42fbc5f9afb66043d4493297a84842cbeef870b7 (diff)
Implement device_open_new for all the translators implementing the device interface.
Message-Id: <ZFfcloxDKSiyHJTH@jupiter.tail36e24.ts.net>
-rw-r--r--boot/Makefile1
-rw-r--r--boot/boot.c13
-rw-r--r--devnode/Makefile2
-rw-r--r--devnode/devnode.c10
-rw-r--r--eth-multiplexer/Makefile2
-rw-r--r--eth-multiplexer/device_impl.c10
-rw-r--r--libmachdev/Makefile2
-rw-r--r--libmachdev/ds_routines.c10
8 files changed, 47 insertions, 3 deletions
diff --git a/boot/Makefile b/boot/Makefile
index e2eeb20b..bbf19ea9 100644
--- a/boot/Makefile
+++ b/boot/Makefile
@@ -26,6 +26,7 @@ MIGSTUBS = machServer.o mach_hostServer.o gnumachServer.o task_notifyServer.o
OBJS = boot.o $(COMMON-OBJS) $(MIGSTUBS)
target = boot
MIGSFLAGS=-imacros $(srcdir)/mig-mutate.h -DHURD_DEFAULT_PAYLOAD_TO_PORT=1
+device-MIGSFLAGS=-DDEVICE_ENABLE_DEVICE_OPEN_NEW
io-MIGSFLAGS=-DREPLY_PORTS -DHURD_DEFAULT_PAYLOAD_TO_PORT=1
HURDLIBS = store shouldbeinlibc ihash
LDLIBS += -lpthread
diff --git a/boot/boot.c b/boot/boot.c
index 3fa9ddab..b661f09c 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -992,6 +992,19 @@ ds_device_open (mach_port_t master_port,
}
kern_return_t
+ds_device_open_new (mach_port_t master_port,
+ mach_port_t reply_port,
+ mach_msg_type_name_t reply_type,
+ dev_mode_t mode,
+ const_dev_name_t name,
+ mach_port_t *device,
+ mach_msg_type_name_t *devicetype)
+{
+ return ds_device_open (master_port, reply_port, reply_type, mode,
+ name, device, devicetype);
+}
+
+kern_return_t
ds_device_close (device_t device)
{
if (device != pseudo_console && device != pseudo_root)
diff --git a/devnode/Makefile b/devnode/Makefile
index 0964f8d4..6172ec90 100644
--- a/devnode/Makefile
+++ b/devnode/Makefile
@@ -24,7 +24,7 @@ HURDLIBS = fshelp ihash iohelp ports shouldbeinlibc trivfs
target = devnode
MIGSTUBS = deviceServer.o notifyServer.o
MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
-device-MIGSFLAGS="-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name"
+device-MIGSFLAGS=-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name -DDEVICE_ENABLE_DEVICE_OPEN_NEW
OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
include ../Makeconf
diff --git a/devnode/devnode.c b/devnode/devnode.c
index bf3378ea..f5a00f1b 100644
--- a/devnode/devnode.c
+++ b/devnode/devnode.c
@@ -175,6 +175,16 @@ ds_device_open (mach_port_t master_port, mach_port_t reply_port,
}
kern_return_t
+ds_device_open_new (mach_port_t master_port, mach_port_t reply_port,
+ mach_msg_type_name_t reply_portPoly,
+ dev_mode_t mode, const_dev_name_t name, mach_port_t *device,
+ mach_msg_type_name_t *devicetype)
+{
+ return ds_device_open (master_port, reply_port, reply_portPoly, mode,
+ name, device, devicetype);
+}
+
+kern_return_t
ds_device_close (device_t device)
{
return D_INVALID_OPERATION;
diff --git a/eth-multiplexer/Makefile b/eth-multiplexer/Makefile
index 5f3d2739..c9dd660d 100644
--- a/eth-multiplexer/Makefile
+++ b/eth-multiplexer/Makefile
@@ -23,7 +23,7 @@ target = eth-multiplexer
SRCS = ethernet.c vdev.c multiplexer.c dev_stat.c netfs_impl.c device_impl.c dead-name.c demuxer.c
MIGSTUBS = deviceServer.o
MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
-device-MIGSFLAGS="-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name"
+device-MIGSFLAGS=-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name -DDEVICE_ENABLE_DEVICE_OPEN_NEW
OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
LCLHDRS = ethernet.h util.h vdev.h netfs_impl.h
HURDLIBS = ports ihash iohelp fshelp shouldbeinlibc netfs bpf
diff --git a/eth-multiplexer/device_impl.c b/eth-multiplexer/device_impl.c
index 152dc7bc..6a67fbd9 100644
--- a/eth-multiplexer/device_impl.c
+++ b/eth-multiplexer/device_impl.c
@@ -84,6 +84,16 @@ ds_device_open (mach_port_t master_port, mach_port_t reply_port,
}
kern_return_t
+ds_device_open_new (mach_port_t master_port, mach_port_t reply_port,
+ mach_msg_type_name_t reply_portPoly,
+ dev_mode_t mode, const_dev_name_t name, mach_port_t *device,
+ mach_msg_type_name_t *devicetype)
+{
+ return ds_device_open (master_port, reply_port, reply_portPoly, mode,
+ name, device, devicetype);
+}
+
+kern_return_t
ds_device_close (struct vether_device *device)
{
return 0;
diff --git a/libmachdev/Makefile b/libmachdev/Makefile
index 7b07c926..8b1396f3 100644
--- a/libmachdev/Makefile
+++ b/libmachdev/Makefile
@@ -28,7 +28,7 @@ HURDLIBS = ports trivfs
LDLIBS += -lpthread -lmachuser
OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
-device-MIGSFLAGS="-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name"
+device-MIGSFLAGS=-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name -DDEVICE_ENABLE_DEVICE_OPEN_NEW
mach_i386-MIGSFLAGS="-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name" \
"-DMACH_I386_IMPORTS=import \"$(srcdir)/../libports/ports.h\";"
diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
index 0d60d589..6555d6e9 100644
--- a/libmachdev/ds_routines.c
+++ b/libmachdev/ds_routines.c
@@ -127,6 +127,16 @@ ds_device_open (mach_port_t open_port, mach_port_t reply_port,
}
io_return_t
+ds_device_open_new (mach_port_t open_port, mach_port_t reply_port,
+ mach_msg_type_name_t reply_port_type, dev_mode_t mode,
+ const_dev_name_t name, device_t *devp,
+ mach_msg_type_name_t *devicePoly)
+{
+ return ds_device_open (open_port, reply_port, reply_port_type, mode,
+ name, devp, devicePoly);
+}
+
+io_return_t
ds_device_close (struct mach_device *device)
{
/* Refuse if device is dead or not completely open. */