summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_log.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-12-08 11:19:42 +0000
committerjulian <julian@FreeBSD.org>1995-12-08 11:19:42 +0000
commit1900eea896e2aaeae8a9fa8affa5fded2068c9b4 (patch)
tree5150d199464d64c1021f91b2c2f112d48546a8bf /sys/kern/subr_log.c
parentaaf9d7f10ecc63adae1dc4f55cfd31a2926c605a (diff)
downloadFreeBSD-src-1900eea896e2aaeae8a9fa8affa5fded2068c9b4.zip
FreeBSD-src-1900eea896e2aaeae8a9fa8affa5fded2068c9b4.tar.gz
Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are in the same file as their devsw structure. I've also added DEVFS support for nearly every device in the system, however many of the devices have 'incorrect' names under DEVFS because I couldn't quickly work out the correct naming conventions. (but devfs won't be coming on line for a month or so anyhow so that doesn't matter) If you "OWN" a device which would normally have an entry in /dev then search for the devfs_add_devsw() entries and munge to make them right.. check out similar devices to see what I might have done in them in you can't see what's going on.. for a laugh compare conf.c conf.h defore and after... :) I have not doen DEVFS entries for any DISKSLICE devices yet as that will be a much more complicated job.. (pass 5 :) pass 4 will be to make the devsw tables of type (cdevsw * ) rather than (cdevsw) seems to work here.. complaints to the usual places.. :)
Diffstat (limited to 'sys/kern/subr_log.c')
-rw-r--r--sys/kern/subr_log.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 04a2e6c..5b8a86f 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)subr_log.c 8.1 (Berkeley) 6/10/93
- * $Id: subr_log.c,v 1.12 1995/11/29 14:40:35 julian Exp $
+ * $Id: subr_log.c,v 1.13 1995/12/02 18:58:52 bde Exp $
*/
/*
@@ -47,21 +47,28 @@
#include <sys/msgbuf.h>
#include <sys/file.h>
#include <sys/signalvar.h>
-
-#ifdef JREMOD
-#include <sys/conf.h>
#include <sys/kernel.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /*DEVFS*/
-#define CDEV_MAJOR 7
-#endif /*JREMOD*/
#define LOG_RDPRI (PZERO + 1)
#define LOG_ASYNC 0x04
#define LOG_RDWAIT 0x08
+static d_open_t logopen;
+static d_close_t logclose;
+static d_read_t logread;
+static d_ioctl_t logioctl;
+static d_select_t logselect;
+
+#define CDEV_MAJOR 7
+struct cdevsw log_cdevsw =
+ { logopen, logclose, logread, nowrite, /*7*/
+ logioctl, nostop, nullreset, nodevtotty,/* klog */
+ logselect, nommap, NULL, "log", NULL, -1 };
+
struct logsoftc {
int sc_state; /* see above for possibilities */
struct selinfo sc_selp; /* process waiting on select call */
@@ -71,7 +78,7 @@ struct logsoftc {
int log_open; /* also used in log() */
/*ARGSUSED*/
-int
+static int
logopen(dev, flags, mode, p)
dev_t dev;
int flags, mode;
@@ -85,7 +92,7 @@ logopen(dev, flags, mode, p)
}
/*ARGSUSED*/
-int
+static int
logclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
@@ -98,7 +105,7 @@ logclose(dev, flag, mode, p)
}
/*ARGSUSED*/
-int
+static int
logread(dev, uio, flag)
dev_t dev;
struct uio *uio;
@@ -144,7 +151,7 @@ logread(dev, uio, flag)
}
/*ARGSUSED*/
-int
+static int
logselect(dev, rw, p)
dev_t dev;
int rw;
@@ -187,7 +194,7 @@ logwakeup()
}
/*ARGSUSED*/
-int
+static int
logioctl(dev, com, data, flag, p)
dev_t dev;
int com;
@@ -234,15 +241,11 @@ logioctl(dev, com, data, flag, p)
return (0);
}
-#ifdef JREMOD
-struct cdevsw log_cdevsw =
- { logopen, logclose, logread, nowrite, /*7*/
- logioctl, nostop, nullreset, nodevtotty,/* klog */
- logselect, nommap, NULL };
-
static log_devsw_installed = 0;
+static void *log_devfs_token;
-static void log_drvinit(void *unused)
+static void
+log_drvinit(void *unused)
{
dev_t dev;
@@ -251,18 +254,12 @@ static void log_drvinit(void *unused)
cdevsw_add(&dev,&log_cdevsw,NULL);
log_devsw_installed = 1;
#ifdef DEVFS
- {
- int x;
-/* default for a simple device with no probe routine (usually delete this) */
- x=devfs_add_devsw(
-/* path name devsw minor type uid gid perm*/
- "/", "log", major(dev), 0, DV_CHR, 0, 0, 0600);
- }
+ log_devfs_token = devfs_add_devsw(
+ "/", "log", &log_cdevsw, 0, DV_CHR, 0, 0, 0600);
#endif
}
}
SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,log_drvinit,NULL)
-#endif /* JREMOD */
OpenPOWER on IntegriCloud