diff --git a/sys/dev/syscons/scterm-teken.c b/sys/dev/syscons/scterm-teken.c index 491f82ab3c2b..3ec6b4474363 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 59d324573fdf..8f7bfb443881 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 30845c49a63b..9cfa16c4a48a 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 620dfd57e670..dd19e76f6c14 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 e49c1cd5696f..4e03c6676da5 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)