svn commit: r259882 - head/sys/dev/vt

Aleksandr Rybalko ray at FreeBSD.org
Wed Dec 25 19:07:15 UTC 2013


Author: ray
Date: Wed Dec 25 19:07:14 2013
New Revision: 259882
URL: http://svnweb.freebsd.org/changeset/base/259882

Log:
  Use statndard (syscons) way to disable bell.
  
  Testesd by:	markj
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt.h
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt.h
==============================================================================
--- head/sys/dev/vt/vt.h	Wed Dec 25 18:25:58 2013	(r259881)
+++ head/sys/dev/vt/vt.h	Wed Dec 25 19:07:14 2013	(r259882)
@@ -135,6 +135,7 @@ struct vt_device {
 #define	VDF_DEAD	0x10	/* Early probing found nothing. */
 #define	VDF_INITIALIZED	0x20	/* vtterm_cnprobe already done. */
 #define	VDF_MOUSECURSOR	0x40	/* Mouse cursor visible. */
+#define	VDF_QUIET_BELL	0x80	/* Disable bell. */
 	int			 vd_keyboard;	/* (G) Keyboard index. */
 	unsigned int		 vd_kbstate;	/* (?) Device unit. */
 	unsigned int		 vd_unit;	/* (c) Device unit. */

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Wed Dec 25 18:25:58 2013	(r259881)
+++ head/sys/dev/vt/vt_core.c	Wed Dec 25 19:07:14 2013	(r259882)
@@ -589,6 +589,11 @@ vt_allocate_keyboard(struct vt_device *v
 static void
 vtterm_bell(struct terminal *tm)
 {
+	struct vt_window *vw = tm->tm_softc;
+	struct vt_device *vd = vw->vw_device;
+
+	if (vd->vd_flags & VDF_QUIET_BELL)
+		return;
 
 	sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION);
 }
@@ -1505,6 +1510,12 @@ skip_thunk:
 		/* XXX */
 		*(int *)data = M_CG640x480;
 		return (0);
+	case CONS_BELLTYPE: 	/* set bell type sound */
+		if ((*(int *)data) & CONS_QUIET_BELL)
+			vd->vd_flags |= VDF_QUIET_BELL;
+		else
+			vd->vd_flags &= ~VDF_QUIET_BELL;
+		return (0);
 	case CONS_GETINFO: {
 		vid_info_t *vi = (vid_info_t *)data;
 


More information about the svn-src-head mailing list