Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons Seperate the definitions for the console beep...



details:   https://anonhg.NetBSD.org/src/rev/8acb3238e33d
branches:  trunk
changeset: 824604:8acb3238e33d
user:      nat <nat%NetBSD.org@localhost>
date:      Sun Jun 11 03:38:12 2017 +0000

description:
Seperate the definitions for the console beep.  This code will be shared
with a new device.

Ok pgoyette@.

diffstat:

 sys/dev/wscons/wsbelldata.h |  43 +++++++++++++++++++++++++++++++++++++++++++
 sys/dev/wscons/wskbd.c      |  22 +++-------------------
 2 files changed, 46 insertions(+), 19 deletions(-)

diffs (97 lines):

diff -r ed7b64448b67 -r 8acb3238e33d sys/dev/wscons/wsbelldata.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/wscons/wsbelldata.h       Sun Jun 11 03:38:12 2017 +0000
@@ -0,0 +1,43 @@
+/* $NetBSD: wsbelldata.h,v 1.1 2017/06/11 03:38:12 nat Exp $ */
+/*-
+ * Copyright (c) 2017 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
+ * 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,
+};
diff -r ed7b64448b67 -r 8acb3238e33d sys/dev/wscons/wskbd.c
--- a/sys/dev/wscons/wskbd.c    Sun Jun 11 03:33:48 2017 +0000
+++ b/sys/dev/wscons/wskbd.c    Sun Jun 11 03:38:12 2017 +0000
@@ -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 @@
 #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 @@
        .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,



Home | Main Index | Thread Index | Old Index