summaryrefslogtreecommitdiffstats
path: root/sys/dev/speaker
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/dev/speaker
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/dev/speaker')
-rw-r--r--sys/dev/speaker/spkr.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 9d45e33..160c18b 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -4,7 +4,7 @@
* v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993
* modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su>
*
- * $Id: spkr.c,v 1.19 1995/11/29 10:47:57 julian Exp $
+ * $Id: spkr.c,v 1.20 1995/11/29 14:39:59 julian Exp $
*/
#include "speaker.h"
@@ -18,21 +18,29 @@
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/uio.h>
+#include <sys/conf.h>
#include <i386/isa/isa.h>
#include <i386/isa/timerreg.h>
#include <machine/clock.h>
#include <machine/speaker.h>
-#ifdef JREMOD
-#include <sys/conf.h>
-#define CDEV_MAJOR 26
-#endif /*JREMOD*/
#ifdef DEVFS
#include <sys/devfsext.h>
+void *devfs_token;
#endif
+static d_open_t spkropen;
+static d_close_t spkrclose;
+static d_write_t spkrwrite;
+static d_ioctl_t spkrioctl;
+
+#define CDEV_MAJOR 26
+struct cdevsw spkr_cdevsw =
+ { spkropen, spkrclose, noread, spkrwrite, /*26*/
+ spkrioctl, nostop, nullreset, nodevtotty,/* spkr */
+ seltrue, nommap, NULL, "spkr", NULL, -1 };
/**************** MACHINE DEPENDENT PART STARTS HERE *************************
*
@@ -569,11 +577,6 @@ struct proc *p;
return(EINVAL);
}
-#ifdef JREMOD
-struct cdevsw spkr_cdevsw =
- { spkropen, spkrclose, noread, spkrwrite, /*26*/
- spkrioctl, nostop, nullreset, nodevtotty,/* spkr */
- seltrue, nommap, NULL };
static spkr_devsw_installed = 0;
@@ -582,24 +585,19 @@ static void spkr_drvinit(void *unused)
dev_t dev;
if( ! spkr_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&spkr_cdevsw,NULL);
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev,&spkr_cdevsw, NULL);
spkr_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*/
- "/", "spkr", major(dev), 0, DV_CHR, 0, 0, 0600);
- }
+ devfs_token = devfs_add_devsw("/", "spkr",
+ &spkr_cdevsw, 0,
+ DV_CHR, 0, 0, 0600);
#endif
}
}
SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL)
-#endif /* JREMOD */
#endif /* NSPEAKER > 0 */
/* spkr.c ends here */
OpenPOWER on IntegriCloud