From: Ben Gras Date: Wed, 1 May 2013 19:01:17 +0000 (+0000) Subject: tty: non-overlapping code for FKEY_CONTROL X-Git-Tag: v3.3.0~996 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=85fd078707459f4dea16186b29a4f5cc4ee32d9d;p=minix.git tty: non-overlapping code for FKEY_CONTROL . to decode it in kernel/debug.c Change-Id: I0d2cc66e87d97a362fa549b364b4d1b0e1225e66 --- diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index ced338f69..682da5f60 100644 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -398,7 +398,7 @@ static void or_dump (message *m) if(orp->or_mode != OR_M_ENABLED) return; - m->m_type = FKEY_CONTROL; + m->m_type = TTY_FKEY_CONTROL; m->FKEY_REQUEST = FKEY_EVENTS; if(OK!=(sendrec(TTY_PROC_NR,m)) ) printf("Contacting the TTY failed\n"); diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index aaa442d8f..b1463bcca 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -220,7 +220,8 @@ int main(void) } switch (tty_mess.m_type) { - case FKEY_CONTROL: /* (un)register a fkey observer */ + case TTY_FKEY_CONTROL: /* (un)register a fkey observer */ + case OLD_FKEY_CONTROL: /* old number */ do_fkey_ctl(&tty_mess); continue; case INPUT_EVENT: diff --git a/include/minix/com.h b/include/minix/com.h index f92a567b0..8af307b9f 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -23,7 +23,7 @@ * 0x1000 - 0x10FF Notify messages * 0x1100 - 0x11FF USB * 0x1200 - 0x12FF Devman - * 0x1300 - 0x13FF TTY Input + * 0x1300 - 0x13FF TTY Requests * 0x1400 - 0x14FF VFS-FS transaction IDs * 0x1500 - 0x15FF Block device requests and responses * 0x1600 - 0x16FF VirtualBox (VBOX) requests (see vboxif.h) @@ -740,19 +740,6 @@ # define DS_NR_SNAPSHOT m2_i3 /* number of snapshot */ # define DS_OWNER m2_i3 /* owner */ -/*===========================================================================* - * Miscellaneous messages used by TTY * - *===========================================================================*/ - -/* Miscellaneous request types and field names, e.g. used by IS server. */ -#define FKEY_CONTROL 98 /* control a function key at the TTY */ -# define FKEY_REQUEST m2_i1 /* request to perform at TTY */ -# define FKEY_MAP 10 /* observe function key */ -# define FKEY_UNMAP 11 /* stop observing function key */ -# define FKEY_EVENTS 12 /* request open key presses */ -# define FKEY_FKEYS m2_l1 /* F1-F12 keys pressed */ -# define FKEY_SFKEYS m2_l2 /* Shift-F1-F12 keys pressed */ - /*===========================================================================* * Messages used between PM and VFS * *===========================================================================*/ @@ -1233,17 +1220,27 @@ # define DEVMAN_RESULT m4_l1 /*===========================================================================* - * TTY INPUT INJECTION * + * TTY REQUESTS * *===========================================================================*/ -#define INPUT_BASE 0x1300 +#define TTY_RQ_BASE 0x1300 -#define INPUT_EVENT (INPUT_BASE + 0) +#define INPUT_EVENT (TTY_RQ_BASE + 0) # define INPUT_TYPE m4_l1 # define INPUT_CODE m4_l2 # define INPUT_VALUE m4_l3 + +#define TTY_FKEY_CONTROL (TTY_RQ_BASE + 1) /* control an F-key at TTY */ +#define OLD_FKEY_CONTROL 98 /* previously used for TTY_FKEY_CONTROL */ +# define FKEY_REQUEST m2_i1 /* request to perform at TTY */ +# define FKEY_MAP 10 /* observe function key */ +# define FKEY_UNMAP 11 /* stop observing function key */ +# define FKEY_EVENTS 12 /* request open key presses */ +# define FKEY_FKEYS m2_l1 /* F1-F12 keys pressed */ +# define FKEY_SFKEYS m2_l2 /* Shift-F1-F12 keys pressed */ + #endif /*===========================================================================* diff --git a/lib/libsys/fkey_ctl.c b/lib/libsys/fkey_ctl.c index afe63c140..a3c28a41b 100644 --- a/lib/libsys/fkey_ctl.c +++ b/lib/libsys/fkey_ctl.c @@ -18,7 +18,7 @@ int *sfkeys; /* bit masks for Shift F1-F12 keys */ m.FKEY_REQUEST = request; m.FKEY_FKEYS = (fkeys) ? *fkeys : 0; m.FKEY_SFKEYS = (sfkeys) ? *sfkeys : 0; - s = _taskcall(TTY_PROC_NR, FKEY_CONTROL, &m); + s = _taskcall(TTY_PROC_NR, TTY_FKEY_CONTROL, &m); if (fkeys) *fkeys = m.FKEY_FKEYS; if (sfkeys) *sfkeys = m.FKEY_SFKEYS; return(s); diff --git a/servers/is/dmp.c b/servers/is/dmp.c index bbae0f81c..64d79ca8d 100644 --- a/servers/is/dmp.c +++ b/servers/is/dmp.c @@ -77,7 +77,7 @@ message *m; /* notification message */ /* The notification message does not convey any information, other * than that some function keys have been pressed. Ask TTY for details. */ - m->m_type = FKEY_CONTROL; + m->m_type = TTY_FKEY_CONTROL; m->FKEY_REQUEST = FKEY_EVENTS; if (OK != (s=sendrec(TTY_PROC_NR, m))) printf("IS: warning, sendrec to TTY failed: %d\n", s);