Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Create a single combined module for spkr_pcppi and spkr_...
details: https://anonhg.NetBSD.org/src/rev/83f513cad318
branches: trunk
changeset: 349576:83f513cad318
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Dec 15 06:48:14 2016 +0000
description:
Create a single combined module for spkr_pcppi and spkr_audio, and
build it for all architectures.
By doing this, we can handle pcppi, audio, or both attachments with
non-built-in modules.
XXX Still to do: the module currently cannot be unloaded, and the
XXX spkr device(s) currently cannot be detached. (Really, two
XXX sides of the same problem.)
diffstat:
sys/dev/isa/spkr_pcppi.c | 13 ++-----------
sys/dev/spkr_audio.c | 13 ++-----------
sys/dev/spkrvar.h | 3 +--
sys/modules/Makefile | 4 ++--
sys/modules/spkr/Makefile | 5 ++++-
sys/modules/spkr/spkr.ioconf | 6 ++++--
6 files changed, 15 insertions(+), 29 deletions(-)
diffs (161 lines):
diff -r dde9f2eced0f -r 83f513cad318 sys/dev/isa/spkr_pcppi.c
--- a/sys/dev/isa/spkr_pcppi.c Thu Dec 15 04:49:15 2016 +0000
+++ b/sys/dev/isa/spkr_pcppi.c Thu Dec 15 06:48:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spkr_pcppi.c,v 1.7 2016/12/14 22:30:42 christos Exp $ */
+/* $NetBSD: spkr_pcppi.c,v 1.8 2016/12/15 06:48:14 pgoyette Exp $ */
/*
* Copyright (c) 1990 Eric S. Raymond (esr%snark.thyrsus.com@localhost)
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spkr_pcppi.c,v 1.7 2016/12/14 22:30:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spkr_pcppi.c,v 1.8 2016/12/15 06:48:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -51,7 +51,6 @@
#include <sys/errno.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#include <sys/module.h>
#include <sys/uio.h>
#include <sys/proc.h>
#include <sys/ioctl.h>
@@ -76,14 +75,6 @@
CFATTACH_DECL_NEW(spkr_pcppi, sizeof(struct spkr_pcppi_softc),
spkr_pcppi_probe, spkr_pcppi_attach, spkr_pcppi_detach, NULL);
-MODULE(MODULE_CLASS_DRIVER, spkr, NULL /* "pcppi" */);
-
-static int
-spkr_modcmd(modcmd_t cmd, void *arg)
-{
- return spkr__modcmd(cmd, arg);
-}
-
#define SPKRPRI (PZERO - 1)
/* emit tone of frequency hz for given number of ticks */
diff -r dde9f2eced0f -r 83f513cad318 sys/dev/spkr_audio.c
--- a/sys/dev/spkr_audio.c Thu Dec 15 04:49:15 2016 +0000
+++ b/sys/dev/spkr_audio.c Thu Dec 15 06:48:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spkr_audio.c,v 1.1 2016/12/15 04:36:07 christos Exp $ */
+/* $NetBSD: spkr_audio.c,v 1.2 2016/12/15 06:48:14 pgoyette Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.1 2016/12/15 04:36:07 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.2 2016/12/15 06:48:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -35,7 +35,6 @@
#include <sys/errno.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#include <sys/module.h>
#include <sys/uio.h>
#include <sys/proc.h>
#include <sys/ioctl.h>
@@ -77,14 +76,6 @@
CFATTACH_DECL_NEW(spkr_audio, sizeof(struct spkr_audio_softc),
spkr_audio_probe, spkr_audio_attach, spkr_audio_detach, NULL);
-MODULE(MODULE_CLASS_DRIVER, spkr, NULL /* "audio" */);
-
-static int
-spkr_modcmd(modcmd_t cmd, void *arg)
-{
- return spkr__modcmd(cmd, arg);
-}
-
static void
spkr_audio_tone(device_t self, u_int xhz, u_int ticks)
{
diff -r dde9f2eced0f -r 83f513cad318 sys/dev/spkrvar.h
--- a/sys/dev/spkrvar.h Thu Dec 15 04:49:15 2016 +0000
+++ b/sys/dev/spkrvar.h Thu Dec 15 06:48:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spkrvar.h,v 1.4 2016/12/13 20:20:34 christos Exp $ */
+/* $NetBSD: spkrvar.h,v 1.5 2016/12/15 06:48:14 pgoyette Exp $ */
#ifndef _SYS_DEV_SPKRVAR_H
#define _SYS_DEV_SPKRVAR_H
@@ -20,7 +20,6 @@
void (*sc_rest)(device_t, int);
};
-int spkr__modcmd(modcmd_t, void *);
void spkr_attach(device_t,
void (*)(device_t, u_int, u_int), void (*)(device_t, int));
diff -r dde9f2eced0f -r 83f513cad318 sys/modules/Makefile
--- a/sys/modules/Makefile Thu Dec 15 04:49:15 2016 +0000
+++ b/sys/modules/Makefile Thu Dec 15 06:48:14 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.187 2016/12/15 04:37:00 christos Exp $
+# $NetBSD: Makefile,v 1.188 2016/12/15 06:48:14 pgoyette Exp $
.include <bsd.own.mk>
@@ -116,6 +116,7 @@
SUBDIR+= slcompress
SUBDIR+= smbfs
SUBDIR+= spdmem
+SUBDIR+= spkr
SUBDIR+= sppp_subr
SUBDIR+= sysmon
SUBDIR+= sysmon_envsys
@@ -365,7 +366,6 @@
SUBDIR+= coram
SUBDIR+= cxdtv
SUBDIR+= emdtv
-SUBDIR+= spkr
.endif
.if (${MKISCSI} != "no")
diff -r dde9f2eced0f -r 83f513cad318 sys/modules/spkr/Makefile
--- a/sys/modules/spkr/Makefile Thu Dec 15 04:49:15 2016 +0000
+++ b/sys/modules/spkr/Makefile Thu Dec 15 06:48:14 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2016/12/09 06:12:03 christos Exp $
+# $NetBSD: Makefile,v 1.6 2016/12/15 06:48:14 pgoyette Exp $
.include "../Makefile.inc"
@@ -8,6 +8,9 @@
IOCONF= spkr.ioconf
SRCS= spkr.c spkr_pcppi.c
+.PATH: ${S}/dev
+SRCS+= spkr_audio.c audiobell.c
+
WARNS= 4
.include <bsd.kmodule.mk>
diff -r dde9f2eced0f -r 83f513cad318 sys/modules/spkr/spkr.ioconf
--- a/sys/modules/spkr/spkr.ioconf Thu Dec 15 04:49:15 2016 +0000
+++ b/sys/modules/spkr/spkr.ioconf Thu Dec 15 06:48:14 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: spkr.ioconf,v 1.3 2016/12/08 23:22:18 nat Exp $
+# $NetBSD: spkr.ioconf,v 1.4 2016/12/15 06:48:14 pgoyette Exp $
ioconf spkr
@@ -6,5 +6,7 @@
include "dev/isa/files.isa"
pseudo-root pcppi*
+spkr* at pcppi?
-spkr* at pcppi?
+pseudo-root audio*
+spkr* at audio?
Home |
Main Index |
Thread Index |
Old Index