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:
Ben Gras
2010-03-05 15:05:11 +00:00
parent 851dc95566
commit 35a108b911
171 changed files with 1381 additions and 1649 deletions

View File

@@ -255,7 +255,7 @@ unsigned nr_req; /* length of request vector */
0, (vir_bytes) (bios_buf_v+count),
chunk, D);
if (r != OK)
panic(ME, "copy failed", r);
panic("copy failed: %d", r);
} else {
memcpy(bios_buf_v+count,
(char *) iop->iov_addr, chunk);
@@ -299,7 +299,7 @@ unsigned nr_req; /* length of request vector */
r= sys_int86(&reg86);
if (r != OK)
panic(ME, "BIOS call failed", r);
panic("BIOS call failed: %d", r);
if (reg86.u.w.f & 0x0001) {
/* An error occurred, try again sector by sector unless */
@@ -321,7 +321,7 @@ unsigned nr_req; /* length of request vector */
chunk, D);
if (r != OK)
panic(ME, "sys_vircopy failed", r);
panic("sys_vircopy failed: %d", r);
} else {
memcpy((char *) iop->iov_addr,
bios_buf_v+count, chunk);
@@ -413,11 +413,11 @@ PRIVATE void w_init()
/* Ask the system task for a suitable buffer */
if(!(bios_buf_v = alloc_contig(BIOSBUF, AC_LOWER1M, &bios_buf_phys))) {
panic(ME, "allocating bios buffer failed", ENOMEM);
panic("allocating bios buffer failed: %d", ENOMEM);
}
if (bios_buf_phys+BIOSBUF > 0x100000)
panic(ME, "bad BIOS buffer, phys", bios_buf_phys);
panic("bad BIOS buffer / phys: %d", bios_buf_phys);
#if 0
printf("bios_wini: got buffer size %d, virtual 0x%x, phys 0x%x\n",
BIOSBUF, bios_buf_v, bios_buf_phys);
@@ -446,7 +446,7 @@ PRIVATE void w_init()
reg86.u.b.dl = drive_id;
r= sys_int86(&reg86);
if (r != OK)
panic(ME, "BIOS call failed", r);
panic("BIOS call failed: %d", r);
nr_drives = !(reg86.u.w.f & 0x0001) ? reg86.u.b.dl : drive;
if (drive_id >= 0x80 + nr_drives) continue;
@@ -466,7 +466,7 @@ PRIVATE void w_init()
if (pc_at) {
r= sys_int86(&reg86);
if (r != OK)
panic(ME, "BIOS call failed", r);
panic("BIOS call failed: %d", r);
}
if (!(reg86.u.w.f & 0x0001) && reg86.u.w.bx == 0xAA55
@@ -481,7 +481,7 @@ PRIVATE void w_init()
r= sys_int86(&reg86);
if (r != OK)
panic(ME, "BIOS call failed", r);
panic("BIOS call failed: %d", r);
if (!(reg86.u.w.f & 0x0001)) {
wn->int13ext = 1; /* Extensions can be used. */