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 <fulle...@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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to