2005-04-21 16:53:53 +02:00
|
|
|
/* This file contains information dump procedures. During the initialization
|
|
|
|
* of the Information Service 'known' function keys are registered at the TTY
|
|
|
|
* server in order to receive a notification if one is pressed. Here, the
|
|
|
|
* corresponding dump procedure is called.
|
|
|
|
*
|
|
|
|
* The entry points into this file are
|
|
|
|
* handle_fkey: handle a function key pressed notification
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "is.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* handle_fkey *
|
|
|
|
*===========================================================================*/
|
2005-06-20 16:23:31 +02:00
|
|
|
#define pressed(k) ((F1<=(k) && (k)<=F12 && bit_isset(m->FKEY_FKEYS, ((k)-F1+1))) \
|
|
|
|
|| (SF1<=(k) && (k)<=SF12 && bit_isset(m->FKEY_SFKEYS, ((k)-SF1+1))))
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
PUBLIC int do_fkey_pressed(message *m)
|
|
|
|
{
|
2005-06-20 16:23:31 +02:00
|
|
|
int s;
|
|
|
|
|
|
|
|
/* 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->FKEY_REQUEST = FKEY_EVENTS;
|
|
|
|
if (OK != (s=sendrec(TTY, m)))
|
|
|
|
report("IS", "warning, sendrec to TTY failed", s);
|
|
|
|
|
|
|
|
/* Now check which keys were pressed: F1-F12. */
|
|
|
|
if (pressed(F1)) proctab_dmp();
|
|
|
|
if (pressed(F2)) memmap_dmp();
|
|
|
|
if (pressed(F3)) image_dmp();
|
2005-07-14 17:16:12 +02:00
|
|
|
if (pressed(F4)) privileges_dmp();
|
2005-06-20 16:23:31 +02:00
|
|
|
if (pressed(F5)) monparams_dmp();
|
|
|
|
if (pressed(F6)) irqtab_dmp();
|
|
|
|
if (pressed(F7)) kmessages_dmp();
|
|
|
|
|
|
|
|
if (pressed(F10)) kenv_dmp();
|
|
|
|
if (pressed(F11)) timing_dmp();
|
|
|
|
if (pressed(F12)) sched_dmp();
|
|
|
|
|
2005-07-29 17:33:31 +02:00
|
|
|
#if DEAD_CODE
|
2005-06-30 17:55:43 +02:00
|
|
|
if (pressed(F9)) {
|
2005-07-14 17:16:12 +02:00
|
|
|
printf("IS server going into infinite loop... hit 5x a function key\n");
|
|
|
|
printf("Five times a function key is fine as well ...\n");
|
2005-06-30 17:55:43 +02:00
|
|
|
while(TRUE) {
|
|
|
|
if (OK == nb_receive(ANY, m)) {
|
2005-07-14 17:16:12 +02:00
|
|
|
if (s++ >= 5 ) break;
|
2005-06-30 17:55:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("IS server back to normal ... \n");
|
2005-07-14 17:16:12 +02:00
|
|
|
return(EDONTREPLY);
|
2005-06-30 17:55:43 +02:00
|
|
|
}
|
2005-07-29 17:33:31 +02:00
|
|
|
#endif
|
2005-06-30 17:55:43 +02:00
|
|
|
|
2005-06-20 16:23:31 +02:00
|
|
|
/* Also check Shift F1-F6 keys. */
|
|
|
|
if (pressed(SF1)) mproc_dmp();
|
|
|
|
|
|
|
|
if (pressed(SF3)) fproc_dmp();
|
|
|
|
if (pressed(SF4)) dtab_dmp();
|
|
|
|
|
|
|
|
/* Inhibit sending a reply message. */
|
|
|
|
return(EDONTREPLY);
|
2005-04-21 16:53:53 +02:00
|
|
|
}
|
|
|
|
|