panic() cleanup.
this change
- makes panic() variadic, doing full printf() formatting -
no more NO_NUM, and no more separate printf() statements
needed to print extra info (or something in hex) before panicing
- unifies panic() - same panic() name and usage for everyone -
vm, kernel and rest have different names/syntax currently
in order to implement their own luxuries, but no longer
- throws out the 1st argument, to make source less noisy.
the panic() in syslib retrieves the server name from the kernel
so it should be clear enough who is panicing; e.g.
panic("sigaction failed: %d", errno);
looks like:
at_wini(73130): panic: sigaction failed: 0
syslib:panic.c: stacktrace: 0x74dc 0x2025 0x100a
- throws out report() - printf() is more convenient and powerful
- harmonizes/fixes the use of panic() - there were a few places
that used printf-style formatting (didn't work) and newlines
(messes up the formatting) in panic()
- throws out a few per-server panic() functions
- cleans up a tie-in of tty with panic()
merging printf() and panic() statements to be done incrementally.
This commit is contained in:
@@ -52,7 +52,7 @@ PUBLIC int main(int argc, char **argv)
|
||||
sig_handler();
|
||||
break;
|
||||
default:
|
||||
report("DS","warning, got illegal notify from:",
|
||||
printf("DS: warning, got illegal notify from: %d\n",
|
||||
m.m_source);
|
||||
result = EINVAL;
|
||||
goto send_reply;
|
||||
@@ -87,7 +87,7 @@ PUBLIC int main(int argc, char **argv)
|
||||
result = do_getsysinfo(&m);
|
||||
break;
|
||||
default:
|
||||
report("DS","warning, got illegal request from:", m.m_source);
|
||||
printf("DS: warning, got illegal request from %d\n", m.m_source);
|
||||
result = EINVAL;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ message *m_ptr; /* message buffer */
|
||||
int status = 0;
|
||||
status = sef_receive(ANY, m_ptr); /* this blocks until message arrives */
|
||||
if (OK != status)
|
||||
panic("DS","failed to receive message!", status);
|
||||
panic("failed to receive message!: %d", status);
|
||||
who_e = m_ptr->m_source; /* message arrived! set sender */
|
||||
callnr = m_ptr->m_type; /* set function call number */
|
||||
}
|
||||
|
||||
@@ -266,12 +266,12 @@ PUBLIC int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
/* Map all the services in the boot image. */
|
||||
if((r = sys_safecopyfrom(RS_PROC_NR, info->rproctab_gid, 0,
|
||||
(vir_bytes) rprocpub, sizeof(rprocpub), S)) != OK) {
|
||||
panic("DS", "sys_safecopyfrom failed", r);
|
||||
panic("sys_safecopyfrom failed: %d", r);
|
||||
}
|
||||
for(i=0;i < NR_BOOT_PROCS;i++) {
|
||||
if(rprocpub[i].in_use) {
|
||||
if((r = map_service(&rprocpub[i])) != OK) {
|
||||
panic("DS", "unable to map service", r);
|
||||
panic("unable to map service: %d", r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user