Module Name: src
Committed By: nat
Date: Sun Jun 11 03:38:12 UTC 2017
Modified Files:
src/sys/dev/wscons: wskbd.c
Added Files:
src/sys/dev/wscons: wsbelldata.h
Log Message:
Seperate the definitions for the console beep. This code will be shared
with a new device.
Ok pgoyette@.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/wscons/wsbelldata.h
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/wscons/wskbd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/wscons/wskbd.c
diff -u src/sys/dev/wscons/wskbd.c:1.138 src/sys/dev/wscons/wskbd.c:1.139
--- src/sys/dev/wscons/wskbd.c:1.138 Sat Dec 10 22:36:28 2016
+++ src/sys/dev/wscons/wskbd.c Sun Jun 11 03:38:12 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbd.c,v 1.138 2016/12/10 22:36:28 christos Exp $ */
+/* $NetBSD: wskbd.c,v 1.139 2017/06/11 03:38:12 nat Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.138 2016/12/10 22:36:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.139 2017/06/11 03:38:12 nat Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -142,6 +142,7 @@ __KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.
#include <dev/wscons/wsdisplayvar.h>
#include <dev/wscons/wseventvar.h>
#include <dev/wscons/wscons_callbacks.h>
+#include <dev/wscons/wsbelldata.h>
#ifdef KGDB
#include <sys/kgdb.h>
@@ -313,23 +314,6 @@ const struct cdevsw wskbd_cdevsw = {
.d_flag = D_OTHER
};
-#ifndef WSKBD_DEFAULT_BELL_PITCH
-#define WSKBD_DEFAULT_BELL_PITCH 1500 /* 1500Hz */
-#endif
-#ifndef WSKBD_DEFAULT_BELL_PERIOD
-#define WSKBD_DEFAULT_BELL_PERIOD 100 /* 100ms */
-#endif
-#ifndef WSKBD_DEFAULT_BELL_VOLUME
-#define WSKBD_DEFAULT_BELL_VOLUME 50 /* 50% volume */
-#endif
-
-struct wskbd_bell_data wskbd_default_bell_data = {
- WSKBD_BELL_DOALL,
- WSKBD_DEFAULT_BELL_PITCH,
- WSKBD_DEFAULT_BELL_PERIOD,
- WSKBD_DEFAULT_BELL_VOLUME,
-};
-
#ifdef WSDISPLAY_SCROLLSUPPORT
struct wskbd_scroll_data wskbd_default_scroll_data = {
WSKBD_SCROLL_DOALL,
Added files:
Index: src/sys/dev/wscons/wsbelldata.h
diff -u /dev/null src/sys/dev/wscons/wsbelldata.h:1.1
--- /dev/null Sun Jun 11 03:38:12 2017
+++ src/sys/dev/wscons/wsbelldata.h Sun Jun 11 03:38:12 2017
@@ -0,0 +1,43 @@
+/* $NetBSD: wsbelldata.h,v 1.1 2017/06/11 03:38:12 nat Exp $ */
+/*-
+ * Copyright (c) 2017 Nathanial Sloss <[email protected]>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WSKBD_DEFAULT_BELL_PITCH
+#define WSKBD_DEFAULT_BELL_PITCH 1500 /* 1500Hz */
+#endif
+#ifndef WSKBD_DEFAULT_BELL_PERIOD
+#define WSKBD_DEFAULT_BELL_PERIOD 100 /* 100ms */
+#endif
+#ifndef WSKBD_DEFAULT_BELL_VOLUME
+#define WSKBD_DEFAULT_BELL_VOLUME 50 /* 50% volume */
+#endif
+
+static struct wskbd_bell_data wskbd_default_bell_data = {
+ WSKBD_BELL_DOALL,
+ WSKBD_DEFAULT_BELL_PITCH,
+ WSKBD_DEFAULT_BELL_PERIOD,
+ WSKBD_DEFAULT_BELL_VOLUME,
+};