summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2011-09-09 03:40:24 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-09-12 21:43:22 +0200
commitec76bb9b04b851f403fac72fddaa8613025c7da4 (patch)
treeaddc5ba4589bf2cc07e78c2a19d6c476455e0b43
parentb509223167d6cf0780e1dd7ac9b2bde6bf6a2728 (diff)
Remove unused [!MACH_KERNEL] driver code
Use «unifdef -DMACK_KERNEL=1» as a starting point, but only remove the code not exposed on public headers, the rest is needed to build properly from userland. * device/cons.c [!MACH_KERNEL]: Remove includes. [!MACH_KERNEL] (constty): Remove variable. (cninit, cnmaygetc) [MACH_KERNEL]: Remove preprocessor conditionals. [!MACH_KERNEL] (cnopen, cnclose, cnread, cnwrite, cnioctl, cnselect) (cncontrol): Remove functions. * device/cons.h (struct consdev) [MACH_KERNEL]: Remove preprocessor conditional. * device/kmsg.h [MACH_KERNEL]: Likewise. * i386/i386at/autoconf.c [!MACH_KERNEL]: Remove includes. * i386/i386at/kd_event.c [!MACH_KERNEL]: Likewise. [!MACH_KERNEL] (kbd_sel, kbdpgrp, kbdflag): Remove variables. [!MACH_KERNEL] (KBD_COLL, KBD_ASYNC, KBD_NBIO): Remove macros. (kbdopen, kbdclose, kbd_enqueue) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (kbdioctl, kbdselect, kbdread): Remove functions. [!MACH_KERNEL] (X_kdb_enter_init, X_kdb_exit_init: Likewise. * i386/i386at/kd_mouse.c [!MACH_KERNEL]: Remove includes. [!MACH_KERNEL] (mouse_sel, mousepgrp, mouseflag): Remove variables. [!MACH_KERNEL] (MOUSE_COLL, MOUSE_ASYNC, MOUSE_NBIO): Remove macros. (mouseopen, mouseclose, kd_mouse_read, mouse_enqueue) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (mouseioctl, mouseselect, mouseread): Remove functions. * i386/i386at/lpr.c [!MACH_KERNEL]: Remove includes. (lpropen) [MACH_KERNEL]: Remove preprocessor conditionals. (lpropen, lprclose, lprstart) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (lprwrite, lprioctl, lprstop): Remove functions. * i386/i386at/rtc.c (readtodc, writetodc) [!MACH_KERNEL]: Remove code. * kern/mach_factor.c [MACH_KERNEL]: Remove preprocessor conditional. * xen/time.c (readtodc) [!MACH_KERNEL]: Remove code.
-rw-r--r--device/cons.c109
-rw-r--r--device/cons.h2
-rw-r--r--device/kmsg.h2
-rw-r--r--i386/i386at/autoconf.c9
-rw-r--r--i386/i386at/kd_event.c192
-rw-r--r--i386/i386at/kd_mouse.c160
-rw-r--r--i386/i386at/lpr.c110
-rw-r--r--i386/i386at/rtc.c24
-rw-r--r--kern/mach_factor.c2
-rw-r--r--xen/time.c5
10 files changed, 1 insertions, 614 deletions
diff --git a/device/cons.c b/device/cons.c
index e3e95ff..f26f22c 100644
--- a/device/cons.c
+++ b/device/cons.c
@@ -22,22 +22,10 @@
#include <string.h>
#include <kern/debug.h>
-#ifdef MACH_KERNEL
#include <sys/types.h>
#include <device/conf.h>
#include <mach/boolean.h>
#include <device/cons.h>
-#else
-#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/systm.h>
-#include <sys/buf.h>
-#include <sys/ioctl.h>
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/conf.h>
-#include <hpdev/cons.h>
-#endif
#ifdef MACH_KMSG
#include <device/io_req.h>
@@ -46,9 +34,6 @@
static int cn_inited = 0;
static struct consdev *cn_tab = 0; /* physical console device info */
-#ifndef MACH_KERNEL
-static struct tty *constty = 0; /* virtual console output device */
-#endif
/*
* ROM getc/putc primitives.
@@ -76,10 +61,8 @@ void
cninit()
{
struct consdev *cp;
-#ifdef MACH_KERNEL
dev_ops_t cn_ops;
int x;
-#endif
if (cn_inited)
return;
@@ -103,7 +86,6 @@ cninit()
* Initialize as console
*/
(*cp->cn_init)(cp);
-#ifdef MACH_KERNEL
/*
* Look up its dev_ops pointer in the device table and
* place it in the device indirection table.
@@ -111,7 +93,6 @@ cninit()
if (dev_name_lookup(cp->cn_name, &cn_ops, &x) == FALSE)
panic("cninit: dev_name_lookup failed");
dev_set_indirection("console", cn_ops, minor(cp->cn_dev));
-#endif
#if CONSBUFSIZE > 0
/*
* Now that the console is initialized, dump any chars in
@@ -134,97 +115,9 @@ cninit()
/*
* No console device found, not a problem for BSD, fatal for Mach
*/
-#ifdef MACH_KERNEL
panic("can't find a console device");
-#endif
}
-#ifndef MACH_KERNEL
-cnopen(dev, flag)
- dev_t dev;
-{
- if (cn_tab == NULL)
- return(0);
- dev = cn_tab->cn_dev;
- return ((*cdevsw[major(dev)].d_open)(dev, flag));
-}
-
-cnclose(dev, flag)
- dev_t dev;
-{
- if (cn_tab == NULL)
- return(0);
- dev = cn_tab->cn_dev;
- return ((*cdevsw[major(dev)].d_close)(dev, flag));
-}
-
-cnread(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- if (cn_tab == NULL)
- return(0);
- dev = cn_tab->cn_dev;
- return ((*cdevsw[major(dev)].d_read)(dev, uio));
-}
-
-cnwrite(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- if (cn_tab == NULL)
- return(0);
- dev = cn_tab->cn_dev;
- return ((*cdevsw[major(dev)].d_write)(dev, uio));
-}
-
-cnioctl(dev, cmd, data, flag)
- dev_t dev;
- caddr_t data;
-{
- if (cn_tab == NULL)
- return(0);
- /*
- * Superuser can always use this to wrest control of console
- * output from the "virtual" console.
- */
- if (cmd == TIOCCONS && constty) {
- if (!suser())
- return(EPERM);
- constty = NULL;
- return(0);
- }
- dev = cn_tab->cn_dev;
- return ((*cdevsw[major(dev)].d_ioctl)(dev, cmd, data, flag));
-}
-
-cnselect(dev, rw)
- dev_t dev;
- int rw;
-{
- if (cn_tab == NULL)
- return(1);
- return(ttselect(cn_tab->cn_dev, rw));
-}
-
-#ifndef hp300
-/*
- * XXX Should go away when the new CIO MUX driver is in place
- */
-#define d_control d_mmap
-cncontrol(dev, cmd, data)
- dev_t dev;
- int cmd;
- int data;
-{
- if (cn_tab == NULL)
- return(0);
- dev = cn_tab->cn_dev;
- return((*cdevsw[major(dev)].d_control)(dev, cmd, data));
-}
-#undef d_control
-#endif
-#endif
int
cngetc()
@@ -236,7 +129,6 @@ cngetc()
return (0);
}
-#ifdef MACH_KERNEL
int
cnmaygetc()
{
@@ -246,7 +138,6 @@ cnmaygetc()
return ((*romgetc)(0));
return (0);
}
-#endif
void
cnputc(c)
diff --git a/device/cons.h b/device/cons.h
index c210f8c..6a0ae85 100644
--- a/device/cons.h
+++ b/device/cons.h
@@ -26,9 +26,7 @@
#include <sys/types.h>
struct consdev {
-#ifdef MACH_KERNEL
char *cn_name; /* name of device in dev_name_list */
-#endif
int (*cn_probe)(struct consdev *cp); /* probe hardware and fill in consdev info */
int (*cn_init)(struct consdev *cp); /* turn on as console */
int (*cn_getc)(dev_t dev, int wait); /* kernel getchar interface */
diff --git a/device/kmsg.h b/device/kmsg.h
index adfc945..b8c1f36 100644
--- a/device/kmsg.h
+++ b/device/kmsg.h
@@ -1,7 +1,6 @@
#ifndef _DEVICE_KMSG_H_
#define _DEVICE_KMSG_H_ 1
-#ifdef MACH_KERNEL
#include <sys/types.h>
@@ -15,6 +14,5 @@ io_return_t kmsggetstat (dev_t dev, int flavor,
int *data, unsigned int *count);
void kmsg_putchar (int c);
-#endif /* MACH_KERNEL */
#endif /* !_DEVICE_KMSG_H_ */
diff --git a/i386/i386at/autoconf.c b/i386/i386at/autoconf.c
index 7713dec..d1f2863 100644
--- a/i386/i386at/autoconf.c
+++ b/i386/i386at/autoconf.c
@@ -25,16 +25,7 @@
*/
#include <kern/printf.h>
-#ifdef MACH_KERNEL
#include <mach/std_types.h>
-#else /* MACH_KERNEL */
-#include <cpus.h>
-#include <platforms.h>
-#include <generic.h>
-#include <sys/param.h>
-#include <mach/machine.h>
-#include <machine/cpu.h>
-#endif /* MACH_KERNEL */
#include <i386/pic.h>
#include <i386/ipl.h>
#include <chips/busses.h>
diff --git a/i386/i386at/kd_event.c b/i386/i386at/kd_event.c
index 8ea313b..4d2ea00 100644
--- a/i386/i386at/kd_event.c
+++ b/i386/i386at/kd_event.c
@@ -59,20 +59,9 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <kern/printf.h>
#include <string.h>
-#ifdef MACH_KERNEL
#include <device/ds_routines.h>
#include <device/device_types.h>
#include <device/io_req.h>
-#else /* MACH_KERNEL */
-#include <sys/file.h>
-#include <sys/errno.h>
-#include <kern/thread.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/tty.h>
-#endif /* MACH_KERNEL */
#include <i386/machspl.h>
#include <i386/pio.h>
#include <i386at/kd.h>
@@ -92,24 +81,12 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
kd_event_queue kbd_queue; /* queue of keyboard events */
-#ifdef MACH_KERNEL
queue_head_t kbd_read_queue = { &kbd_read_queue, &kbd_read_queue };
-#else /* MACH_KERNEL */
-struct proc *kbd_sel = 0; /* selecting process, if any */
-short kbdpgrp = 0; /* process group leader when dev is open */
-
-int kbdflag = 0;
-#define KBD_COLL 1 /* select collision */
-#define KBD_ASYNC 2 /* user wants asynch notification */
-#define KBD_NBIO 4 /* user wants non-blocking I/O */
-#endif /* MACH_KERNEL */
void kbd_enqueue();
-#ifdef MACH_KERNEL
io_return_t X_kdb_enter_init();
io_return_t X_kdb_exit_init();
-#endif /* MACH_KERNEL */
static boolean_t initialized = FALSE;
@@ -147,14 +124,6 @@ kbdopen(dev, flags)
splx(o_pri);
kbdinit();
-#ifdef MACH_KERNEL
-#else /* MACH_KERNEL */
- if (flags & FWRITE)
- return(ENODEV);
-
- if (kbdpgrp == 0)
- kbdpgrp = u.u_procp->p_pgrp;
-#endif /* MACH_KERNEL */
return(0);
}
@@ -173,18 +142,11 @@ kbdclose(dev, flags)
spl_t s = SPLKD();
kb_mode = KB_ASCII;
-#ifdef MACH_KERNEL
-#else /* MACH_KERNEL */
- kbdpgrp = 0;
- kbdflag = 0;
- kbd_sel = 0;
-#endif /* MACH_KERNEL */
kdq_reset(&kbd_queue);
splx(s);
}
-#ifdef MACH_KERNEL
io_return_t kbdgetstat(dev, flavor, data, count)
dev_t dev;
int flavor;
@@ -234,91 +196,12 @@ io_return_t kbdsetstat(dev, flavor, data, count)
return (D_SUCCESS);
}
-#else /* MACH_KERNEL */
-/*
- * kbdioctl - handling for asynch & non-blocking I/O.
- */
-
-/*ARGSUSED*/
-int
-kbdioctl(dev, cmd, data, flag)
- dev_t dev;
- int cmd;
- caddr_t data;
- int flag;
-{
- spl_t s = SPLKD();
- int err = 0;
-
- switch (cmd) {
- case KDSKBDMODE:
- kb_mode = *(int *)data;
- /* XXX - what to do about unread events? */
- /* XXX - should check that "data" contains an OK value */
- break;
- case KDGKBDTYPE:
- *(int *)data = KB_VANILLAKB;
- break;
- case K_X_KDB_ENTER:
- X_kdb_enter_init((struct X_kdb *) data);
- break;
- case K_X_KDB_EXIT:
- X_kdb_exit_init( (struct X_kdb *) data);
- break;
- case FIONBIO:
- if (*(int *)data)
- kbdflag |= KBD_NBIO;
- else
- kbdflag &= ~KBD_NBIO;
- break;
- case FIOASYNC:
- if (*(int *)data)
- kbdflag |= KBD_ASYNC;
- else
- kbdflag &= ~KBD_ASYNC;
- break;
- default:
- err = ENOTTY;
- break;
- }
-
- splx(s);
- return(err);
-}
-
-
-/*
- * kbdselect
- */
-
-/*ARGSUSED*/
-int
-kbdselect(dev, rw)
-{
- spl_t s = SPLKD();
-
- if (!kdq_empty(&kbd_queue)) {
- splx(s);
- return(1);
- }
-
- if (kbd_sel)
- kbdflag |= KBD_COLL;
- else
- kbd_sel = (struct proc *)current_thread();
- /* eeeyuck */
-
- splx(s);
- return(0);
-}
-#endif /* MACH_KERNEL */
/*
* kbdread - dequeue and return any queued events.
*/
-#ifdef MACH_KERNEL
boolean_t kbd_read_done(); /* forward */
int
@@ -391,44 +274,6 @@ boolean_t kbd_read_done(ior)
return (TRUE);
}
-#else /* MACH_KERNEL */
-/*ARGSUSED*/
-kbdread(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- int s = SPLKD();
- int err = 0;
- kd_event *ev;
- int i;
- char *cp;
-
- if (kdq_empty(&kbd_queue))
- if (kbdflag & KBD_NBIO) {
- err = EWOULDBLOCK;
- goto done;
- } else
- while (kdq_empty(&kbd_queue)) {
- splx(s);
- sleep((caddr_t)&kbd_queue, TTIPRI);
- s = SPLKD();
- }
-
- while (!kdq_empty(&kbd_queue) && uio->uio_resid >= sizeof(kd_event)) {
- ev = kdq_get(&kbd_queue);
- for (cp = (char *)ev, i = 0; i < sizeof(kd_event);
- ++i, ++cp) {
- err = ureadc(*cp, uio);
- if (err)
- goto done;
- }
- }
-
-done:
- splx(s);
- return(err);
-}
-#endif /* MACH_KERNEL */
/*
@@ -462,22 +307,11 @@ kbd_enqueue(ev)
else
kdq_put(&kbd_queue, ev);
-#ifdef MACH_KERNEL
{
register io_req_t ior;
while ((ior = (io_req_t)dequeue_head(&kbd_read_queue)) != 0)
iodone(ior);
}
-#else /* MACH_KERNEL */
- if (kbd_sel) {
- selwakeup(kbd_sel, kbdflag & KBD_COLL);
- kbd_sel = 0;
- kbdflag &= ~KBD_COLL;
- }
- if (kbdflag & KBD_ASYNC)
- gsignal(kbdpgrp, SIGIO);
- wakeup((caddr_t)&kbd_queue);
-#endif /* MACH_KERNEL */
}
u_int X_kdb_enter_str[512], X_kdb_exit_str[512];
@@ -538,7 +372,6 @@ register u_int *u_ip, *endp;
kdb_in_out(u_ip);
}
-#ifdef MACH_KERNEL
io_return_t
X_kdb_enter_init(data, count)
u_int *data;
@@ -564,28 +397,3 @@ X_kdb_exit_init(data, count)
X_kdb_exit_len = count;
return D_SUCCESS;
}
-#else /* MACH_KERNEL */
-void
-X_kdb_enter_init(kp)
-struct X_kdb *kp;
-{
- if (kp->size > sizeof X_kdb_enter_str)
- u.u_error = ENOENT;
- else if(copyin(kp->ptr, X_kdb_enter_str, kp->size) == EFAULT)
- u.u_error = EFAULT;
-
- X_kdb_enter_len = kp->size>>2;
-}
-
-void
-X_kdb_exit_init(kp)
-struct X_kdb *kp;
-{
- if (kp->size > sizeof X_kdb_exit_str)
- u.u_error = ENOENT;
- else if(copyin(kp->ptr, X_kdb_exit_str, kp->size) == EFAULT)
- u.u_error = EFAULT;
-
- X_kdb_exit_len = kp->size>>2;
-}
-#endif /* MACH_KERNEL */
diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c
index 770a3fe..6e7b68a 100644
--- a/i386/i386at/kd_mouse.c
+++ b/i386/i386at/kd_mouse.c
@@ -67,21 +67,10 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <mach/boolean.h>
#include <sys/types.h>
#include <kern/printf.h>
-#ifdef MACH_KERNEL
#include <device/ds_routines.h>
#include <device/device_types.h>
#include <device/io_req.h>
#include <device/subrs.h>
-#else /* MACH_KERNEL */
-#include <sys/file.h>
-#include <sys/errno.h>
-#include <kern/thread.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/tty.h>
-#endif /* MACH_KERNEL */
#include <i386/ipl.h>
#include <i386/pic.h>
#include <i386/pio.h>
@@ -100,20 +89,8 @@ extern struct bus_device *cominfo[];
kd_event_queue mouse_queue; /* queue of mouse events */
boolean_t mouse_in_use = FALSE;
-#ifdef MACH_KERNEL
queue_head_t mouse_read_queue = { &mouse_read_queue, &mouse_read_queue };
-#else /* MACH_KERNEL */
-struct proc *mouse_sel = 0; /* selecting process, if any */
-short mousepgrp = 0; /* process group leader when dev is open */
-#endif /* MACH_KERNEL */
-
-#ifdef MACH_KERNEL
-#else /* MACH_KERNEL */
-int mouseflag = 0;
-#define MOUSE_COLL 1 /* select collision */
-#define MOUSE_ASYNC 2 /* user wants asynch notification */
-#define MOUSE_NBIO 4 /* user wants non-blocking I/O */
-#endif /* MACH_KERNEL */
+
/*
* The state of the 3 buttons is encoded in the low-order 3 bits (both
@@ -176,20 +153,11 @@ mouseopen(dev, flags)
dev_t dev;
int flags;
{
-#ifdef MACH_KERNEL
-#else /* MACH_KERNEL */
- if (flags & FWRITE)
- return (D_NO_SUCH_DEVICE);
-#endif /* MACH_KERNEL */
if (mouse_in_use)
return (D_ALREADY_OPEN);
mouse_in_use = TRUE; /* locking? */
kdq_reset(&mouse_queue);
lastbuttons = MOUSE_ALL_UP;
-#ifdef MACH_KERNEL
-#else /* MACH_KERNEL */
- mousepgrp = u.u_procp->p_pgrp;
-#endif /* MACH_KERNEL */
switch (mouse_type = ((minor(dev) & 0xf8) >> 3)) {
case MICROSOFT_MOUSE7:
@@ -294,12 +262,6 @@ mouseclose(dev, flags)
kdq_reset(&mouse_queue); /* paranoia */
mouse_in_use = FALSE;
-#ifdef MACH_KERNEL
-#else /* MACH_KERNEL */
- mousepgrp = 0;
- mouseflag = 0;
- mouse_sel = 0;
-#endif /* MACH_KERNEL */
}
/*ARGSUSED*/
@@ -335,7 +297,6 @@ kd_mouse_close(dev, mouse_pic)
splx(s);
}
-#ifdef MACH_KERNEL
io_return_t mousegetstat(dev, flavor, data, count)
dev_t dev;
int flavor;
@@ -354,75 +315,10 @@ io_return_t mousegetstat(dev, flavor, data, count)
return D_SUCCESS;
}
-#else /* MACH_KERNEL */
-/*
- * mouseioctl - handling for asynch & non-blocking I/O.
- */
-
-/*ARGSUSED*/
-int
-mouseioctl(dev, cmd, data, flag)
- dev_t dev;
- int cmd;
- caddr_t data;
- int flag;
-{
- int s = SPLKD();
- int err = 0;
-
- switch (cmd) {
- case FIONBIO:
- if (*(int *)data)
- mouseflag |= MOUSE_NBIO;
- else
- mouseflag &= ~MOUSE_NBIO;
- break;
- case FIOASYNC:
- if (*(int *)data)
- mouseflag |= MOUSE_ASYNC;
- else
- mouseflag &= ~MOUSE_ASYNC;
- break;
- default:
- err = ENOTTY;
- break;
- }
-
- splx(s);
- return(err);
-}
-
-
-/*
- * mouseselect - check for pending events, etc.
- */
-
-/*ARGSUSED*/
-int
-mouseselect(dev, rw)
-{
- int s = SPLKD();
-
- if (!kdq_empty(&mouse_queue)) {
- splx(s);
- return(1);
- }
-
- if (mouse_sel)
- mouseflag |= MOUSE_COLL;
- else
- mouse_sel = (struct proc *)current_thread();
- /* eeeyuck */
-
- splx(s);
- return(0);
-}
-#endif /* MACH_KERNEL */
/*
* mouseread - dequeue and return any queued events.
*/
-#ifdef MACH_KERNEL
boolean_t mouse_read_done(); /* forward */
int
@@ -495,45 +391,6 @@ boolean_t mouse_read_done(ior)
return (TRUE);
}
-#else /* MACH_KERNEL */
-/*ARGSUSED*/
-int
-mouseread(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- int s = SPLKD();
- int err = 0;
- kd_event *ev;
- int i;
- char *cp;
-
- if (kdq_empty(&mouse_queue))
- if (mouseflag & MOUSE_NBIO) {
- err = EWOULDBLOCK;
- goto done;
- } else
- while (kdq_empty(&mouse_queue)) {
- splx(s);
- sleep((caddr_t)&mouse_queue, TTIPRI);
- s = SPLKD();
- }
-
- while (!kdq_empty(&mouse_queue) && uio->uio_resid >= sizeof(kd_event)) {
- ev = kdq_get(&mouse_queue);
- for (cp = (char *)ev, i = 0; i < sizeof(kd_event);
- ++i, ++cp) {
- err = ureadc(*cp, uio);
- if (err)
- goto done;
- }
- }
-
-done:
- splx(s);
- return(err);
-}
-#endif /* MACH_KERNEL */
/*
@@ -780,12 +637,8 @@ int kd_mouse_read(void)
while (mousebufindex <= mouse_char_index) {
mouse_char_wanted = TRUE;
-#ifdef MACH_KERNEL
assert_wait((event_t) &mousebuf, FALSE);
thread_block((void (*)()) 0);
-#else /* MACH_KERNEL */
- sleep(&mousebuf, PZERO);
-#endif /* MACH_KERNEL */
}
ch = mousebuf[mouse_char_index++];
@@ -955,20 +808,9 @@ mouse_enqueue(ev)
else
kdq_put(&mouse_queue, ev);
-#ifdef MACH_KERNEL
{
register io_req_t ior;
while ((ior = (io_req_t)dequeue_head(&mouse_read_queue)) != 0)
iodone(ior);
}
-#else /* MACH_KERNEL */
- if (mouse_sel) {
- selwakeup(mouse_sel, mouseflag & MOUSE_COLL);
- mouse_sel = 0;
- mouseflag &= ~MOUSE_COLL;
- }
- if (mouseflag & MOUSE_ASYNC)
- gsignal(mousepgrp, SIGIO);
- wakeup((caddr_t)&mouse_queue);
-#endif /* MACH_KERNEL */
}
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index cf76da2..468608c 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -30,7 +30,6 @@
#if NLPR > 0
-#ifdef MACH_KERNEL
#include <mach/std_types.h>
#include <sys/types.h>
#include <kern/printf.h>
@@ -40,18 +39,6 @@
#include <device/device_types.h>
#include <device/tty.h>
#include <device/io_req.h>
-#else /* MACH_KERNEL */
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
-#include <sys/tty.h>
-#include <sys/systm.h>
-#include <sys/uio.h>
-#include <sys/file.h>
-#endif /* MACH_KERNEL */
#include <i386/ipl.h>
#include <i386/pio.h>
@@ -68,9 +55,7 @@ int lprprobe();
void lprstop();
void lprintr(), lprstart();
void lprattach(struct bus_device *);
-#ifdef MACH_KERNEL
int lprgetstat(), lprsetstat();
-#endif /* MACH_KERNEL */
void lprpr_addr();
struct bus_device *lprinfo[NLPR]; /* ??? */
@@ -130,9 +115,7 @@ int
lpropen(dev, flag, ior)
int dev;
int flag;
-#ifdef MACH_KERNEL
io_req_t ior;
-#endif /* MACH_KERNEL */
{
int unit = minor(dev);
struct bus_device *isai;
@@ -142,20 +125,14 @@ u_short addr;
if (unit >= NLPR || (isai = lprinfo[unit]) == 0 || isai->alive == 0)
return (D_NO_SUCH_DEVICE);
tp = &lpr_tty[unit];
-#ifndef MACH_KERNEL
- if (tp->t_state & TS_XCLUDE && u.u_uid != 0)
- return (D_ALREADY_OPEN);
-#endif /* MACH_KERNEL */
addr = (u_short) isai->address;
tp->t_dev = dev;
tp->t_addr = *(caddr_t *)&addr;
tp->t_oproc = lprstart;
tp->t_state |= TS_WOPEN;
-#ifdef MACH_KERNEL
tp->t_stop = lprstop;
tp->t_getstat = lprgetstat;
tp->t_setstat = lprsetstat;
-#endif /* MACH_KERNEL */
if ((tp->t_state & TS_ISOPEN) == 0)
ttychars(tp);
outb(INTR_ENAB(addr), inb(INTR_ENAB(addr)) | 0x10);
@@ -172,9 +149,6 @@ int unit = minor(dev);
struct tty *tp = &lpr_tty[unit];
u_short addr = (u_short) lprinfo[unit]->address;
-#ifndef MACH_KERNEL
- (*linesw[tp->t_line].l_close)(tp);
-#endif /* MACH_KERNEL */
ttyclose(tp);
if (tp->t_state&TS_HUPCLS || (tp->t_state&TS_ISOPEN)==0) {
outb(INTR_ENAB(addr), inb(INTR_ENAB(addr)) & 0x0f);
@@ -182,7 +156,6 @@ u_short addr = (u_short) lprinfo[unit]->address;
}
}
-#ifdef MACH_KERNEL
int
lprread(dev, ior)
int dev;
@@ -244,43 +217,6 @@ unsigned int count;
}
return (D_SUCCESS);
}
-#else /* MACH_KERNEL */
-int lprwrite(dev, uio)
- int dev;
- struct uio *uio;
-{
- struct tty *tp= &lpr_tty[minor(dev)];
-
- return ((*linesw[tp->t_line].l_write)(tp, uio));
-}
-
-int lprioctl(dev, cmd, addr, mode)
- int dev;
- int cmd;
- caddr_t addr;
- int mode;
-{
- int error;
- spl_t s;
- int unit = minor(dev);
- struct tty *tp = &lpr_tty[unit];
-
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr,mode);
- if (error >= 0)
- return(error);
- error = ttioctl(tp, cmd, addr,mode);
- if (error >= 0)
- return (error);
- s = spltty();
- switch (cmd) {
- default:
- splx(s);
- return(ENOTTY);
- }
- splx(s);
- return(0);
-}
-#endif /* MACH_KERNEL */
void lprintr(unit)
int unit;
@@ -317,25 +253,12 @@ struct tty *tp;
}
if (tp->t_outq.c_cc <= TTLOWAT(tp)) {
-#ifdef MACH_KERNEL
tt_write_wakeup(tp);
-#else /* MACH_KERNEL */
- if (tp->t_state & TS_ASLEEP) {
- tp->t_state &= ~TS_ASLEEP;
- wakeup ((caddr_t)&tp->t_outq);
- }
- if (tp->t_wsel) {
- selwakeup(tp->t_wsel, tp->t_state & TS_WCOLL);
- tp->t_wsel = 0;
- tp->t_state &= ~TS_WCOLL;
- }
-#endif /* MACH_KERNEL */
}
if (tp->t_outq.c_cc == 0) {
splx(s);
return;
}
-#ifdef MACH_KERNEL
nch = getc(&tp->t_outq);
if ((tp->t_flags & LITOUT) == 0 && (nch & 0200)) {
timeout((timer_func_t *)ttrstrt, (char *)tp, (nch & 0x7f) + 6);
@@ -346,32 +269,10 @@ struct tty *tp;
outb(INTR_ENAB(addr),inb(INTR_ENAB(addr)) | 0x01);
outb(INTR_ENAB(addr),inb(INTR_ENAB(addr)) & 0x1e);
tp->t_state |= TS_BUSY;
-#else /* MACH_KERNEL */
- if (tp->t_flags & (RAW|LITOUT))
- nch = ndqb(&tp->t_outq,0);
- else {
- nch = ndqb(&tp->t_outq, 0200);
- if (nch == 0) {
- nch = getc(&tp->t_outq);
- timeout(ttrstrt,(caddr_t)tp,(nch&0x7f)+6);
- tp->t_state |= TS_TIMEOUT;
- splx(s);
- return(0);
- }
- }
- if (nch) {
- nch=getc(&tp->t_outq);
- outb(DATA(addr), nch);
- outb(INTR_ENAB(addr),inb(INTR_ENAB(addr)) | 0x01);
- outb(INTR_ENAB(addr),inb(INTR_ENAB(addr)) & 0x1e);
- tp->t_state |= TS_BUSY;
- }
-#endif /* MACH_KERNEL */
splx(s);
return;
}
-#ifdef MACH_KERNEL
void
lprstop(tp, flags)
register struct tty *tp;
@@ -380,17 +281,6 @@ int flags;
if ((tp->t_state & TS_BUSY) && (tp->t_state & TS_TTSTOP) == 0)
tp->t_state |= TS_FLUSH;
}
-#else /* MACH_KERNEL */
-void lprstop(tp, flag)
-struct tty *tp;
-{
- int s = spltty();
-
- if ((tp->t_state&TS_BUSY) && (!(tp->t_state&TS_TTSTOP)))
- tp->t_state |= TS_FLUSH;
- splx(s);
-}
-#endif /* MACH_KERNEL */
int
lprpr(unit)
{
diff --git a/i386/i386at/rtc.c b/i386/i386at/rtc.c
index 77a83e8..6776801 100644
--- a/i386/i386at/rtc.c
+++ b/i386/i386at/rtc.c
@@ -138,11 +138,7 @@ readtodc(tp)
int i, days = 0;
spl_t ospl;
-#ifdef MACH_KERNEL
ospl = splclock();
-#else /* MACH_KERNEL */
- ospl = spl5();
-#endif /* MACH_KERNEL */
if (rtcget(&rtclk)) {
splx(ospl);
return(-1);
@@ -169,12 +165,6 @@ readtodc(tp)
days += yeartoday(i);
n += days * 3600 * 24;
-#ifdef MACH_KERNEL
-#else /* MACH_KERNEL */
- n += tz.tz_minuteswest * 60;
- if (tz.tz_dsttime)
- n -= 3600;
-#endif /* MACH_KERNEL */
*tp = n;
@@ -189,24 +179,14 @@ writetodc()
int diff, i, j;
spl_t ospl;
-#ifdef MACH_KERNEL
ospl = splclock();
-#else /* MACH_KERNEL */
- ospl = spl5();
-#endif /* MACH_KERNEL */
if (rtcget(&rtclk)) {
splx(ospl);
return(-1);
}
splx(ospl);
-#ifdef MACH_KERNEL
diff = 0;
-#else /* MACH_KERNEL */
- diff = tz.tz_minuteswest * 60;
- if (tz.tz_dsttime)
- diff -= 3600;
-#endif /* MACH_KERNEL */
n = (time.tv_sec - diff) % (3600 * 24); /* hrs+mins+secs */
rtclk.rtc_sec = dectohexdec(n%60);
n /= 60;
@@ -230,11 +210,7 @@ writetodc()
rtclk.rtc_dom = dectohexdec(++n);
-#ifdef MACH_KERNEL
ospl = splclock();
-#else /* MACH_KERNEL */
- ospl = spl5();
-#endif /* MACH_KERNEL */
rtcput(&rtclk);
splx(ospl);
diff --git a/kern/mach_factor.c b/kern/mach_factor.c
index 6fbda83..558c4a0 100644
--- a/kern/mach_factor.c
+++ b/kern/mach_factor.c
@@ -36,10 +36,8 @@
#include <kern/mach_clock.h>
#include <kern/sched.h>
#include <kern/processor.h>
-#if MACH_KERNEL
#include <mach/kern_return.h>
#include <mach/port.h>
-#endif /* MACH_KERNEL */
#include "mach_factor.h"
diff --git a/xen/time.c b/xen/time.c
index 5cddd8f..a11e7eb 100644
--- a/xen/time.c
+++ b/xen/time.c
@@ -116,11 +116,6 @@ readtodc(tp)
unsigned64_t t = hyp_get_time();
u_int n = t / 1000000000;
-#ifndef MACH_KERNEL
- n += tz.tz_minuteswest * 60;
- if (tz.tz_dsttime)
- n -= 3600;
-#endif /* MACH_KERNEL */
*tp = n;
return(0);