Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2014 13:52:14 +0000 (UTC)
From:      Aleksandr Rybalko <ray@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265442 - head/sys/dev/vt
Message-ID:  <201405061352.s46DqE9a025250@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ray
Date: Tue May  6 13:52:13 2014
New Revision: 265442
URL: http://svnweb.freebsd.org/changeset/base/265442

Log:
  Implement KDMKTONE ioctl.
  
  Submitted by:	Matthew D.Fuller <fullermd@over-yonder.net> (original version)
  MFC:		7 days
  PR:		kern/189170
  
  Sponsored by:	The FreeBSD Foundation

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

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Tue May  6 13:46:36 2014	(r265441)
+++ head/sys/dev/vt/vt_core.c	Tue May  6 13:52:13 2014	(r265442)
@@ -1732,9 +1732,17 @@ skip_thunk:
 		td->td_frame->tf_rflags &= ~PSL_IOPL;
 #endif
 		return (0);
-	case KDMKTONE:      	/* sound the bell */
-		/* TODO */
+	case KDMKTONE: {      	/* sound the bell */
+		int freq, period;
+
+		freq = 1193182 / ((*(int*)data) & 0xffff);
+		period = (((*(int*)data)>>16) & 0xffff) * hz / 1000;
+		if(*(int*)data)
+			sysbeep(freq, period);
+		else
+			vtterm_bell(tm);
 		return (0);
+	}
 	case KIOCSOUND:     	/* make tone (*data) hz */
 		/* TODO */
 		return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405061352.s46DqE9a025250>