summaryrefslogtreecommitdiff
path: root/device/dev_lookup.c
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2007-03-27 22:47:11 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:07 +0200
commitd35703f70a6c0f89bcec1c97801532ab0d1b945f (patch)
treea7c20e38b9e65384a4637ca1d535d1c5cafb431d /device/dev_lookup.c
parent211fe231c99b8cf1aa3f91c97b1f00c73b857865 (diff)
2007-03-27 Thomas Schwinge <tschwinge@gnu.org>
Unconditionally use the device driver multiplexing. Suggested by Gianluca Guida <glguida@gmail.com>. * i386/i386at/dev_hdr.h: Merge into `device/dev_hdr.h' and remove. * i386/i386at/device_emul.h: Rename to `device/device_emul.h'. Adapt all users. * i386/i386at/i386at_ds_routines.c: Merge into `device/ds_routines.c' and remove. * i386/linux/dev/include/linux_emul.h: Remove file. * Makefrag.am (libkernel_a_SOURCES): Add `device/device_emul.h'. * i386/Makefrag.am (libkernel_a_SOURCES): Remove `i386/i386at/dev_hdr.h', `i386/i386at/device_emul.h' and `i386/i386at/i386at_ds_routines.c'. * i386/linux/Makefrag.am (liblinux_a_SOURCES): Remove `i386/linux/dev/include/linux_emul.h'. * dev/dev_hdr.h: Adapt all users of `i386' as if it were always defined. * device/dev_lookup.c: Likewise. * device/ds_routines.c: Likewise. * device/device_init.c (ds_init): Rename to `mach_device_init'. * device/ds_routines.c (ds_init): Likewise. (ds_trap_init): Rename to `mach_device_trap_init'. (mach_device_trap_init): Make it `static'. * linux/dev/glue/block.c: Don't include <linux_emul.h>, but instead include <device/device_emul.h> and <i386at/disk.h>. * linux/dev/glue/net.c: Don't include <linux_emul.h>, but instead include <device/device_emul.h>. * linux/pcmcia-cs/glue/ds.c: Likewise.
Diffstat (limited to 'device/dev_lookup.c')
-rw-r--r--device/dev_lookup.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/device/dev_lookup.c b/device/dev_lookup.c
index 3243a2c..2391e8d 100644
--- a/device/dev_lookup.c
+++ b/device/dev_lookup.c
@@ -42,9 +42,7 @@
#include <ipc/ipc_port.h>
#include <kern/ipc_kobject.h>
-#ifdef i386
-#include <i386at/device_emul.h>
-#endif
+#include <device/device_emul.h>
/*
* Device structure routines: reference counting, port->device.
@@ -255,7 +253,7 @@ dev_port_enter(device)
register mach_device_t device;
{
mach_device_reference(device);
-#ifdef i386
+
ipc_kobject_set(device->port,
(ipc_kobject_t) &device->dev, IKOT_DEVICE);
device->dev.emul_data = device;
@@ -264,9 +262,6 @@ dev_port_enter(device)
device->dev.emul_ops = &mach_device_emulation_ops;
}
-#else
- ipc_kobject_set(device->port, (ipc_kobject_t) device, IKOT_DEVICE);
-#endif
}
/*
@@ -296,12 +291,8 @@ dev_port_lookup(port)
ip_lock(port);
if (ip_active(port) && (ip_kotype(port) == IKOT_DEVICE)) {
device = (device_t) port->ip_kobject;
-#ifdef i386
if (device->emul_ops->reference)
(*device->emul_ops->reference)(device->emul_data);
-#else
- mach_device_reference(device);
-#endif
}
else
device = DEVICE_NULL;
@@ -318,26 +309,10 @@ ipc_port_t
convert_device_to_port(device)
register device_t device;
{
-#ifndef i386
- register ipc_port_t port;
-#endif
-
if (device == DEVICE_NULL)
return IP_NULL;
-#ifdef i386
return (*device->emul_ops->dev_to_port) (device->emul_data);
-#else
- device_lock(device);
- if (device->state == DEV_STATE_OPEN)
- port = ipc_port_make_send(device->port);
- else
- port = IP_NULL;
- device_unlock(device);
-
- mach_device_deallocate(device);
- return port;
-#endif
}
/*