diff options
author | ed <ed@FreeBSD.org> | 2009-05-31 19:35:41 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-05-31 19:35:41 +0000 |
commit | d5a70a77bc470854a180ef21bcca7705d0c31e01 (patch) | |
tree | 530bd0dac9786416dad1937bdf5bf4d407e19fe2 /sys/dev | |
parent | 3d7ca7e19288365264e31954d12a37bf69f20723 (diff) | |
download | FreeBSD-src-d5a70a77bc470854a180ef21bcca7705d0c31e01.zip FreeBSD-src-d5a70a77bc470854a180ef21bcca7705d0c31e01.tar.gz |
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)
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/syscons/scterm-teken.c | 6 | ||||
-rw-r--r-- | sys/dev/syscons/teken/sequences | 1 | ||||
-rw-r--r-- | sys/dev/syscons/teken/teken.c | 2 | ||||
-rw-r--r-- | sys/dev/syscons/teken/teken.h | 5 | ||||
-rw-r--r-- | sys/dev/syscons/teken/teken_subr_compat.h | 9 |
5 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/syscons/scterm-teken.c b/sys/dev/syscons/scterm-teken.c index 491f82a..3ec6b44 100644 --- a/sys/dev/syscons/scterm-teken.c +++ b/sys/dev/syscons/scterm-teken.c @@ -491,7 +491,7 @@ scteken_copy(void *arg, const teken_rect_t *r, const teken_pos_t *p) } 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 value) 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; } } diff --git a/sys/dev/syscons/teken/sequences b/sys/dev/syscons/teken/sequences index 59d3245..8f7bfb4 100644 --- a/sys/dev/syscons/teken/sequences +++ b/sys/dev/syscons/teken/sequences @@ -102,6 +102,7 @@ VPA Vertical Position Absolute ^[ [ d n # 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 diff --git a/sys/dev/syscons/teken/teken.c b/sys/dev/syscons/teken/teken.c index 30845c4..9cfa16c 100644 --- a/sys/dev/syscons/teken/teken.c +++ b/sys/dev/syscons/teken/teken.c @@ -167,7 +167,7 @@ teken_funcs_copy(teken_t *t, const teken_rect_t *r, const teken_pos_t *p) } 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); diff --git a/sys/dev/syscons/teken/teken.h b/sys/dev/syscons/teken/teken.h index 620dfd5..dd19e76 100644 --- a/sys/dev/syscons/teken/teken.h +++ b/sys/dev/syscons/teken/teken.h @@ -98,13 +98,16 @@ typedef void tf_putchar_t(void *, const teken_pos_t *, teken_char_t, 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 { diff --git a/sys/dev/syscons/teken/teken_subr_compat.h b/sys/dev/syscons/teken/teken_subr_compat.h index e49c1cd..4e03c66 100644 --- a/sys/dev/syscons/teken/teken_subr_compat.h +++ b/sys/dev/syscons/teken/teken_subr_compat.h @@ -66,6 +66,15 @@ teken_subr_cons25_switch_virtual_terminal(teken_t *t, unsigned int vt) 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) |