summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-02-26 10:26:51 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-02-26 10:26:51 +0000
commit8d0fc7f86ec22bc4020c4f1643e518634aaa0eb1 (patch)
tree8cdcacfe0107fb6b6db56635e6c1825fcef325ea /sys/arch
parent77f5588c9bac2f2c38716c116568739dd3796884 (diff)
From NetBSD
Move the speaker to the 'new' config.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/conf/files.i3862
-rw-r--r--sys/arch/i386/i386/conf.c18
-rw-r--r--sys/arch/i386/isa/spkr.c34
3 files changed, 41 insertions, 13 deletions
diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386
index af553dd1c8d..3b0296e2646 100644
--- a/sys/arch/i386/conf/files.i386
+++ b/sys/arch/i386/conf/files.i386
@@ -106,7 +106,7 @@ major {fd = 2}
# PC speaker
device spkr at isa: tty
-file arch/i386/isa/spkr.c speaker needs-flag
+file arch/i386/isa/spkr.c spkr needs-flag
# AMD am7990 (Lance) -based boards
# (BICC Isolan, NE2100, DEPCA)
diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c
index 875e690282f..bae181a7131 100644
--- a/sys/arch/i386/i386/conf.c
+++ b/sys/arch/i386/i386/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.6 1996/02/21 12:53:46 mickey Exp $ */
+/* $OpenBSD: conf.c,v 1.7 1996/02/26 10:26:48 mickey Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -58,6 +58,8 @@ bdev_decl(wt);
bdev_decl(sd);
#include "st.h"
bdev_decl(st);
+#include "ss.h"
+cdev_decl(ss);
#include "cd.h"
bdev_decl(cd);
#include "mcd.h"
@@ -124,6 +126,14 @@ int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, seltrue, (dev_type_mmap((*))) enodev }
+/* open, close, read, ioctl */
+#define cdev_ss_init(c,n) { \
+ dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
+ (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
+ (dev_type_stop((*))) enodev, 0, seltrue, \
+ (dev_type_mmap((*))) enodev }
+
+
cdev_decl(cn);
cdev_decl(ctty);
#define mmread mmrw
@@ -161,7 +171,7 @@ dev_decl(fd,open);
cdev_decl(bpf);
#include "pcmciabus.h"
cdev_decl(pcmciabus);
-#include "speaker.h"
+#include "spkr.h"
cdev_decl(spkr);
#ifdef LKM
#define NLKM 1
@@ -218,7 +228,7 @@ struct cdevsw cdevsw[] =
cdev_lpt_init(NLPT,lpt), /* 16: parallel printer */
cdev_ch_init(NCH,ch), /* 17: SCSI autochanger */
cdev_disk_init(NCCD,ccd), /* 18: concatenated disk driver */
- cdev_notdef(), /* 19 */
+ cdev_ss_init(NSS,ss), /* 19: SCSI scanner */
cdev_notdef(), /* 20 */
cdev_notdef(), /* 21 */
cdev_fd_init(1,fd), /* 22: file descriptor pseudo-device */
@@ -226,7 +236,7 @@ struct cdevsw cdevsw[] =
cdev_notdef(), /* 24 */
cdev_joy_init(NJOY,joy), /* 25: Game adapter */
cdev_ocis_init(NPCMCIABUS,pcmciabus), /* 26: PCMCIA Bus */
- cdev_spkr_init(NSPEAKER,spkr), /* 27: PC speaker */
+ cdev_spkr_init(NSPKR,spkr), /* 27: PC speaker */
cdev_lkm_init(NLKM,lkm), /* 28: loadable module driver */
cdev_lkm_dummy(), /* 29 */
cdev_lkm_dummy(), /* 30 */
diff --git a/sys/arch/i386/isa/spkr.c b/sys/arch/i386/isa/spkr.c
index b2694ca1f37..fe0b8dab895 100644
--- a/sys/arch/i386/isa/spkr.c
+++ b/sys/arch/i386/isa/spkr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: spkr.c,v 1.17 1994/10/30 21:44:18 cgd Exp $ */
+/* $NetBSD: spkr.c,v 1.18 1996/02/22 05:53:28 scottr Exp $ */
/*
* spkr.c -- device driver for console speaker on 80386
@@ -9,12 +9,13 @@
* use hz value from param.c
*/
-#include "speaker.h"
-#if NSPEAKER > 0
+#include "spkr.h"
+#if NSPKR > 0
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/errno.h>
+#include <sys/device.h>
#include <sys/buf.h>
#include <sys/uio.h>
@@ -22,10 +23,21 @@
#include <machine/pio.h>
#include <machine/spkr.h>
-#include <i386/isa/isareg.h>
+#include <dev/isa/isareg.h>
#include <i386/isa/timerreg.h>
#include <i386/isa/spkrreg.h>
+int spkrprobe __P((struct device *, void *, void *));
+void spkrattach __P((struct device *, struct device *, void *));
+
+struct spkr_softc {
+ struct device sc_dev;
+};
+
+struct cfdriver spkrcd = {
+ NULL, "spkr", spkrprobe, spkrattach, DV_TTY, sizeof(struct spkr_softc)
+};
+
/**************** MACHINE DEPENDENT PART STARTS HERE *************************
*
* This section defines a function tone() which causes a tone of given
@@ -44,10 +56,6 @@
*/
#define PIT_MODE (TIMER_SEL2|TIMER_16BIT|TIMER_SQWAVE)
-void
-speakerattach()
-{
-}
static int endtone()
/* turn off the speaker, ending current tone */
@@ -402,6 +410,16 @@ size_t slen;
static int spkr_active; /* exclusion flag */
static struct buf *spkr_inbuf; /* incoming buf */
+int spkrprobe (struct device *parent, void *match, void *aux)
+{
+ return 1;
+}
+
+void spkrattach (struct device *parent, struct device *self, void *aux)
+{
+ printf("\n");
+}
+
int spkropen(dev)
dev_t dev;
{