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
|
|
|
|
*/
|
|
|
|
|
2005-10-20 22:28:54 +02:00
|
|
|
#include "inc.h"
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-10-20 22:28:54 +02:00
|
|
|
/* Define hooks for the debugging dumps. This table maps function keys
|
|
|
|
* onto a specific dump and provides a description for it.
|
|
|
|
*/
|
2006-07-13 16:50:23 +02:00
|
|
|
#define NHOOKS 18
|
2005-09-22 14:21:26 +02:00
|
|
|
|
|
|
|
struct hook_entry {
|
|
|
|
int key;
|
|
|
|
void (*function)(void);
|
|
|
|
char *name;
|
|
|
|
} hooks[NHOOKS] = {
|
|
|
|
{ F1, proctab_dmp, "Kernel process table" },
|
|
|
|
{ F2, memmap_dmp, "Process memory maps" },
|
|
|
|
{ F3, image_dmp, "System image" },
|
|
|
|
{ F4, privileges_dmp, "Process privileges" },
|
|
|
|
{ F5, monparams_dmp, "Boot monitor parameters" },
|
|
|
|
{ F6, irqtab_dmp, "IRQ hooks and policies" },
|
|
|
|
{ F7, kmessages_dmp, "Kernel messages" },
|
2005-10-12 17:07:38 +02:00
|
|
|
{ F9, sched_dmp, "Scheduling queues" },
|
2005-09-22 14:21:26 +02:00
|
|
|
{ F10, kenv_dmp, "Kernel parameters" },
|
|
|
|
{ F11, timing_dmp, "Timing details (if enabled)" },
|
|
|
|
{ SF1, mproc_dmp, "Process manager process table" },
|
|
|
|
{ SF2, sigaction_dmp, "Signals" },
|
|
|
|
{ SF3, fproc_dmp, "Filesystem process table" },
|
|
|
|
{ SF4, dtab_dmp, "Device/Driver mapping" },
|
|
|
|
{ SF5, mapping_dmp, "Print key mappings" },
|
2005-10-12 17:07:38 +02:00
|
|
|
{ SF6, rproc_dmp, "Reincarnation server process table" },
|
2005-10-20 22:28:54 +02:00
|
|
|
{ SF8, data_store_dmp, "Data store contents" },
|
2005-09-22 14:21:26 +02:00
|
|
|
};
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/*===========================================================================*
|
|
|
|
* handle_fkey *
|
|
|
|
*===========================================================================*/
|
2005-10-20 22:28:54 +02:00
|
|
|
#define pressed(k) ((F1<=(k)&&(k)<=F12 && bit_isset(m->FKEY_FKEYS,((k)-F1+1)))\
|
2005-06-20 16:23:31 +02:00
|
|
|
|| (SF1<=(k) && (k)<=SF12 && bit_isset(m->FKEY_SFKEYS, ((k)-SF1+1))))
|
2005-10-20 22:28:54 +02:00
|
|
|
PUBLIC int do_fkey_pressed(m)
|
|
|
|
message *m; /* notification message */
|
2005-04-21 16:53:53 +02:00
|
|
|
{
|
2005-09-22 14:21:26 +02:00
|
|
|
int s, h;
|
2005-06-20 16:23:31 +02:00
|
|
|
|
|
|
|
/* 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;
|
2005-08-03 10:14:08 +02:00
|
|
|
if (OK != (s=sendrec(TTY_PROC_NR, m)))
|
2005-06-20 16:23:31 +02:00
|
|
|
report("IS", "warning, sendrec to TTY failed", s);
|
|
|
|
|
2005-10-13 14:48:43 +02:00
|
|
|
/* Now check which keys were pressed: F1-F12, SF1-SF12. */
|
2005-10-20 22:28:54 +02:00
|
|
|
for(h=0; h < NHOOKS; h++)
|
|
|
|
if(pressed(hooks[h].key))
|
|
|
|
hooks[h].function();
|
2005-06-20 16:23:31 +02:00
|
|
|
|
2005-10-20 22:28:54 +02:00
|
|
|
/* Don't send a reply message. */
|
2005-09-22 14:21:26 +02:00
|
|
|
return(EDONTREPLY);
|
|
|
|
}
|
2005-06-20 16:23:31 +02:00
|
|
|
|
2005-10-20 22:28:54 +02:00
|
|
|
/*===========================================================================*
|
|
|
|
* key_name *
|
|
|
|
*===========================================================================*/
|
|
|
|
PRIVATE char *key_name(int key)
|
2005-09-22 14:21:26 +02:00
|
|
|
{
|
|
|
|
static char name[15];
|
2005-06-20 16:23:31 +02:00
|
|
|
|
2005-09-22 14:21:26 +02:00
|
|
|
if(key >= F1 && key <= F12)
|
|
|
|
sprintf(name, " F%d", key - F1 + 1);
|
|
|
|
else if(key >= SF1 && key <= SF12)
|
|
|
|
sprintf(name, "Shift+F%d", key - SF1 + 1);
|
|
|
|
else
|
|
|
|
sprintf(name, "?");
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2005-10-12 17:07:38 +02:00
|
|
|
|
2005-10-20 22:28:54 +02:00
|
|
|
/*===========================================================================*
|
|
|
|
* mapping_dmp *
|
|
|
|
*===========================================================================*/
|
2005-09-22 14:21:26 +02:00
|
|
|
PUBLIC void mapping_dmp(void)
|
|
|
|
{
|
2005-10-20 22:28:54 +02:00
|
|
|
int h;
|
2005-09-22 14:21:26 +02:00
|
|
|
|
2005-10-20 22:28:54 +02:00
|
|
|
printf("Function key mappings for debug dumps in IS server.\n");
|
|
|
|
printf(" Key Description\n");
|
|
|
|
printf("-------------------------------------");
|
|
|
|
printf("------------------------------------\n");
|
2005-09-22 14:21:26 +02:00
|
|
|
|
2005-10-20 22:28:54 +02:00
|
|
|
for(h=0; h < NHOOKS; h++)
|
|
|
|
printf(" %10s. %s\n", key_name(hooks[h].key), hooks[h].name);
|
|
|
|
printf("\n");
|
2005-04-21 16:53:53 +02:00
|
|
|
}
|
|
|
|
|