Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 May 2009 19:35:41 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r193184 - in head/sys/dev/syscons: . teken
Message-ID:  <200905311935.n4VJZfhl053022@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sun May 31 19:35:41 2009
New Revision: 193184
URL: http://svn.freebsd.org/changeset/base/193184

Log:
  Restore support for bell pitch/duration.
  
  Because we only support a single argument to tf_param, use 16 bits for
  the pitch and 16 bits for the duration. While there, make the argument
  unsigned. There isn't a single param call that needs a signed integer.
  
  Submitted by:	danfe (modified)

Modified:
  head/sys/dev/syscons/scterm-teken.c
  head/sys/dev/syscons/teken/sequences
  head/sys/dev/syscons/teken/teken.c
  head/sys/dev/syscons/teken/teken.h
  head/sys/dev/syscons/teken/teken_subr_compat.h

Modified: head/sys/dev/syscons/scterm-teken.c
==============================================================================
--- head/sys/dev/syscons/scterm-teken.c	Sun May 31 18:14:40 2009	(r193183)
+++ head/sys/dev/syscons/scterm-teken.c	Sun May 31 19:35:41 2009	(r193184)
@@ -491,7 +491,7 @@ scteken_copy(void *arg, const teken_rect
 }
 
 static void
-scteken_param(void *arg, int cmd, int value)
+scteken_param(void *arg, int cmd, unsigned int value)
 {
 	scr_stat *scp = arg;
 
@@ -508,6 +508,10 @@ scteken_param(void *arg, int cmd, int va
 	case TP_SWITCHVT:
 		sc_switch_scr(scp->sc, value);
 		break;
+	case TP_SETBELLPD:
+		scp->bell_pitch = TP_SETBELLPD_PITCH(value);
+		scp->bell_duration = TP_SETBELLPD_DURATION(value);
+		break;
 	}
 }
 

Modified: head/sys/dev/syscons/teken/sequences
==============================================================================
--- head/sys/dev/syscons/teken/sequences	Sun May 31 18:14:40 2009	(r193183)
+++ head/sys/dev/syscons/teken/sequences	Sun May 31 19:35:41 2009	(r193184)
@@ -102,6 +102,7 @@ VPA	Vertical Position Absolute		^[ [ d		
 # Cons25 compatibility sequences
 C25ADBG	Cons25 set adapter background		^[ [ = G	r
 C25ADFG	Cons25 set adapter foreground		^[ [ = F	r
+C25BLPD	Cons25 set bell pitch duration		^[ [ = B	r r
 C25CURS	Cons25 set cursor type			^[ [ = S	r
 C25VTSW	Cons25 switch virtual terminal		^[ [ z		r
 

Modified: head/sys/dev/syscons/teken/teken.c
==============================================================================
--- head/sys/dev/syscons/teken/teken.c	Sun May 31 18:14:40 2009	(r193183)
+++ head/sys/dev/syscons/teken/teken.c	Sun May 31 19:35:41 2009	(r193184)
@@ -167,7 +167,7 @@ teken_funcs_copy(teken_t *t, const teken
 }
 
 static inline void
-teken_funcs_param(teken_t *t, int cmd, int value)
+teken_funcs_param(teken_t *t, int cmd, unsigned int value)
 {
 
 	t->t_funcs->tf_param(t->t_softc, cmd, value);

Modified: head/sys/dev/syscons/teken/teken.h
==============================================================================
--- head/sys/dev/syscons/teken/teken.h	Sun May 31 18:14:40 2009	(r193183)
+++ head/sys/dev/syscons/teken/teken.h	Sun May 31 19:35:41 2009	(r193184)
@@ -98,13 +98,16 @@ typedef void tf_putchar_t(void *, const 
 typedef void tf_fill_t(void *, const teken_rect_t *, teken_char_t,
     const teken_attr_t *);
 typedef void tf_copy_t(void *, const teken_rect_t *, const teken_pos_t *);
-typedef void tf_param_t(void *, int, int);
+typedef void tf_param_t(void *, int, unsigned int);
 #define	TP_SHOWCURSOR	0
 #define	TP_CURSORKEYS	1
 #define	TP_KEYPADAPP	2
 #define	TP_AUTOREPEAT	3
 #define	TP_SWITCHVT	4
 #define	TP_132COLS	5
+#define	TP_SETBELLPD	6
+#define	TP_SETBELLPD_PITCH(pd)		((pd) >> 16)
+#define	TP_SETBELLPD_DURATION(pd)	((pd) & 0xffff)
 typedef void tf_respond_t(void *, const void *, size_t);
 
 typedef struct {

Modified: head/sys/dev/syscons/teken/teken_subr_compat.h
==============================================================================
--- head/sys/dev/syscons/teken/teken_subr_compat.h	Sun May 31 18:14:40 2009	(r193183)
+++ head/sys/dev/syscons/teken/teken_subr_compat.h	Sun May 31 19:35:41 2009	(r193184)
@@ -66,6 +66,15 @@ teken_subr_cons25_switch_virtual_termina
 	teken_funcs_param(t, TP_SWITCHVT, vt);
 }
 
+static void
+teken_subr_cons25_set_bell_pitch_duration(teken_t *t, unsigned int pitch,
+    unsigned int duration)
+{
+
+	teken_funcs_param(t, TP_SETBELLPD, (pitch << 16) |
+	    (duration & 0xffff));
+}
+
 #if 0
 static void
 teken_subr_vt52_decid(teken_t *t)



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