*** empty log message ***
This commit is contained in:
parent
453beb04ad
commit
376d8485d8
6 changed files with 61 additions and 62 deletions
|
@ -109,6 +109,7 @@ struct driver *dp; /* Device dependent entry points. */
|
|||
(*dp->dr_hw_int)(dp, &mess);
|
||||
}
|
||||
continue;
|
||||
case PROC_EVENT:
|
||||
case SYS_SIG: (*dp->dr_signal)(dp, &mess);
|
||||
continue; /* don't reply */
|
||||
case SYN_ALARM: (*dp->dr_alarm)(dp, &mess);
|
||||
|
|
|
@ -17,6 +17,7 @@ PRIVATE struct name
|
|||
} names[NR_DRIVERS];
|
||||
|
||||
FORWARD _PROTOTYPE( void do_init, (message *mp) );
|
||||
FORWARD _PROTOTYPE( void do_sig_handler, (void) );
|
||||
FORWARD _PROTOTYPE( void do_first_dev, (message *mp) );
|
||||
FORWARD _PROTOTYPE( void do_next_dev, (message *mp) );
|
||||
FORWARD _PROTOTYPE( void do_find_dev, (message *mp) );
|
||||
|
@ -67,7 +68,7 @@ int main(void)
|
|||
case BUSC_PCI_ATTR_W16: do_attr_w16(&m); break;
|
||||
case BUSC_PCI_ATTR_W32: do_attr_w32(&m); break;
|
||||
case BUSC_PCI_RESCAN: do_rescan_bus(&m); break;
|
||||
case SYS_SIG: /* system signal, ignore it */ break;
|
||||
case PROC_EVENT: do_sig_handler(); break;
|
||||
default:
|
||||
printf("PCI: got message from %d, type %d\n",
|
||||
m.m_source, m.m_type);
|
||||
|
@ -78,6 +79,23 @@ int main(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* do_sig_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void do_sig_handler()
|
||||
{
|
||||
sigset_t sigset;
|
||||
int sig;
|
||||
|
||||
/* Try to obtain signal set from PM. */
|
||||
if (getsigset(&sigset) != 0) return;
|
||||
|
||||
/* Check for known signals. */
|
||||
if (sigismember(&sigset, SIGTERM)) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void do_init(mp)
|
||||
message *mp;
|
||||
{
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
* |------------+----------+---------+----------+---------+---------|
|
||||
* | HARD_INT | | | | | |
|
||||
* |------------|----------|---------|----------|---------|---------|
|
||||
* | SYS_SIG | | | | | |
|
||||
* |------------|----------|---------|----------|---------|---------|
|
||||
* | DL_WRITE | port nr | proc nr | count | mode | address |
|
||||
* |------------|----------|---------|----------|---------|---------|
|
||||
* | DL_WRITEV | port nr | proc nr | count | mode | address |
|
||||
|
@ -228,6 +226,7 @@ static void my_outl(U16_t port, U32_t value) {
|
|||
#define rl_outw(port, offset, value) (my_outw((port) + (offset), (value)))
|
||||
#define rl_outl(port, offset, value) (my_outl((port) + (offset), (value)))
|
||||
|
||||
_PROTOTYPE( static void sig_handler, (void) );
|
||||
_PROTOTYPE( static void rl_init, (message *mp) );
|
||||
_PROTOTYPE( static void rl_pci_conf, (void) );
|
||||
_PROTOTYPE( static int rl_probe, (re_t *rep) );
|
||||
|
@ -346,17 +345,35 @@ int main(int argc, char *argv[])
|
|||
check_int_events();
|
||||
break ;
|
||||
case FKEY_PRESSED: rtl8139_dump(&m); break;
|
||||
case SYS_SIG: {
|
||||
sigset_t sigset = m.NOTIFY_ARG;
|
||||
if (sigismember(&sigset, SIGKSTOP)) rtl8139_stop();
|
||||
case PROC_EVENT:
|
||||
sig_handler();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
panic("rtl8139","illegal message", m.m_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* sig_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sig_handler()
|
||||
{
|
||||
sigset_t sigset;
|
||||
int sig;
|
||||
|
||||
/* Try to obtain signal set from PM. */
|
||||
if (getsigset(&sigset) != 0) return;
|
||||
|
||||
/* Check for known signals. */
|
||||
if (sigismember(&sigset, SIGTERM)) {
|
||||
rtl8139_stop();
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* check_int_events *
|
||||
*===========================================================================*/
|
||||
static void check_int_events(void)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -1178,48 +1178,6 @@ int *isauxp;
|
|||
#endif
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* do_panic_dumps *
|
||||
*===========================================================================*/
|
||||
PUBLIC void do_panic_dumps(m)
|
||||
message *m; /* request message to TTY */
|
||||
{
|
||||
/* Wait for keystrokes for printing debugging info and reboot. */
|
||||
unsigned char code;
|
||||
int isaux;
|
||||
|
||||
/* A panic! Allow debug dumps until user wants to shutdown. */
|
||||
printf("\nHit ESC to reboot, DEL to shutdown, F-keys for debug dumps\n");
|
||||
|
||||
(void) scan_keyboard(NULL, NULL); /* ack any old input */
|
||||
for (;;) {
|
||||
tickdelay(10);
|
||||
/* See if there are pending request for output, but don't block.
|
||||
* Diagnostics can span multiple printf()s, so do it in a loop.
|
||||
*/
|
||||
while (nb_receive(ANY, m) == OK) {
|
||||
switch(m->m_type) {
|
||||
case FKEY_CONTROL: do_fkey_ctl(m); break;
|
||||
case SYS_SIG: do_new_kmess(m); break;
|
||||
case DIAGNOSTICS: do_diagnostics(m); break;
|
||||
default: ; /* do nothing */
|
||||
}
|
||||
tickdelay(1); /* allow more */
|
||||
}
|
||||
if (!scan_keyboard(&code, &isaux))
|
||||
continue;
|
||||
if (isaux)
|
||||
continue;
|
||||
|
||||
/* A key has been pressed. */
|
||||
switch (code) { /* possibly abort MINIX */
|
||||
case ESC_SCAN: sys_abort(RBT_REBOOT); return;
|
||||
case DEL_SCAN: sys_abort(RBT_HALT); return;
|
||||
}
|
||||
(void) func_key(code); /* check for function key */
|
||||
}
|
||||
}
|
||||
|
||||
static void micro_delay(unsigned long usecs)
|
||||
{
|
||||
tickdelay(MICROS_TO_TICKS(usecs));
|
||||
|
|
|
@ -228,24 +228,22 @@ PUBLIC void main(void)
|
|||
expire_timers(); /* run watchdogs of expired timers */
|
||||
continue; /* contine to check for events */
|
||||
}
|
||||
case SYS_SIG: { /* system signal */
|
||||
sigset_t sigset = (sigset_t) tty_mess.NOTIFY_ARG;
|
||||
|
||||
if (sigismember(&sigset, SIGKSTOP)) {
|
||||
case PROC_EVENT: {
|
||||
cons_stop(); /* switch to primary console */
|
||||
printf("TTY got PROC_EVENT, assuming SIGTERM\n");
|
||||
#if DEAD_CODE
|
||||
if (irq_hook_id != -1) {
|
||||
sys_irqdisable(&irq_hook_id);
|
||||
sys_irqrmpolicy(KEYBOARD_IRQ, &irq_hook_id);
|
||||
}
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (sigismember(&sigset, SIGTERM)) cons_stop();
|
||||
case SYS_SIG: { /* system signal */
|
||||
sigset_t sigset = (sigset_t) tty_mess.NOTIFY_ARG;
|
||||
if (sigismember(&sigset, SIGKMESS)) do_new_kmess(&tty_mess);
|
||||
continue;
|
||||
}
|
||||
case PANIC_DUMPS: /* allow panic dumps */
|
||||
cons_stop(); /* switch to primary console */
|
||||
do_panic_dumps(&tty_mess);
|
||||
continue;
|
||||
case DIAGNOSTICS: /* a server wants to print some */
|
||||
do_diagnostics(&tty_mess);
|
||||
continue;
|
||||
|
|
7
lib/syscall/getsigset.s
Normal file
7
lib/syscall/getsigset.s
Normal file
|
@ -0,0 +1,7 @@
|
|||
.sect .text
|
||||
.extern __getsigset
|
||||
.define _getsigset
|
||||
.align 2
|
||||
|
||||
_getsigset:
|
||||
jmp __getsigset
|
Loading…
Reference in a new issue