]> Zhao Yanbai Git Server - minix.git/commitdiff
panic() cleanup.
authorBen Gras <ben@minix3.org>
Fri, 5 Mar 2010 15:05:11 +0000 (15:05 +0000)
committerBen Gras <ben@minix3.org>
Fri, 5 Mar 2010 15:05:11 +0000 (15:05 +0000)
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.

171 files changed:
drivers/amddev/amddev.c
drivers/at_wini/at_wini.c
drivers/atl2/atl2.c
drivers/audio/sb16/sb16.c
drivers/bios_wini/bios_wini.c
drivers/dec21140A/dec21140A.c
drivers/dp8390/3c503.c
drivers/dp8390/dp8390.c
drivers/dp8390/rtl8029.c
drivers/dpeth/3c501.c
drivers/dpeth/3c503.c
drivers/dpeth/3c509.c
drivers/dpeth/8390.c
drivers/dpeth/dp.c
drivers/dpeth/netbuff.c
drivers/e1000/e1000.c
drivers/filter/driver.c
drivers/filter/main.c
drivers/filter/sum.c
drivers/filter/util.c
drivers/floppy/floppy.c
drivers/fxp/fxp.c
drivers/lance/lance.c
drivers/libdriver/driver.c
drivers/log/diag.c
drivers/memory/memory.c
drivers/orinoco/orinoco.c
drivers/pci/pci.c
drivers/printer/printer.c
drivers/random/main.c
drivers/random/random.c
drivers/rtl8139/rtl8139.c
drivers/rtl8169/rtl8169.c
drivers/sb16/sb16.c
drivers/sb16/sb16_dsp.c
drivers/ti1225/ti1225.c
drivers/tty/console.c
drivers/tty/keyboard.c
drivers/tty/tty.c
drivers/tty/tty.h
include/minix/const.h
include/minix/devio.h
include/minix/sysutil.h
include/minix/type.h
kernel/arch/i386/arch_do_vmctl.c
kernel/arch/i386/exception.c
kernel/arch/i386/memory.c
kernel/arch/i386/mpx386.S
kernel/arch/i386/protect.c
kernel/arch/i386/watchdog.c
kernel/debug.c
kernel/debug.h
kernel/interrupt.c
kernel/main.c
kernel/proc.c
kernel/proto.h
kernel/system.c
kernel/system/do_irqctl.c
kernel/system/do_safecopy.c
kernel/system/do_sysctl.c
kernel/system/do_umap.c
kernel/system/do_vdevio.c
kernel/system/do_vmctl.c
kernel/utility.c
lib/libsys/Makefile
lib/libsys/alloc_util.c
lib/libsys/assert.c
lib/libsys/asynsend.c
lib/libsys/env_panic.c
lib/libsys/kprintf.c
lib/libsys/panic.c
lib/libsys/pci_attr_r16.c
lib/libsys/pci_attr_r32.c
lib/libsys/pci_attr_r8.c
lib/libsys/pci_attr_w16.c
lib/libsys/pci_attr_w32.c
lib/libsys/pci_attr_w8.c
lib/libsys/pci_del_acl.c
lib/libsys/pci_dev_name.c
lib/libsys/pci_find_dev.c
lib/libsys/pci_first_dev.c
lib/libsys/pci_ids.c
lib/libsys/pci_init1.c
lib/libsys/pci_next_dev.c
lib/libsys/pci_rescan_bus.c
lib/libsys/pci_reserve.c
lib/libsys/pci_set_acl.c
lib/libsys/pci_slot_name.c
lib/libsys/report.c [deleted file]
lib/libsys/sef.c
lib/libsys/sef_liveupdate.c
lib/libsys/timing.c
lib/libsys/tsc_util.c
lib/libsys/vprintf.c [new file with mode: 0644]
servers/ds/main.c
servers/ds/store.c
servers/hgfs/inode.c
servers/hgfs/main.c
servers/inet/inet.c
servers/is/dmp.c
servers/is/dmp_kernel.c
servers/is/dmp_vm.c
servers/is/main.c
servers/iso9660fs/device.c
servers/iso9660fs/main.c
servers/iso9660fs/proto.h
servers/iso9660fs/read.c
servers/iso9660fs/utility.c
servers/mfs/cache.c
servers/mfs/device.c
servers/mfs/inode.c
servers/mfs/link.c
servers/mfs/main.c
servers/mfs/mount.c
servers/mfs/open.c
servers/mfs/path.c
servers/mfs/read.c
servers/mfs/super.c
servers/mfs/utility.c
servers/mfs/write.c
servers/pfs/inode.c
servers/pfs/main.c
servers/pfs/utility.c
servers/pm/alarm.c
servers/pm/exec.c
servers/pm/forkexit.c
servers/pm/main.c
servers/pm/signal.c
servers/pm/time.c
servers/pm/timers.c
servers/pm/trace.c
servers/pm/utility.c
servers/rs/main.c
servers/rs/manager.c
servers/vfs/device.c
servers/vfs/dmap.c
servers/vfs/fs.h
servers/vfs/fscall.c
servers/vfs/lock.c
servers/vfs/main.c
servers/vfs/misc.c
servers/vfs/mount.c
servers/vfs/path.c
servers/vfs/pipe.c
servers/vfs/proto.h
servers/vfs/read.c
servers/vfs/request.c
servers/vfs/select.c
servers/vfs/stadir.c
servers/vfs/timers.c
servers/vfs/utility.c
servers/vfs/vnode.c
servers/vm/alloc.c
servers/vm/break.c
servers/vm/exec.c
servers/vm/fork.c
servers/vm/i386/pagetable.c
servers/vm/main.c
servers/vm/map_mem.c
servers/vm/mmap.c
servers/vm/pagefaults.c
servers/vm/region.c
servers/vm/sanitycheck.h
servers/vm/signal.c
servers/vm/slaballoc.c
servers/vm/util.h
servers/vm/utility.c
test/safecopy/inc.h
test/safemap/inc.h
test/safeperf/inc.h
test/safeperf/requestor.c

index 7457941e9658377c3a8514d05013b9551730916f..7716dcac6e33b832980be4343561592efbb59b7b 100644 (file)
@@ -78,7 +78,7 @@ int main(void)
 
                r= sef_receive(ANY, &m);
                if (r != OK)
-                       panic(__FILE__, "sef_receive failed", r);
+                       panic("sef_receive failed: %d", r);
                if (is_notify(m.m_type)) {
                        if (_ENDPOINT_P(m.m_source) == PM_PROC_NR) {
                                do_pm_notify(&m);
@@ -247,7 +247,7 @@ static void init_domain(int index)
        size= 0x100000 / 8;
        table= alloc_contig(size, AC_ALIGN4K, &busaddr);
        if (table == NULL)
-               panic("AMDDEV","malloc failed", NO_NUM);
+               panic("malloc failed");
        if (index == 0)
        {
                memset(table, 0, size);
index fb26cd917e774ca876c9993ada221fa812fc65cf..723f2b4369fb63fd242bea553e9b2950695dff91 100644 (file)
@@ -270,7 +270,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
   sa.sa_handler = SIG_MESS;
   sigemptyset(&sa.sa_mask);
   sa.sa_flags = 0;
-  if (sigaction(SIGTERM,&sa,NULL)<0) panic("AT","sigaction failed", errno);
+  if (sigaction(SIGTERM,&sa,NULL)<0) panic("sigaction failed: %d", errno);
 
   /* Set special disk parameters. */
   init_params();
@@ -306,7 +306,7 @@ PRIVATE void init_params()
   w_identify_wakeup_ticks = wakeup_secs * system_hz;
 
   if(atapi_debug)
-       panic("at_wini", "atapi_debug", NO_NUM);
+       panic("atapi_debug");
 
   if(w_identify_wakeup_ticks <= 0) {
        printf("changing wakeup from %d to %d ticks.\n",
@@ -330,7 +330,7 @@ PRIVATE void init_params()
          /* Get the number of drives from the BIOS data area */
          s=sys_readbios(NR_HD_DRIVES_ADDR, params, NR_HD_DRIVES_SIZE);
          if (s != OK)
-               panic(w_name(), "Couldn't read BIOS", s);
+               panic("Couldn't read BIOS: %d", s);
          if ((nr_drives = params[0]) > 2) nr_drives = 2;
 
          for (drive = 0, wn = wini; drive < COMPAT_DRIVES; drive++, wn++) {
@@ -342,13 +342,13 @@ PRIVATE void init_params()
                        BIOS_HD1_PARAMS_SIZE;
                    s=sys_readbios(vector, parv, size);
                    if (s != OK)
-                       panic(w_name(), "Couldn't read BIOS", s);
+                       panic("Couldn't read BIOS: %d", s);
        
                    /* Calculate the address of the parameters and copy them */
                    s=sys_readbios(hclick_to_physb(parv[1]) + parv[0],
                        params, 16L);
                    if (s != OK)
-                       panic(w_name(),"Couldn't copy parameters", s);
+                       panic("Couldn't copy parameters: %d", s);
        
                    /* Copy the parameters to the structures of the drive */
                    wn->lcylinders = bp_cylinders(params);
@@ -700,9 +700,7 @@ check_dma(struct wini *wn)
 
        if (dma_base) {
                if (sys_inb(dma_base + DMA_STATUS, &dma_status) != OK) {
-                       panic(w_name(),
-                               "unable to read DMA status register",
-                               NO_NUM);
+                       panic("unable to read DMA status register");
                }
        }
 
@@ -796,7 +794,7 @@ PRIVATE int w_identify()
 
        /* Device information. */
        if ((s=sys_insw(wn->base_cmd + REG_DATA, SELF, tmp_buf, SECTOR_SIZE)) != OK)
-               panic(w_name(),"Call to sys_insw() failed", s);
+               panic("Call to sys_insw() failed: %d", s);
 
 #if 0
        if (id_word(0) & ID_GEN_NOT_ATA)
@@ -869,7 +867,7 @@ PRIVATE int w_identify()
 
        /* Device information. */
        if ((s=sys_insw(wn->base_cmd + REG_DATA, SELF, tmp_buf, 512)) != OK)
-               panic(w_name(),"Call to sys_insw() failed", s);
+               panic("Call to sys_insw() failed: %d", s);
 
        size = 0;       /* Size set later. */
        check_dma(wn);
@@ -906,9 +904,9 @@ PRIVATE int w_identify()
          wn->irq = w_drive < 2 ? AT_WINI_0_IRQ : AT_WINI_1_IRQ;
          wn->irq_hook_id = wn->irq;    /* id to be returned if interrupt occurs */
          if ((s=sys_irqsetpolicy(wn->irq, IRQ_REENABLE, &wn->irq_hook_id)) != OK) 
-               panic(w_name(), "couldn't set IRQ policy", s);
+               panic("couldn't set IRQ policy: %d", s);
          if ((s=sys_irqenable(&wn->irq_hook_id)) != OK)
-               panic(w_name(), "couldn't enable IRQ line", s);
+               panic("couldn't enable IRQ line: %d", s);
   }
   wn->state |= IDENTIFIED;
   return(OK);
@@ -963,13 +961,13 @@ PRIVATE int w_io_test(void)
 
        /* Try I/O on the actual drive (not any (sub)partition). */
        if (w_prepare(w_drive * DEV_PER_DRIVE) == NIL_DEV)
-               panic(w_name(), "Couldn't switch devices", NO_NUM);
+               panic("Couldn't switch devices");
 
        r = w_transfer(SELF, DEV_GATHER_S, cvu64(0), &iov, 1);
 
        /* Switch back. */
        if (w_prepare(save_dev) == NIL_DEV)
-               panic(w_name(), "Couldn't switch back devices", NO_NUM);
+               panic("Couldn't switch back devices");
 
        /* Restore parameters. */
        timeout_ticks = save_timeout;
@@ -1108,7 +1106,7 @@ PRIVATE void stop_dma(struct wini *wn)
 
        /* Stop bus master operation */
        r= sys_outb(wn->base_dma + DMA_COMMAND, 0);
-       if (r != 0) panic("at_wini", "stop_dma: sys_outb failed", r);
+       if (r != 0) panic("stop_dma: sys_outb failed: %d", r);
 }
 
 PRIVATE void start_dma(struct wini *wn, int do_write)
@@ -1124,7 +1122,7 @@ PRIVATE void start_dma(struct wini *wn, int do_write)
                v |= DMA_CMD_WRITE;     
        }
        r= sys_outb(wn->base_dma + DMA_COMMAND, v);
-       if (r != 0) panic("at_wini", "start_dma: sys_outb failed", r);
+       if (r != 0) panic("start_dma: sys_outb failed: %d", r);
 }
 
 PRIVATE int error_dma(struct wini *wn)
@@ -1140,7 +1138,7 @@ PRIVATE int error_dma(struct wini *wn)
        return 1;       \
 
        r= sys_inb(wn->base_dma + DMA_STATUS, &v);
-       if (r != 0) panic("at_wini", "w_transfer: sys_inb failed", r);
+       if (r != 0) panic("w_transfer: sys_inb failed: %d", r);
 
        if (!wn->dma_intseen) {
                /* DMA did not complete successfully */
@@ -1234,7 +1232,7 @@ unsigned nr_req;          /* length of request vector */
                 * way to implement this wait.
                 */
                if (sys_inb((wn->base_ctl+REG_CTL_ALTSTAT), &w_status) != OK)
-                       panic(w_name(), "couldn't get status", NO_NUM);
+                       panic("couldn't get status");
        }
 
        if (do_dma) {
@@ -1281,11 +1279,8 @@ unsigned nr_req;         /* length of request vector */
                                   s= sys_safecopyto(proc_nr, iov->iov_addr,
                                        addr_offset,
                                        (vir_bytes)dma_buf+dma_buf_offset, n, D);
-                                  if (s != OK)
-                                  {
-                                       panic(w_name(),
-                                       "w_transfer: sys_vircopy failed",
-                                               s);
+                                  if (s != OK) {
+                                               panic("w_transfer: sys_vircopy failed: %d",                                             s);
                                   }
                                } else {
                                   memcpy((char *) iov->iov_addr + addr_offset,
@@ -1317,11 +1312,8 @@ unsigned nr_req;         /* length of request vector */
                                if (w_wn->w_status & STATUS_DRQ) {
                                        if ((s=sys_insw(wn->base_cmd+REG_DATA,
                                                SELF, tmp_buf,
-                                               SECTOR_SIZE)) != OK)
-                                       {
-                                               panic(w_name(),
-                                               "Call to sys_insw() failed",
-                                                       s);
+                                               SECTOR_SIZE)) != OK) {
+                                               panic("Call to sys_insw() failed: %d", s);
                                        }
                                }
                                break;
@@ -1346,7 +1338,7 @@ unsigned nr_req;          /* length of request vector */
                                        SECTOR_SIZE);
                   }
                   if(s != OK) {
-                       panic(w_name(),"Call to sys_insw() failed", s);
+                       panic("Call to sys_insw() failed: %d", s);
                   }
                } else {
                   if(proc_nr != SELF) {
@@ -1360,7 +1352,7 @@ unsigned nr_req;          /* length of request vector */
                   }
 
                   if(s != OK) {
-                       panic(w_name(),"Call to sys_outsw() failed", s);
+                       panic("Call to sys_outsw() failed: %d", s);
                   }
 
                   /* Data sent, wait for an interrupt. */
@@ -1415,7 +1407,7 @@ struct command *cmd;              /* Command block */
 
   /* Select drive. */
   if ((s=sys_outb(base_cmd + REG_LDH, cmd->ldh)) != OK)
-       panic(w_name(),"Couldn't write register to select drive",s);
+       panic("Couldn't write register to select drive: %d", s);
 
   if (!w_waitfor(STATUS_BSY, 0)) {
        printf("%s: com_out: drive not ready\n", w_name());
@@ -1439,7 +1431,7 @@ struct command *cmd;              /* Command block */
   pv_set(outbyte[5], base_cmd + REG_CYL_HI, cmd->cyl_hi);
   pv_set(outbyte[6], base_cmd + REG_COMMAND, cmd->command);
   if ((s=sys_voutb(outbyte,7)) != OK)
-       panic(w_name(),"Couldn't write registers with sys_voutb()",s);
+       panic("Couldn't write registers with sys_voutb(): %d", s);
   return(OK);
 }
 
@@ -1466,7 +1458,7 @@ struct command *cmd;              /* Command block */
 
   /* Select drive. */
   if ((s=sys_outb(base_cmd + REG_LDH, cmd->ldh)) != OK)
-       panic(w_name(),"Couldn't write register to select drive",s);
+       panic("Couldn't write register to select drive: %d", s);
 
   if (!w_waitfor(STATUS_BSY, 0)) {
        printf("%s: com_out: drive not ready\n", w_name());
@@ -1493,7 +1485,7 @@ struct command *cmd;              /* Command block */
   pv_set(outbyte[8], base_cmd + REG_CYL_HI, cmd->cyl_hi);
   pv_set(outbyte[9], base_cmd + REG_COMMAND, cmd->command);
   if ((s=sys_voutb(outbyte, 10)) != OK)
-       panic(w_name(),"Couldn't write registers with sys_voutb()",s);
+       panic("Couldn't write registers with sys_voutb(): %d", s);
 
   return(OK);
 }
@@ -1538,21 +1530,19 @@ int *do_copyoutp;
                if (n > size)
                        n= size;
                if (n == 0 || (n & 1))
-                       panic("at_wini", "bad size in iov", iov[i].iov_size);
+                       panic("bad size in iov: %d", iov[i].iov_size);
                if(proc_nr != SELF) {
                        r= sys_umap(proc_nr, VM_GRANT, iov[i].iov_addr, n,
                                &user_phys);
                        if (r != 0)
-                               panic("at_wini",
-                                       "can't map user buffer (VM_GRANT)", r);
+                               panic("can't map user buffer (VM_GRANT): %d", r);
                        user_phys += offset + addr_offset;
                } else {
                        r= sys_umap(proc_nr, VM_D,
                                iov[i].iov_addr+offset+addr_offset, n,
                                &user_phys);
                        if (r != 0)
-                               panic("at_wini",
-                                       "can't map user buffer (VM_D)", r);
+                               panic("can't map user buffer (VM_D): %d", r);
                }
                if (user_phys & 1)
                {
@@ -1598,7 +1588,7 @@ int *do_copyoutp;
        if (!bad)
        {
                if (j <= 0 || j > N_PRDTE)
-                       panic("at_wini", "bad prdt index", j);
+                       panic("bad prdt index: %d", j);
                prdt[j-1].prdte_flags |= PRDTE_FL_EOT;
 
           if(verbose) {
@@ -1639,10 +1629,8 @@ int *do_copyoutp;
                                  r= sys_safecopyfrom(proc_nr, iov->iov_addr,
                                        addr_offset, (vir_bytes)dma_buf+offset,
                                        n, D);
-                                 if (r != OK)
-                                 {
-                                       panic(w_name(),
-                                       "setup_dma: sys_vircopy failed", r);
+                                 if (r != OK) { 
+                                       panic("setup_dma: sys_vircopy failed: %d", r);
                                  }
                                } else {
                                  memcpy(dma_buf + offset,
@@ -1659,22 +1647,17 @@ int *do_copyoutp;
                if (phys & 1)
                {
                        /* Two byte alignment is required */
-                       panic("at_wini", "bad buffer alignment in setup_dma",
-                               phys);
+                       panic("bad buffer alignment in setup_dma: 0x%lx", phys);
                }
                for (j= 0; j<N_PRDTE; i++)
                {
-                       if (size == 0)
-                       {
-                               panic("at_wini", "bad size in setup_dma",
-                                       size);
+                       if (size == 0) {
+                               panic("bad size in setup_dma: %d", size);
                        }
                        if (size & 1)
                        {
                                /* Two byte alignment is required for size */
-                               panic("at_wini",
-                                       "bad size alignment in setup_dma",
-                                       size);
+                               panic("bad size alignment in setup_dma: %d", size);
                        }
                        n= size;
 
@@ -1696,7 +1679,7 @@ int *do_copyoutp;
                        }
                }
                if (size != 0)
-                       panic("at_wini", "size to large for prdt", NO_NUM);
+                       panic("size to large for prdt");
 
           if(verbose) {
                for (i= 0; i<=j; i++)
@@ -1710,18 +1693,18 @@ int *do_copyoutp;
 
        /* Verify that the bus master is not active */
        r= sys_inb(wn->base_dma + DMA_STATUS, &v);
-       if (r != 0) panic("at_wini", "setup_dma: sys_inb failed", r);
+       if (r != 0) panic("setup_dma: sys_inb failed: %d", r);
        if (v & DMA_ST_BM_ACTIVE)
-               panic("at_wini", "Bus master IDE active", NO_NUM);
+               panic("Bus master IDE active");
 
        if (prdt_phys & 3)
-               panic("at_wini", "prdt not aligned", prdt_phys);
+               panic("prdt not aligned: %d", prdt_phys);
        r= sys_outl(wn->base_dma + DMA_PRDTP, prdt_phys);
-       if (r != 0) panic("at_wini", "setup_dma: sys_outl failed", r);
+       if (r != 0) panic("setup_dma: sys_outl failed: %d", r);
 
        /* Clear interrupt and error flags */
        r= sys_outb(wn->base_dma + DMA_STATUS, DMA_ST_INT | DMA_ST_ERROR);
-       if (r != 0) panic("at_wini", "setup_dma: sys_outb failed", r);
+       if (r != 0) panic("setup_dma: sys_outb failed: %d", r);
 
 }
 
@@ -1825,10 +1808,10 @@ PRIVATE int w_reset()
 
   /* Strobe reset bit */
   if ((s=sys_outb(wn->base_ctl + REG_CTL, CTL_RESET)) != OK)
-       panic(w_name(),"Couldn't strobe reset bit",s);
+       panic("Couldn't strobe reset bit: %d", s);
   tickdelay(DELAY_TICKS);
   if ((s=sys_outb(wn->base_ctl + REG_CTL, 0)) != OK)
-       panic(w_name(),"Couldn't strobe reset bit",s);
+       panic("Couldn't strobe reset bit: %d", s);
   tickdelay(DELAY_TICKS);
 
   /* Wait for controller ready */
@@ -1870,7 +1853,7 @@ PRIVATE void w_intr_wait()
        while (w_wn->w_status & (STATUS_ADMBSY|STATUS_BSY)) {
                int rr;
                if((rr=sef_receive(ANY, &m)) != OK)
-                       panic("at_wini", "sef_receive(ANY) failed", rr);
+                       panic("sef_receive(ANY) failed: %d", rr);
                if (is_notify(m.m_type)) {
                        switch (_ENDPOINT_P(m.m_source)) {
                                case CLOCK:
@@ -1882,8 +1865,7 @@ PRIVATE void w_intr_wait()
                                        r= sys_inb(w_wn->base_cmd +
                                                        REG_STATUS, &w_status);
                                        if (r != 0)
-                                               panic("at_wini",
-                                                       "sys_inb failed", r);
+                                               panic("sys_inb failed: %d", r);
                                        w_wn->w_status= w_status;
                                        ack_irqs(m.NOTIFY_ARG);
                                        break;
@@ -1923,7 +1905,7 @@ PRIVATE int at_intr_wait()
        r = OK;
   } else {
        if ((s=sys_inb(w_wn->base_cmd + REG_ERROR, &inbval)) != OK)
-               panic(w_name(),"Couldn't read register",s);
+               panic("Couldn't read register: %d", s);
        if ((w_wn->w_status & STATUS_ERR) && (inbval & ERROR_BB)) {
                r = ERR_BAD_SECTOR;     /* sector marked bad, retries won't help */
        } else {
@@ -1953,7 +1935,7 @@ int value;                        /* required status */
   getuptime(&t0);
   do {
        if ((s=sys_inb(w_wn->base_cmd + REG_STATUS, &w_status)) != OK)
-               panic(w_name(),"Couldn't read register",s);
+               panic("Couldn't read register: %d", s);
        w_wn->w_status= w_status;
        if ((w_wn->w_status & mask) == value) {
                return 1;
@@ -1984,7 +1966,7 @@ int value;                        /* required status */
   getuptime(&t0);
   do {
        if ((s=sys_inb(w_wn->base_dma + DMA_STATUS, &w_status)) != OK)
-               panic(w_name(),"Couldn't read register",s);
+               panic("Couldn't read register: %d", s);
        if ((w_status & mask) == value) {
                return 1;
        }
@@ -2191,7 +2173,7 @@ unsigned nr_req;          /* length of request vector */
                        if (chunk > DMA_BUF_SIZE) chunk = DMA_BUF_SIZE;
                        if ((s=sys_insw(wn->base_cmd + REG_DATA,
                                SELF, tmp_buf, chunk)) != OK)
-                               panic(w_name(),"Call to sys_insw() failed", s);
+                               panic("Call to sys_insw() failed: %d", s);
                        before -= chunk;
                        count -= chunk;
                }
@@ -2210,7 +2192,7 @@ unsigned nr_req;          /* length of request vector */
                                        chunk);
                        }
                        if (s != OK)
-                               panic(w_name(),"Call to sys_insw() failed", s);
+                               panic("Call to sys_insw() failed: %d", s);
                        position= add64ul(position, chunk);
                        nbytes -= chunk;
                        count -= chunk;
@@ -2231,7 +2213,7 @@ unsigned nr_req;          /* length of request vector */
                        if (chunk > DMA_BUF_SIZE) chunk = DMA_BUF_SIZE;
                        if ((s=sys_insw(wn->base_cmd + REG_DATA,
                                SELF, tmp_buf, chunk)) != OK)
-                               panic(w_name(),"Call to sys_insw() failed", s);
+                               panic("Call to sys_insw() failed: %d", s);
                        count -= chunk;
                }
        }
@@ -2275,7 +2257,7 @@ int do_dma;
 
   /* Select Master/Slave drive */
   if ((s=sys_outb(wn->base_cmd + REG_DRIVE, wn->ldhpref)) != OK)
-       panic(w_name(),"Couldn't select master/ slave drive",s);
+       panic("Couldn't select master/ slave drive: %d", s);
 
   if (!w_waitfor(STATUS_BSY | STATUS_DRQ, 0)) {
        printf("%s: atapi_sendpacket: drive not ready\n", w_name());
@@ -2303,7 +2285,7 @@ int do_dma;
   pv_set(outbyte[5], wn->base_cmd + REG_COMMAND, w_command);
   if (atapi_debug) printf("cmd: %x  ", w_command);
   if ((s=sys_voutb(outbyte,6)) != OK)
-       panic(w_name(),"Couldn't write registers with sys_voutb()",s);
+       panic("Couldn't write registers with sys_voutb(): %d", s);
 
   if (!w_waitfor(STATUS_BSY | STATUS_DRQ, STATUS_DRQ)) {
        printf("%s: timeout (BSY|DRQ -> DRQ)\n", w_name());
@@ -2313,7 +2295,7 @@ int do_dma;
 
   /* Send the command packet to the device. */
   if ((s=sys_outsw(wn->base_cmd + REG_DATA, SELF, packet, ATAPI_PACKETSIZE)) != OK)
-       panic(w_name(),"sys_outsw() failed", s);
+       panic("sys_outsw() failed: %d", s);
 
   return(OK);
 }
@@ -2415,8 +2397,7 @@ PRIVATE void ack_irqs(unsigned int irqs)
                if (sys_inb((wini[drive].base_cmd + REG_STATUS),
                        &w_status) != OK)
                {
-                       panic(w_name(), "couldn't ack irq on drive %d\n",
-                               drive);
+                       panic("couldn't ack irq on drive: %d", drive);
                }
                wini[drive].w_status= w_status;
                sys_inb(wini[drive].base_dma + DMA_STATUS, &w_status);
@@ -2490,7 +2471,7 @@ PRIVATE int atapi_intr_wait(int do_dma, size_t max)
   inbyte[2].port = wn->base_cmd + REG_CNT_HI;
   inbyte[3].port = wn->base_cmd + REG_IRR;
   if ((s=sys_vinb(inbyte, 4)) != OK)
-       panic(w_name(),"ATAPI failed sys_vinb()", s);
+       panic("ATAPI failed sys_vinb(): %d", s);
   e = inbyte[0].value;
   len = inbyte[1].value;
   len |= inbyte[2].value << 8;
@@ -2549,7 +2530,7 @@ PRIVATE int at_voutb(int line, pvb_pair_t *pvb, int n)
   printf("at_wini%d: sys_voutb failed: %d pvb (%d):\n", w_instance, s, n);
   for(i = 0; i < n; i++)
        printf("%2d: %4x -> %4x\n", i, pvb[i].value, pvb[i].port);
-  panic(w_name(), "sys_voutb failed", NO_NUM);
+  panic("sys_voutb failed");
 }
 
 PRIVATE int at_vinb(int line, pvb_pair_t *pvb, int n)
@@ -2560,7 +2541,7 @@ PRIVATE int at_vinb(int line, pvb_pair_t *pvb, int n)
   printf("at_wini%d: sys_vinb failed: %d pvb (%d):\n", w_instance, s, n);
   for(i = 0; i < n; i++)
        printf("%2d: %4x\n", i, pvb[i].port);
-  panic(w_name(), "sys_vinb failed", NO_NUM);
+  panic("sys_vinb failed");
 }
 
 PRIVATE int at_out(int line, u32_t port, u32_t value,
@@ -2572,7 +2553,7 @@ PRIVATE int at_out(int line, u32_t port, u32_t value,
                return OK;
        printf("at_wini%d: line %d: %s failed: %d; %x -> %x\n", 
                w_instance, line, typename, s, value, port);
-        panic(w_name(), "sys_out failed", NO_NUM);
+        panic("sys_out failed");
 }
 
 
@@ -2585,7 +2566,7 @@ PRIVATE int at_in(int line, u32_t port, u32_t *value,
                return OK;
        printf("at_wini%d: line %d: %s failed: %d; port %x\n", 
                w_instance, line, typename, s, value, port);
-        panic(w_name(), "sys_in failed", NO_NUM);
+        panic("sys_in failed");
 }
 
 
index 48d5e9a3813f828e513c055d7a3aa880ef3749b4..48cf7b50524bbb81a4efb3348fd7b357d707d67b 100644 (file)
@@ -531,21 +531,21 @@ PRIVATE void atl2_init(int devind)
         */
        state.base = vm_map_phys(SELF, (void *) bar, ATL2_MMAP_SIZE);
        if (state.base == MAP_FAILED)
-               panic("atl2", "unable to map in registers", NO_NUM);
+               panic("unable to map in registers");
 
        if ((r = atl2_alloc_dma()) != OK)
-               panic("atl2", "unable to allocate DMA buffers", r);
+               panic("unable to allocate DMA buffers: %d", r);
 
        state.irq = pci_attr_r8(devind, PCI_ILR);
 
        if ((r = sys_irqsetpolicy(state.irq, 0, &state.hook_id)) != OK)
-               panic("atl2", "unable to register IRQ", r);
+               panic("unable to register IRQ: %d", r);
 
        if (!atl2_reset())
-               panic("atl2", "unable to reset hardware", NO_NUM);
+               panic("unable to reset hardware");
 
        if ((r = sys_irqenable(&state.hook_id)) != OK)
-               panic("atl2", "unable to enable IRQ", r);
+               panic("unable to enable IRQ: %d", r);
 
        atl2_get_hwaddr();
 
@@ -746,7 +746,7 @@ PRIVATE void atl2_reply(void)
                m.DL_COUNT));
 
        if ((r = send(state.task_endpt, &m)) != OK)
-               panic("atl2", "unable to reply", r);
+               panic("unable to reply: %d", r);
 
        state.flags &= ~(ATL2_FLAG_PACK_SENT | ATL2_FLAG_PACK_RCVD);
        state.recv_count = 0;
@@ -805,7 +805,7 @@ PRIVATE void atl2_readv(message *m, int from_int)
                r = sys_safecopyfrom(m->DL_PROC, m->DL_GRANT, off, 
                        (vir_bytes) iovec, batch * sizeof(iovec[0]), D);
                if (r != OK)
-                       panic("atl2", "vector copy failed", r);
+                       panic("vector copy failed: %d", r);
 
                /* Copy out each element in the batch, until we run out. */
                for (j = 0, iovp = iovec; j < batch && left > 0; j++, iovp++) {
@@ -814,7 +814,7 @@ PRIVATE void atl2_readv(message *m, int from_int)
                        r = sys_safecopyto(m->DL_PROC, iovp->iov_grant, 0,
                                (vir_bytes) pos, size, D);
                        if (r != OK)
-                               panic("atl2", "safe copy failed", r);
+                               panic("safe copy failed: %d", r);
 
                        pos += size;
                        left -= size;
@@ -908,7 +908,7 @@ PRIVATE void atl2_writev(message *m, int from_int)
                r = sys_safecopyfrom(m->DL_PROC, m->DL_GRANT, off, 
                        (vir_bytes) iovec, batch * sizeof(iovec[0]), D);
                if (r != OK)
-                       panic("atl2", "vector copy failed", r);
+                       panic("vector copy failed: %d", r);
 
                /* Copy in each element in the batch. */
                for (j = 0, iovp = iovec; j < batch; j++, iovp++) {
@@ -924,7 +924,7 @@ PRIVATE void atl2_writev(message *m, int from_int)
                                        (vir_bytes) (state.txd_base + pos),
                                        skip, D);
                                if (r != OK)
-                                       panic("atl2", "safe copy failed", r);
+                                       panic("safe copy failed: %d", r);
                                pos = 0;
                        }
 
@@ -932,7 +932,7 @@ PRIVATE void atl2_writev(message *m, int from_int)
                                (vir_bytes) (state.txd_base + pos),
                                size - skip, D);
                        if (r != OK)
-                               panic("atl2", "safe copy failed", r);
+                               panic("safe copy failed: %d", r);
 
                        pos = (pos + size - skip) % ATL2_TXD_BUFSIZE;
                        left -= size;
@@ -1029,7 +1029,7 @@ PRIVATE void atl2_intr(message *m)
        ATL2_WRITE_U32(ATL2_ISR_REG, 0);
 
        if ((r = sys_irqenable(&state.hook_id)) != OK)
-               panic("atl2", "unable to enable IRQ", r);
+               panic("unable to enable IRQ: %d", r);
 
        /* Attempt to satisfy pending write and read requests. */
        if (try_write)
@@ -1135,7 +1135,7 @@ PRIVATE void atl2_shutdown(void)
        atl2_stop();
 
        if ((r = sys_irqrmpolicy(&state.hook_id)) != OK)
-               panic("atl2", "unable to deregister IRQ", r);
+               panic("unable to deregister IRQ: %d", r);
 
        free_contig(state.txd_base, ATL2_TXD_BUFSIZE);
        free_contig(state.txs_base, ATL2_TXS_COUNT * sizeof(u32_t));
@@ -1251,7 +1251,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
        devind = atl2_probe(instance);
 
        if (devind < 0)
-               panic("atl2", "no matching device found", NO_NUM);
+               panic("no matching device found");
 
        /* Initialize the device. */
        atl2_init(devind);
@@ -1310,7 +1310,7 @@ int main(int argc, char **argv)
 
        while (TRUE) {
                if ((r = sef_receive(ANY, &m)) != OK)
-                       panic("atl2", "sef_receive failed", r);
+                       panic("sef_receive failed: %d", r);
 
                if (is_notify(m.m_type)) {
                        switch (m.m_source) {
index 0cfe34ce99ca28a105ba1095dcb1e5ba335de9df..e1bcce4c7ae58fb0db0a3765ec58a0e0db6d562b 100644 (file)
@@ -432,7 +432,7 @@ PUBLIC int sb16_inb(int port) {
        int s, value = -1;
 
        if ((s=sys_inb(port, &value)) != OK)
-               panic("SB16DSP","sys_inb() failed", s);
+               panic("sys_inb() failed: %d", s);
        
        return value;
 }
@@ -443,5 +443,5 @@ PUBLIC void sb16_outb(int port, int value) {
        int s;
        
        if ((s=sys_outb(port, value)) != OK)
-               panic("SB16DSP","sys_outb() failed", s);
+               panic("sys_outb() failed: %d", s);
 }
index fabf06e80ae9fb528ddc996457d57755617626ed..84f0572aed3b0437d228e3b64f535f5ec942db3c 100644 (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. */
index e53cd3437c459111350a1eaa2762a60f856ed57e..99481e310fcbccbf18c9860ee7ecc8921c6483b4 100644 (file)
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
   while (TRUE)
     {
       if ((r= sef_receive(ANY, &m)) != OK)
-       panic(str_DevName, "minix msg sef_receive failed", r);
+       panic("minix msg sef_receive failed: %d", r);
 
                if(is_notify(m.m_type)) {
                        switch(_ENDPOINT_P(m.m_source)) {
@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
        default:  
                printf("message 0x%lx; %d from %d\n",
                        m.m_type, m.m_type-DL_RQ_BASE, m.m_source);
-               panic(str_DevName, "illegal message", m.m_type);
+               panic("illegal message: %d", m.m_type);
        }
     }
 }
@@ -159,7 +159,7 @@ PRIVATE void do_get_stat_s(message * mp)
 
   port = mp->DL_PORT;
   if (port < 0 || port >= DE_PORT_NR)
-       panic(str_DevName, str_PortErrMsg, port);
+       panic(str_PortErrMsg, port);
 
   dep = &de_table[port];
   dep->de_client = mp->DL_PROC;
@@ -167,14 +167,14 @@ PRIVATE void do_get_stat_s(message * mp)
   if ((rc = sys_safecopyto(mp->DL_PROC, mp->DL_GRANT, 0,
                        (vir_bytes)&dep->de_stat,
                        (vir_bytes) sizeof(dep->de_stat), 0)) != OK)
-        panic(str_DevName, str_CopyErrMsg, rc);
+        panic(str_CopyErrMsg, rc);
 
   mp->m_type = DL_STAT_REPLY;
   mp->DL_PORT = port;
   mp->DL_STAT = OK;
   rc = send(mp->m_source, mp);
   if( rc != OK )
-    panic(str_DevName, str_StatErrMsg, rc);
+    panic(str_StatErrMsg, rc);
   return;
 }
 
@@ -244,7 +244,7 @@ PRIVATE void do_conf(message * mp)
    *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address;
   
   if (send(mp->m_source, &reply_mess) != OK)
-    panic(str_DevName, str_SendErrMsg, mp->m_source);
+    panic(str_SendErrMsg, mp->m_source);
 
   return;
 }
@@ -259,7 +259,7 @@ message *mp;
   mp->m_type= DL_NAME_REPLY;
   r = send(mp->m_source, mp);
   if (r!= OK)
-    panic(str_DevName, "do_getname: send failed", r);
+    panic("do_getname: send failed: %d", r);
 }
 
 PRIVATE void do_reply(dpeth_t * dep, int err, int may_block)
@@ -285,7 +285,7 @@ PRIVATE void do_reply(dpeth_t * dep, int err, int may_block)
   }
 
   if(status < 0)
-    panic(dep->de_name, str_SendErrMsg, status);
+    panic(str_SendErrMsg, status);
 
   dep->de_read_s = 0;
   dep->de_flags &= NOT(DEF_ACK_SEND | DEF_ACK_RECV);
@@ -325,7 +325,7 @@ PRIVATE int de_probe(dpeth_t *dep){
   dep->de_irq = pci_attr_r8(devind, PCI_ILR);
 
   if (dep->de_base_port < DE_MIN_BASE_ADDR)
-    panic(str_DevName,"de_probe: base address invalid ", dep->de_base_port);
+    panic("de_probe: base address invalid: %d", dep->de_base_port);
 
   DEBUG(printf("%s: using I/O address 0x%lx, IRQ %d\n",
               dep->de_name, (unsigned long)dep->de_base_port, 
@@ -443,7 +443,7 @@ PRIVATE void do_vread_s(message * mp, int from_int)
   iovec_dat_s_t *iovp = NULL;
 
   if (mp->DL_PORT < 0 || mp->DL_PORT >= DE_PORT_NR)
-    panic(dep->de_name, str_PortErrMsg, mp->DL_PORT);
+    panic(str_PortErrMsg, mp->DL_PORT);
 
   dep = &de_table[mp->DL_PORT];
   dep->de_client = mp->DL_PROC;
@@ -488,7 +488,7 @@ PRIVATE void do_vread_s(message * mp, int from_int)
     dep->de_read_iovec.iod_iovec_offset = 0;
     size = de_calc_iov_size(&dep->de_read_iovec);
     if (size < ETH_MAX_PACK_SIZE) 
-      panic(str_DevName, str_SizeErrMsg, size);
+      panic(str_SizeErrMsg, size);
 
     /* Copy buffer to user area  and clear ownage */
     size = (descr->descr->des[DES0]&DES0_FL)>>DES0_FL_SHIFT;
@@ -526,7 +526,7 @@ PRIVATE void do_vread_s(message * mp, int from_int)
       r= sys_safecopyto(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_grant, 0,
                        (vir_bytes)buffer, bytes, D);
       if (r != OK)
-       panic(str_DevName, str_CopyErrMsg, r);
+       panic(str_CopyErrMsg, r);
       buffer += bytes;
       
       if (++ix >= IOVEC_NR) {  /* Next buffer of IO vector */
@@ -624,7 +624,7 @@ PRIVATE void de_first_init(dpeth_t *dep)
       /* translate buffers physical address */
       r = sys_umap(SELF, VM_D, loc_descr->buf1, temp, 
                   &(loc_descr->descr->des[DES_BUF1]));
-      if(r != OK) panic(dep->de_name, "umap failed", r);      
+      if(r != OK) panic("umap failed: %d", r);      
       loc_descr->descr->des[DES_BUF2] = 0;
       memset(&loc_descr->descr->des[DES0],0,sizeof(u32_t));
       loc_descr->descr->des[DES1] = temp;
@@ -639,11 +639,11 @@ PRIVATE void de_first_init(dpeth_t *dep)
   /* record physical location of two first descriptor */
   r = sys_umap(SELF, VM_D, dep->descr[DESCR_RECV][0].descr, 
               sizeof(de_descr_t), &dep->sendrecv_descr_phys_addr[DESCR_RECV]);
-  if(r != OK) panic(str_DevName, str_UmapErrMsg, r);
+  if(r != OK) panic(str_UmapErrMsg, r);
 
   r = sys_umap(SELF, VM_D, dep->descr[DESCR_TRAN][0].descr,
               sizeof(de_descr_t), &dep->sendrecv_descr_phys_addr[DESCR_TRAN]);
-  if(r != OK) panic(str_DevName, str_UmapErrMsg, r);
+  if(r != OK) panic(str_UmapErrMsg, r);
 
   DEBUG(printf("Descr: head tran=[%08X] head recv=[%08X]\n",
               dep->sendrecv_descr_phys_addr[DESCR_TRAN],
@@ -656,12 +656,12 @@ PRIVATE void de_first_init(dpeth_t *dep)
       r = sys_umap(SELF, VM_D, &(loc_descr->descr), sizeof(de_descr_t), 
                   &temp);
       if(r != OK)
-       panic(str_DevName, str_UmapErrMsg, r);
+       panic(str_UmapErrMsg, r);
 
       if( ((loc_descr->descr->des[DES_BUF1] & 0x3) != 0) ||
          ((loc_descr->descr->des[DES_BUF2] & 0x3) != 0) ||
          ((temp&0x3)!=0) )
-       panic(str_DevName, str_AlignErrMsg, temp);
+       panic(str_AlignErrMsg, temp);
 
       loc_descr++;
     }
@@ -686,7 +686,7 @@ PRIVATE void do_interrupt(dpeth_t *dep){
   val = io_inl(CSR_ADDR(dep, CSR5));
 
   if(val & CSR5_AIS){
-    panic(dep->de_name, "Abnormal Int CSR5=", val);
+    panic("Abnormal Int CSR5=: %d", val);
   }
 
   if( (dep->de_flags & DEF_READING) && (val & CSR5_RI) ){
@@ -793,7 +793,7 @@ PRIVATE void de_get_userdata_s(int user_proc, cp_grant_id_t grant,
   len = (count > IOVEC_NR ? IOVEC_NR : count) * sizeof(iovec_t);
   rc = sys_safecopyfrom(user_proc, grant, 0, (vir_bytes)loc_addr, len, D);
   if (rc != OK)
-    panic(str_DevName, str_CopyErrMsg, rc);
+    panic(str_CopyErrMsg, rc);
   return;
 }
 
@@ -815,7 +815,7 @@ PRIVATE void do_vwrite_s(message * mp, int from_int){
   char *buffer = NULL;
 
   if( mp->DL_PORT < 0 || mp->DL_PORT >= DE_PORT_NR)    
-    panic(str_DevName, str_PortErrMsg, mp->DL_PORT);
+    panic(str_PortErrMsg, mp->DL_PORT);
 
   dep = &de_table[mp->DL_PORT];
   dep->de_client = mp->DL_PROC;
@@ -823,7 +823,7 @@ PRIVATE void do_vwrite_s(message * mp, int from_int){
   if (dep->de_mode == DEM_ENABLED) {
     
     if (!from_int && (dep->de_flags & DEF_SENDING))
-      panic(str_DevName, str_BusyErrMsg, NO_NUM);
+      panic(str_BusyErrMsg);
 
     descr = &dep->descr[DESCR_TRAN][dep->cur_descr[DESCR_TRAN]];
 
@@ -845,7 +845,7 @@ PRIVATE void do_vwrite_s(message * mp, int from_int){
     iovp->iod_iovec_offset = 0;
     totalsize = size = de_calc_iov_size(iovp);
     if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE)
-      panic(str_DevName, str_SizeErrMsg, size);
+      panic(str_SizeErrMsg, size);
 
     dep->bytes_tx += size;
     dep->de_stat.ets_packetT++;
@@ -859,7 +859,7 @@ PRIVATE void do_vwrite_s(message * mp, int from_int){
       r= sys_safecopyfrom(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_grant,
                          0, (vir_bytes)buffer, bytes, D);
       if (r != OK)
-       panic(str_DevName, str_CopyErrMsg, r);
+       panic(str_CopyErrMsg, r);
       buffer += bytes;
 
       if (++ix >= IOVEC_NR) {  
@@ -889,7 +889,7 @@ PRIVATE void do_vwrite_s(message * mp, int from_int){
 
  suspend:
   if(from_int)
-    panic(str_DevName, "should not happen", 0);
+    panic("should not happen: %d", 0);
 
   dep->de_stat.ets_transDef++;
   dep->de_flags |= DEF_SENDING;
index df5aba5d7827f1052709c6ca12fd71b83757bb51..6cda18a900abec77b9bc4f50a33b8f38b79e938e 100644 (file)
@@ -96,7 +96,7 @@ dpeth_t * dep;
   /* Set interrupt level for 3c503 */
   irq = (dep->de_irq &= ~DEI_DEFAULT); /* Strip the default flag. */
   if (irq == 9) irq = 2;
-  if (irq < 2 || irq > 5) panic("", "bad 3c503 irq configuration", irq);
+  if (irq < 2 || irq > 5) panic("bad 3c503 irq configuration: %d", irq);
   outb_el2(dep, EL2_IDCFG, (0x04 << irq));
 
   outb_el2(dep, EL2_DRQCNT, 0x08);     /* Set burst size to 8 */
index 3382c30d61fcd8b34b07bc3e5b9867a8360e6b90..6f2b6e495a2e01b0c09398ba41b6694ee5bf66ff 100644 (file)
@@ -220,10 +220,8 @@ PRIVATE int handle_hw_intr(void)
                        dp_check_ints(dep);
                        do_int(dep);
                        r= sys_irqenable(&dep->de_hook);
-                       if (r != OK)
-                       {
-                               panic("DP8390", 
-                                       "unable enable interrupts", r);
+                       if (r != OK) {
+                               panic("unable enable interrupts: %d", r);
                        }
                }
        }
@@ -252,7 +250,7 @@ int main(int argc, char *argv[])
        while (TRUE)
        {
                if ((r= sef_receive(ANY, &m)) != OK)
-                       panic("", "dp8390: sef_receive failed", r);
+                       panic("dp8390: sef_receive failed: %d", r);
 
                if (is_notify(m.m_type)) {
                        switch (_ENDPOINT_P(m.m_source)) {
@@ -274,8 +272,8 @@ int main(int argc, char *argv[])
                                        printf("dp8390: notify from CLOCK\n");
                                        break;
                                default:
-                                       panic("", "dp8390: illegal notify from",
-                                                               m.m_source);
+                                       panic("dp8390: illegal notify from: %d",
+                                               m.m_source);
                        }
 
                        /* done, get a new message */
@@ -296,7 +294,7 @@ int main(int argc, char *argv[])
                case DL_GETNAME: do_getname(&m);                break;
                case DL_STOP:   do_stop(&m);                    break;
                default:
-                       panic("", "dp8390: illegal message", m.m_type);
+                       panic("dp8390: illegal message: %d", m.m_type);
                }
        }
 }
@@ -328,10 +326,8 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
        system_hz = sys_hz();
 
-       if (env_argc < 1)
-       {
-               panic("DP8390",
-                       "A head which at this time has no name", NO_NUM);
+       if (env_argc < 1) {
+               panic("A head which at this time has no name");
        }
        (progname=strrchr(env_argv[0],'/')) ? progname++
                : (progname=env_argv[0]);
@@ -493,7 +489,7 @@ int vectored;
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= DE_PORT_NR)
-               panic("", "dp8390: illegal port", port);
+               panic("dp8390: illegal port: %d", port);
        dep= &de_table[port];
        dep->de_client= mp->DL_PROC;
 
@@ -507,13 +503,13 @@ int vectored;
        assert(dep->de_mode == DEM_ENABLED);
        assert(dep->de_flags & DEF_ENABLED);
        if (dep->de_flags & DEF_SEND_AVAIL)
-               panic("", "dp8390: send already in progress", NO_NUM);
+               panic("dp8390: send already in progress");
 
        sendq_head= dep->de_sendq_head;
        if (dep->de_sendq[sendq_head].sq_filled)
        {
                if (from_int)
-                       panic("", "dp8390: should not be sending\n", NO_NUM);
+                       panic("dp8390: should not be sending");
                dep->de_sendmsg= *mp;
                dep->de_flags |= DEF_SEND_AVAIL;
                reply(dep, OK, FALSE);
@@ -546,7 +542,7 @@ int vectored;
        }
        if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE_TAGGED)
        {
-               panic("", "dp8390: invalid packet size", size);
+               panic("dp8390: invalid packet size: %d", size);
        }
        (dep->de_user2nicf)(dep, &dep->de_write_iovec, 0,
                dep->de_sendq[sendq_head].sq_sendpage * DP_PAGESIZE,
@@ -594,7 +590,7 @@ int from_int;
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= DE_PORT_NR)
-               panic("", "dp8390: illegal port", port);
+               panic("dp8390: illegal port: %d", port);
        dep= &de_table[port];
        dep->de_client= mp->DL_PROC;
 
@@ -608,13 +604,13 @@ int from_int;
        assert(dep->de_mode == DEM_ENABLED);
        assert(dep->de_flags & DEF_ENABLED);
        if (dep->de_flags & DEF_SEND_AVAIL)
-               panic("", "dp8390: send already in progress", NO_NUM);
+               panic("dp8390: send already in progress");
 
        sendq_head= dep->de_sendq_head;
        if (dep->de_sendq[sendq_head].sq_filled)
        {
                if (from_int)
-                       panic("", "dp8390: should not be sending\n", NO_NUM);
+                       panic("dp8390: should not be sending");
                dep->de_sendmsg= *mp;
                dep->de_flags |= DEF_SEND_AVAIL;
                reply(dep, OK, FALSE);
@@ -636,7 +632,7 @@ int from_int;
 
        if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE_TAGGED)
        {
-               panic("", "dp8390: invalid packet size", size);
+               panic("dp8390: invalid packet size: %d", size);
        }
        (dep->de_user2nicf_s)(dep, &dep->de_write_iovec_s, 0,
                dep->de_sendq[sendq_head].sq_sendpage * DP_PAGESIZE,
@@ -684,7 +680,7 @@ int vectored;
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= DE_PORT_NR)
-               panic("", "dp8390: illegal port", port);
+               panic("dp8390: illegal port: %d", port);
        dep= &de_table[port];
        dep->de_client= mp->DL_PROC;
        if (dep->de_mode == DEM_SINK)
@@ -696,7 +692,7 @@ int vectored;
        assert(dep->de_flags & DEF_ENABLED);
 
        if(dep->de_flags & DEF_READING)
-               panic("", "dp8390: read already in progress", NO_NUM);
+               panic("dp8390: read already in progress");
 
        dep->de_safecopy_read= 0;
 
@@ -724,7 +720,7 @@ int vectored;
                size= count;
        }
        if (size < ETH_MAX_PACK_SIZE_TAGGED)
-               panic("", "dp8390: wrong packet size", size);
+               panic("dp8390: wrong packet size: %d", size);
        dep->de_flags |= DEF_READING;
 
        dp_recv(dep);
@@ -753,7 +749,7 @@ message *mp;
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= DE_PORT_NR)
-               panic("", "dp8390: illegal port", port);
+               panic("dp8390: illegal port: %d", port);
        dep= &de_table[port];
        dep->de_client= mp->DL_PROC;
        if (dep->de_mode == DEM_SINK)
@@ -767,7 +763,7 @@ message *mp;
        dep->de_safecopy_read= 1;
 
        if(dep->de_flags & DEF_READING)
-               panic("", "dp8390: read already in progress", NO_NUM);
+               panic("dp8390: read already in progress");
 
        get_userdata_s(mp->DL_PROC, mp->DL_GRANT, 0,
                (count > IOVEC_NR ? IOVEC_NR : count) *
@@ -782,7 +778,7 @@ message *mp;
        size= calc_iovec_size_s(&dep->de_tmp_iovec_s);
 
        if (size < ETH_MAX_PACK_SIZE_TAGGED)
-               panic("", "dp8390: wrong packet size", size);
+               panic("dp8390: wrong packet size: %d", size);
        dep->de_flags |= DEF_READING;
 
        dp_recv(dep);
@@ -893,7 +889,7 @@ message *mp;
 
        port = mp->DL_PORT;
        if (port < 0 || port >= DE_PORT_NR)
-               panic("", "dp8390: illegal port", port);
+               panic("dp8390: illegal port: %d", port);
        dep= &de_table[port];
        dep->de_client= mp->DL_PROC;
        if (dep->de_mode == DEM_SINK)
@@ -906,7 +902,7 @@ message *mp;
                mp->DL_STAT= OK;
                r= send(mp->m_source, mp);
                if (r != OK)
-                       panic(__FILE__, "do_getstat: send failed: %d\n", r);
+                       panic("do_getstat: send failed: %d", r);
                return;
        }
        assert(dep->de_mode == DEM_ENABLED);
@@ -924,7 +920,7 @@ message *mp;
        mp->DL_STAT= OK;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic(__FILE__, "do_getstat: send failed: %d\n", r);
+               panic("do_getstat: send failed: %d", r);
 }
 
 /*===========================================================================*
@@ -938,7 +934,7 @@ message *mp;
 
        port = mp->DL_PORT;
        if (port < 0 || port >= DE_PORT_NR)
-               panic("", "dp8390: illegal port", port);
+               panic("dp8390: illegal port: %d", port);
        dep= &de_table[port];
        dep->de_client= mp->DL_PROC;
        if (dep->de_mode == DEM_SINK)
@@ -951,7 +947,7 @@ message *mp;
                mp->DL_STAT= OK;
                r= send(mp->m_source, mp);
                if (r != OK)
-                       panic(__FILE__, "do_getstat: send failed: %d\n", r);
+                       panic("do_getstat: send failed: %d", r);
                return;
        }
        assert(dep->de_mode == DEM_ENABLED);
@@ -969,7 +965,7 @@ message *mp;
        mp->DL_STAT= OK;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic(__FILE__, "do_getstat: send failed: %d\n", r);
+               panic("do_getstat: send failed: %d", r);
 }
 
 /*===========================================================================*
@@ -985,7 +981,7 @@ message *mp;
        mp->m_type= DL_NAME_REPLY;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic("dp8390", "do_getname: send failed: %d\n", r);
+               panic("do_getname: send failed: %d", r);
 }
 
 /*===========================================================================*
@@ -1000,7 +996,7 @@ message *mp;
        port = mp->DL_PORT;
 
        if (port < 0 || port >= DE_PORT_NR)
-               panic("", "dp8390: illegal port", port);
+               panic("dp8390: illegal port: %d", port);
        dep= &de_table[port];
        if (dep->de_mode == DEM_SINK)
                return;
@@ -1141,12 +1137,12 @@ dpeth_t *dep;
        dep->de_hook = dep->de_irq;
        r= sys_irqsetpolicy(dep->de_irq, 0, &dep->de_hook);
        if (r != OK)
-               panic("DP8390", "sys_irqsetpolicy failed", r);
+               panic("sys_irqsetpolicy failed: %d", r);
 
        r= sys_irqenable(&dep->de_hook);
        if (r != OK)
        {
-               panic("DP8390", "unable enable interrupts", r);
+               panic("unable enable interrupts: %d", r);
        }
 }
 
@@ -1242,7 +1238,7 @@ dpeth_t *dep;
        int size, sendq_tail;
 
        if (!(dep->de_flags & DEF_ENABLED))
-               panic("", "dp8390: got premature interrupt", NO_NUM);
+               panic("dp8390: got premature interrupt");
 
        for(;;)
        {
@@ -1486,7 +1482,7 @@ dpeth_t *dep;
        case DL_WRITEV: do_vwrite(&dep->de_sendmsg, TRUE, TRUE);        break;
        case DL_WRITEV_S: do_vwrite_s(&dep->de_sendmsg, TRUE);  break;
        default:
-               panic("", "dp8390: wrong type", dep->de_sendmsg.m_type);
+               panic("dp8390: wrong type: %d", dep->de_sendmsg.m_type);
                break;
        }
 }
@@ -1662,7 +1658,7 @@ vir_bytes count;
                        iovp->iod_iovec[i].iov_addr + offset,
                        SELF, D, vir_hw, bytes);
                if (r != OK)
-                       panic("DP8390", "dp_user2nic: sys_vircopy failed", r);
+                       panic("dp_user2nic: sys_vircopy failed: %d", r);
 
                count -= bytes;
                vir_hw += bytes;
@@ -1709,10 +1705,8 @@ vir_bytes count;
                r= sys_safecopyfrom(iovp->iod_proc_nr,
                        iovp->iod_iovec[i].iov_grant, offset,
                        vir_hw, bytes, D);
-               if (r != OK)
-               {
-                       panic("DP8390",
-                               "dp_user2nic_s: sys_safecopyfrom failed", r);
+               if (r != OK) {
+                       panic("dp_user2nic_s: sys_safecopyfrom failed: %d", r);
                }
 
                count -= bytes;
@@ -1776,7 +1770,7 @@ vir_bytes count;
        }
        if (i == 100)
        {
-               panic("", "dp8390: remote dma failed to complete", NO_NUM);
+               panic("dp8390: remote dma failed to complete");
        }
 }
 
@@ -1822,11 +1816,9 @@ vir_bytes count;
 
                r= sys_safe_outsb(dep->de_data_port, iovp->iod_proc_nr,
                        iovp->iod_iovec[i].iov_grant, offset, bytes);
-               if (r != OK)
-               {
-                       panic(__FILE__,
-                               "dp_pio8_user2nic_s: sys_safe_outsb failed",
-                               r);
+               if (r != OK) {
+                               panic("dp_pio8_user2nic_s: sys_safe_outsb failed: %d",
+                                       r);
                }
                count -= bytes;
                offset += bytes;
@@ -1840,7 +1832,7 @@ vir_bytes count;
        }
        if (i == 100)
        {
-               panic("", "dp8390: remote dma failed to complete", NO_NUM);
+               panic("dp8390: remote dma failed to complete");
        }
 }
 
@@ -1896,10 +1888,8 @@ vir_bytes count;
                {
                        r= sys_vircopy(user_proc, D, vir_user, 
                                SELF, D, (vir_bytes)&two_bytes[1], 1);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                                       "dp_pio16_user2nic: sys_vircopy failed",
+                       if (r != OK) {
+                               panic("dp_pio16_user2nic: sys_vircopy failed: %d",
                                        r);
                        }
                        outw(dep->de_data_port, *(u16_t *)two_bytes);
@@ -1926,10 +1916,8 @@ vir_bytes count;
                        assert(bytes == 1);
                        r= sys_vircopy(user_proc, D, vir_user, 
                                SELF, D, (vir_bytes)&two_bytes[0], 1);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                                       "dp_pio16_user2nic: sys_vircopy failed",
+                       if (r != OK) { 
+                               panic("dp_pio16_user2nic: sys_vircopy failed: %d",
                                        r);
                        }
                        count--;
@@ -1951,7 +1939,7 @@ vir_bytes count;
        }
        if (i == 100)
        {
-               panic("", "dp8390: remote dma failed to complete", NO_NUM);
+               panic("dp8390: remote dma failed to complete");
        }
 }
 
@@ -2007,11 +1995,8 @@ vir_bytes count;
                {
                        r= sys_safecopyfrom(user_proc, gid, offset, 
                                (vir_bytes)&two_bytes[1], 1, D);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                               "dp_pio16_user2nic: sys_safecopyfrom failed",
-                                       r);
+                       if (r != OK) { 
+                               panic("dp_pio16_user2nic: sys_safecopyfrom failed: %d", r);
                        }
                        outw(dep->de_data_port, *(u16_t *)two_bytes);
                        count--;
@@ -2026,11 +2011,8 @@ vir_bytes count;
                {
                        r= sys_safe_outsw(dep->de_data_port, user_proc,
                                gid, offset, ecount);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                               "dp_pio16_user2nic: sys_safe_outsw failed",
-                                       r);
+                       if (r != OK) {
+                               panic("dp_pio16_user2nic: sys_safe_outsw failed: %d", r);
                        }
                        count -= ecount;
                        offset += ecount;
@@ -2041,11 +2023,8 @@ vir_bytes count;
                        assert(bytes == 1);
                        r= sys_safecopyfrom(user_proc, gid, offset,
                                (vir_bytes)&two_bytes[0], 1, D);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                               "dp_pio16_user2nic: sys_safecopyfrom failed",
-                                       r);
+                       if (r != OK) {
+                               panic("dp_pio16_user2nic: sys_safecopyfrom failed: %d", r);
                        }
                        count--;
                        offset++;
@@ -2065,7 +2044,7 @@ vir_bytes count;
        }
        if (i == 100)
        {
-               panic("", "dp8390: remote dma failed to complete", NO_NUM);
+               panic("dp8390: remote dma failed to complete");
        }
 }
 
@@ -2107,7 +2086,7 @@ vir_bytes count;
                        iovp->iod_proc_nr, D,
                        iovp->iod_iovec[i].iov_addr + offset, bytes);
                if (r != OK)
-                       panic("DP8390", "dp_nic2user: sys_vircopy failed", r);
+                       panic("dp_nic2user: sys_vircopy failed: %d", r);
 
                count -= bytes;
                vir_hw += bytes;
@@ -2155,8 +2134,7 @@ vir_bytes count;
                        iovp->iod_iovec[i].iov_grant, offset,
                        vir_hw, bytes, D);
                if (r != OK)
-                       panic("DP8390",
-                               "dp_nic2user_s: sys_safecopyto failed", r);
+                       panic("dp_nic2user_s: sys_safecopyto failed: %d", r);
 
                count -= bytes;
                vir_hw += bytes;
@@ -2251,10 +2229,8 @@ vir_bytes count;
 
                r= sys_safe_insb(dep->de_data_port, iovp->iod_proc_nr,
                        iovp->iod_iovec[i].iov_grant, offset, bytes);
-               if (r != OK)
-               {
-                       panic(__FILE__,
-                               "dp_pio8_nic2user_s: sys_safe_insb failed", r);
+               if (r != OK) {
+                       panic("dp_pio8_nic2user_s: sys_safe_insb failed: %d", r);
                }
                count -= bytes;
                offset += bytes;
@@ -2313,10 +2289,8 @@ vir_bytes count;
                {
                        r= sys_vircopy(SELF, D, (vir_bytes)&two_bytes[1],
                                user_proc, D, vir_user,  1);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                                       "dp_pio16_nic2user: sys_vircopy failed",
+                       if (r != OK) {
+                               panic("dp_pio16_nic2user: sys_vircopy failed: %d",
                                        r);
                        }
                        count--;
@@ -2343,11 +2317,8 @@ vir_bytes count;
                        *(u16_t *)two_bytes= inw(dep->de_data_port);
                        r= sys_vircopy(SELF, D, (vir_bytes)&two_bytes[0],
                                user_proc, D, vir_user,  1);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                                       "dp_pio16_nic2user: sys_vircopy failed",
-                                       r);
+                       if (r != OK) {
+                               panic("dp_pio16_nic2user: sys_vircopy failed: %d", r);
                        }
                        count--;
                        offset++;
@@ -2410,11 +2381,8 @@ vir_bytes count;
                {
                        r= sys_safecopyto(user_proc, gid, offset,
                                (vir_bytes)&two_bytes[1], 1, D);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                               "dp_pio16_nic2user: sys_safecopyto failed",
-                                       r);
+                       if (r != OK) {
+                               panic("dp_pio16_nic2user: sys_safecopyto failed: %d", r);
                        }
                        count--;
                        offset++;
@@ -2428,11 +2396,9 @@ vir_bytes count;
                {
                        r= sys_safe_insw(dep->de_data_port, user_proc, gid,
                                offset, ecount);
-                       if (r != OK)
-                       {
-                               panic("DP8390",
-                               "dp_pio16_nic2user: sys_safe_insw failed",
-                                       r);
+                       if (r != OK) {
+                               panic("dp_pio16_nic2user: sys_safe_insw failed: %d",
+                               r);
                        }
                        count -= ecount;
                        offset += ecount;
@@ -2446,8 +2412,7 @@ vir_bytes count;
                                (vir_bytes)&two_bytes[0], 1, D);
                        if (r != OK)
                        {
-                               panic("DP8390",
-                               "dp_pio16_nic2user: sys_safecopyto failed",
+                               panic("dp_pio16_nic2user: sys_safecopyto failed: %d",
                                        r);
                        }
                        count--;
@@ -2602,7 +2567,7 @@ dpeth_t *dep;
                                                 */
        buf= malloc(size);
        if (buf == NULL)
-               panic(__FILE__, "map_hw_buffer: cannot malloc size", size);
+               panic("map_hw_buffer: cannot malloc size: %d", size);
        o= I386_PAGE_SIZE - ((vir_bytes)buf % I386_PAGE_SIZE);
        abuf= buf + o;
        printf("buf at 0x%x, abuf at 0x%x\n", buf, abuf);
@@ -2614,7 +2579,7 @@ dpeth_t *dep;
        r = ENOSYS;
 #endif
        if (r != OK)
-               panic(__FILE__, "map_hw_buffer: sys_vm_map failed", r);
+               panic("map_hw_buffer: sys_vm_map failed: %d", r);
        dep->de_locmem = abuf;
 }
 
@@ -2709,7 +2674,7 @@ int may_block;
        }
 
        if (r < 0)
-               panic("", "dp8390: send failed:", r);
+               panic("dp8390: send failed: %d", r);
        
        dep->de_read_s = 0;
        dep->de_flags &= ~(DEF_PACK_SEND | DEF_PACK_RECV);
@@ -2723,7 +2688,7 @@ message *req;
 message *reply_mess;
 {
        if (send(req->m_source, reply_mess) != OK)
-               panic("", "dp8390: unable to mess_reply", NO_NUM);
+               panic("dp8390: unable to mess_reply");
 }
 
 /*===========================================================================*
@@ -2740,7 +2705,7 @@ void *loc_addr;
        r= sys_vircopy(user_proc, D, user_addr,
                SELF, D, (vir_bytes)loc_addr, count);
        if (r != OK)
-               panic("DP8390", "get_userdata: sys_vircopy failed", r);
+               panic("get_userdata: sys_vircopy failed: %d", r);
 }
 
 /*===========================================================================*
@@ -2758,7 +2723,7 @@ void *loc_addr;
        r= sys_safecopyfrom(user_proc, grant, offset,
                (vir_bytes)loc_addr, count, D);
        if (r != OK)
-               panic("DP8390", "get_userdata: sys_safecopyfrom failed", r);
+               panic("get_userdata: sys_safecopyfrom failed: %d", r);
 }
 
 /*===========================================================================*
@@ -2775,7 +2740,7 @@ void *loc_addr;
        r= sys_vircopy(SELF, D, (vir_bytes)loc_addr, 
                user_proc, D, user_addr, count);
        if (r != OK)
-               panic("DP8390", "put_userdata: sys_vircopy failed", r);
+               panic("put_userdata: sys_vircopy failed: %d", r);
 }
 
 /*===========================================================================*
@@ -2792,7 +2757,7 @@ void *loc_addr;
        r= sys_safecopyto(user_proc, grant, 0, (vir_bytes)loc_addr, 
                count, D);
        if (r != OK)
-               panic("DP8390", "put_userdata: sys_safecopyto failed", r);
+               panic("put_userdata: sys_safecopyto failed: %d", r);
 }
 
 u8_t inb(port_t port)
@@ -2804,7 +2769,7 @@ u8_t inb(port_t port)
        if (r != OK)
        {
                printf("inb failed for port 0x%x\n", port);
-               panic("DP8390","sys_inb failed", r);
+               panic("sys_inb failed: %d", r);
        }
        return value;
 }
@@ -2816,7 +2781,7 @@ u16_t inw(port_t port)
 
        r= sys_inw(port, &value);
        if (r != OK)
-               panic("DP8390", "sys_inw failed", r);
+               panic("sys_inw failed: %d", r);
        return (u16_t) value;
 }
 
@@ -2826,7 +2791,7 @@ void outb(port_t port, u8_t value)
 
        r= sys_outb(port, value);
        if (r != OK)
-               panic("DP8390", "sys_outb failed", r);
+               panic("sys_outb failed: %d", r);
 }
 
 void outw(port_t port, u16_t value)
@@ -2835,7 +2800,7 @@ void outw(port_t port, u16_t value)
 
        r= sys_outw(port, value);
        if (r != OK)
-               panic("DP8390", "sys_outw failed", r);
+               panic("sys_outw failed: %d", r);
 }
 
 static void insb(port_t port, void *buf, size_t size)
@@ -2854,7 +2819,7 @@ static void do_vir_insb(port_t port, int proc, vir_bytes buf, size_t size)
 
        r= sys_insb(port, proc, (void *) buf, size);
        if (r != OK)
-               panic("DP8390", "sys_sdevio failed", r);
+               panic("sys_sdevio failed: %d", r);
 }
 
 static void do_vir_insw(port_t port, int proc, vir_bytes buf, size_t size)
@@ -2863,7 +2828,7 @@ static void do_vir_insw(port_t port, int proc, vir_bytes buf, size_t size)
 
        r= sys_insw(port, proc, (void *) buf, size);
        if (r != OK)
-               panic("DP8390", "sys_sdevio failed", r);
+               panic("sys_sdevio failed: %d", r);
 }
 
 static void do_vir_outsb(port_t port, int proc, vir_bytes buf, size_t size)
@@ -2872,7 +2837,7 @@ static void do_vir_outsb(port_t port, int proc, vir_bytes buf, size_t size)
 
        r= sys_outsb(port, proc, (void *) buf, size);
        if (r != OK)
-               panic("DP8390", "sys_sdevio failed", r);
+               panic("sys_sdevio failed: %d", r);
 }
 
 static void do_vir_outsw(port_t port, int proc, vir_bytes buf, size_t size)
@@ -2881,7 +2846,7 @@ static void do_vir_outsw(port_t port, int proc, vir_bytes buf, size_t size)
 
        r= sys_outsw(port, proc, (void *) buf, size);
        if (r != OK)
-               panic("DP8390", "sys_sdevio failed", r);
+               panic("sys_sdevio failed: %d", r);
 }
 
 /*
index d2c7c337fc34bb3f6cbe940efa91673d55944d30..4bd6f76e0162ae1fc3c6703e5bec92af19e8713f 100644 (file)
@@ -84,11 +84,8 @@ struct dpeth *dep;
                                continue;
                        if (pcitab[i].did != did)
                                continue;
-                       if (pcitab[i].checkclass)
-                       {
-                               panic("",
-                               "rtl_probe: class check not implemented",
-                                       NO_NUM);
+                       if (pcitab[i].checkclass) {
+                               panic("rtl_probe: class check not implemented");
                        }
                        break;
                }
@@ -121,7 +118,7 @@ struct dpeth *dep;
        bar= pci_attr_r32(devind, PCI_BAR) & 0xffffffe0;
 
        if (bar < 0x400)
-               panic("", "base address is not properly configured", NO_NUM);
+               panic("base address is not properly configured");
 
        dep->de_base_port= bar;
 
@@ -340,7 +337,7 @@ u16_t w;
                micro_delay(1);
        }
        if (!(inb_reg3(dep, 1) & 1))
-               panic("", "set_ee_word: device remains busy", NO_NUM);
+               panic("set_ee_word: device remains busy");
 }
 
 static void ee_wds(dep)
index 97e8104d5f0b82dac579b82cd68a1244a559bb22..d2e802ea7ee0e4d21fbb632065c831fdd70a2970 100644 (file)
@@ -153,7 +153,7 @@ static void el1_send(dpeth_t * dep, int from_int, int pktsize)
                txbuff->client = dep->de_client;
                user2mem(dep, txbuff);
        } else
-               panic(dep->de_name, "out of memory for Tx", NO_NUM);
+               panic("out of memory for Tx");
 
   } else if ((txbuff = dep->de_xmitq_head) != NULL) {
 
@@ -167,10 +167,10 @@ static void el1_send(dpeth_t * dep, int from_int, int pktsize)
        pktsize = txbuff->size;
 
   } else
-       panic(dep->de_name, "should not be sending ", NO_NUM);
+       panic("should not be sending ");
 
   if ((dep->de_flags & DEF_XMIT_BUSY)) {
-       if (from_int) panic(dep->de_name, "should not be sending ", NO_NUM);
+       if (from_int) panic("should not be sending ");
        getuptime(&now);
        if ((now - dep->de_xmit_start) > 4) {
                /* Transmitter timed out */
index 02cd09071483ddf02afbda6d71a76d821e8602d2..631ce110f4c5a24b72b29ed854dd703d062cd9bc 100644 (file)
@@ -81,7 +81,7 @@ static void el2_init(dpeth_t * dep)
   /* Set interrupt level for 3c503 */
   irq = (dep->de_irq &= ~DEI_DEFAULT); /* Strip the default flag. */
   if (irq == 9) irq = 2;
-  if (irq < 2 || irq > 5) panic(dep->de_name, "bad 3c503 irq configuration", irq);
+  if (irq < 2 || irq > 5) panic("bad 3c503 irq configuration: %d", irq);
   outb_el2(dep, EL2_IDCFG, (0x04 << irq));
 
   outb_el2(dep, EL2_DRQCNT, 0x08);     /* Set burst size to 8 */
index a51e2e2cc5ea9efdb8b2810cf7feb4bb7082c65d..98a753662637ec71497105632de49fa4fdddcd0d 100644 (file)
@@ -131,7 +131,7 @@ static void el3_write_fifo(dpeth_t * dep, int pktsize)
        r= sys_safe_outsb(dep->de_data_port, iovp->iod_proc_nr,
                iovp->iod_iovec[ix].iov_grant, 0, bytes);
        if (r != OK)
-               panic(__FILE__, "el3_write_fifo: sys_safe_outsb failed", r);
+               panic("el3_write_fifo: sys_safe_outsb failed: %d", r);
                
        if (++ix >= IOVEC_NR) { /* Next buffer of IO vector */
                dp_next_iovec(iovp);
@@ -416,11 +416,11 @@ static void el3_open(dpeth_t * dep)
 
   AddrCfgReg = ((AddrCfgReg & EL3_CONFIG_IOBASE_MASK) << 4) + EL3_IO_BASE_ADDR;
   if (AddrCfgReg != dep->de_base_port)
-       panic(dep->de_name, "Bad I/O port for Etherlink board", NO_NUM);
+       panic("Bad I/O port for Etherlink board");
 
   ResCfgReg >>= 12;
   dep->de_irq &= NOT(DEI_DEFAULT);     /* Strips the default flag */
-  if (ResCfgReg != dep->de_irq) panic(dep->de_name, "Bad IRQ for Etherlink board", NO_NUM);
+  if (ResCfgReg != dep->de_irq) panic("Bad IRQ for Etherlink board");
 
   SetWindow(WNO_Setup);
 
index 9293e5b136199a55020a276b06ccd560d1335424..74f887b3cce4f60497289bbc3460fad6fd425d06 100644 (file)
@@ -76,7 +76,7 @@ static void ns_start_xmit(dpeth_t * dep, int size, int pageno)
 */
 static void mem_getblock(dpeth_t *dep, u16_t offset, int size, void *dst)
 {
-  panic(__FILE__, "mem_getblock: not converted to safecopies", NO_NUM);
+  panic("mem_getblock: not converted to safecopies");
 #if 0
   sys_nic2mem(dep->de_linmem + offset, SELF, dst, size);
   return;
@@ -93,7 +93,7 @@ static void mem_nic2user(dpeth_t * dep, int pageno, int pktsize)
   iovec_dat_s_t *iovp = &dep->de_read_iovec;
   int bytes, ix = 0;
 
-  panic(__FILE__, "mem_nic2user: not converted to safecopies", NO_NUM);
+  panic("mem_nic2user: not converted to safecopies");
 #if 0
 
   /* Computes shared memory address (skipping receive header) */
@@ -141,7 +141,7 @@ static void mem_user2nic(dpeth_t *dep, int pageno, int pktsize)
   iovec_dat_s_t *iovp = &dep->de_write_iovec;
   int bytes, ix = 0;
 
-  panic(__FILE__, "mem_user2nic: not converted to safecopies", NO_NUM);
+  panic("mem_user2nic: not converted to safecopies");
 #if 0
 
   /* Computes shared memory address */
@@ -217,10 +217,8 @@ static void pio_nic2user(dpeth_t *dep, int pageno, int pktsize)
                bytes = dep->de_stoppage * DP_PAGESIZE - offset;
                r= sys_safe_insb(dep->de_data_port, iovp->iod_proc_nr, 
                        iovp->iod_iovec[ix].iov_grant, iov_offset, bytes);
-               if (r != OK)
-               {
-                       panic(__FILE__, "pio_nic2user: sys_safe_insb failed",
-                               r);
+               if (r != OK) {
+                       panic("pio_nic2user: sys_safe_insb failed: %d",                                 r);
                }
                pktsize -= bytes;
                iov_offset += bytes;
@@ -232,7 +230,7 @@ static void pio_nic2user(dpeth_t *dep, int pageno, int pktsize)
        r= sys_safe_insb(dep->de_data_port, iovp->iod_proc_nr,
                iovp->iod_iovec[ix].iov_grant, iov_offset, bytes);
        if (r != OK)
-               panic(__FILE__, "pio_nic2user: sys_safe_insb failed", r);
+               panic("pio_nic2user: sys_safe_insb failed: %d", r);
        offset += bytes;
 
        if (++ix >= IOVEC_NR) { /* Next buffer of IO vector */
@@ -264,7 +262,7 @@ static void pio_user2nic(dpeth_t *dep, int pageno, int pktsize)
        r= sys_safe_outsb(dep->de_data_port, iovp->iod_proc_nr,
              iovp->iod_iovec[ix].iov_grant, 0, bytes);
        if (r != OK)
-               panic(__FILE__, "pio_user2nic: sys_safe_outsb failed", r);
+               panic("pio_user2nic: sys_safe_outsb failed: %d", r);
 
        if (++ix >= IOVEC_NR) { /* Next buffer of I/O vector */
                dp_next_iovec(iovp);
@@ -277,7 +275,7 @@ static void pio_user2nic(dpeth_t *dep, int pageno, int pktsize)
        if (inb_reg0(dep, DP_ISR) & ISR_RDC) break;
   }
   if (ix == 100) {
-       panic(dep->de_name, RdmaErrMsg, NO_NUM);
+       panic(RdmaErrMsg);
   }
   return;
 }
@@ -331,7 +329,7 @@ static void ns_send(dpeth_t * dep, int from_int, int size)
   int queue;
 
   if (queue = dep->de_sendq_head, dep->de_sendq[queue].sq_filled) {
-       if (from_int) panic(dep->de_name, "should not be sending ", NO_NUM);
+       if (from_int) panic("should not be sending ");
        dep->de_send_s = size;
        return;
   }
@@ -654,7 +652,7 @@ static void dp_pio16_user2nic(dpeth_t *dep, int pageno, int pktsize)
        if (bytes > pktsize) bytes = pktsize;
 
        phys_user = numap(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_addr, bytes);
-       if (!phys_user) panic(dep->de_name, UmapErrMsg, NO_NUM);
+       if (!phys_user) panic(UmapErrMsg);
 
        if (odd_byte) {
                phys_copy(phys_user, phys_2bytes + 1, (phys_bytes) 1);
@@ -691,7 +689,7 @@ static void dp_pio16_user2nic(dpeth_t *dep, int pageno, int pktsize)
        if (inb_reg0(dep, DP_ISR) & ISR_RDC) break;
   }
   if (ix == 100) {
-       panic(dep->de_name, RdmaErrMsg, NO_NUM);
+       panic(RdmaErrMsg);
   }
   return;
 }
@@ -727,7 +725,7 @@ static void dp_pio16_nic2user(dpeth_t * dep, int nic_addr, int count)
 
        phys_user = numap(iovp->iod_proc_nr,
                          iovp->iod_iovec[i].iov_addr, bytes);
-       if (!phys_user) panic(dep->de_name, UmapErrMsg, NO_NUM);
+       if (!phys_user) panic(UmapErrMsg);
        if (odd_byte) {
                phys_copy(phys_2bytes + 1, phys_user, (phys_bytes) 1);
                count--;
index b6940063f040d90ed5ac41c966ee51a2849ad153..c4bb20c616f4c2c914bb1ea17f9bdd2b17f2d8eb 100644 (file)
@@ -118,7 +118,7 @@ static void reply(dpeth_t * dep, int err, int m_type)
        dep->de_flags &= NOT(DEF_ACK_SEND | DEF_ACK_RECV);
 
   } else if (status != ELOCKED || err == OK)
-       panic(dep->de_name, SendErrMsg, status);
+       panic(SendErrMsg, status);
 
   return;
 }
@@ -236,7 +236,7 @@ static void get_userdata_s(int user_proc, cp_grant_id_t grant,
 
   len = (count > IOVEC_NR ? IOVEC_NR : count) * sizeof(iovec_t);
   if ((rc = sys_safecopyfrom(user_proc, grant, 0, (vir_bytes)loc_addr, len, D)) != OK)
-       panic(DevName, CopyErrMsg, rc);
+       panic(CopyErrMsg, rc);
   return;
 }
 
@@ -351,7 +351,7 @@ static void do_init(message * mp)
   reply_mess.m3_i2 = DE_PORT_NR;
   DEBUG(printf("\t reply %d\n", reply_mess.m_type));
   if (send(mp->m_source, &reply_mess) != OK)   /* Can't send */
-       panic(portname, SendErrMsg, mp->m_source);
+       panic(SendErrMsg, mp->m_source);
 
   return;
 }
@@ -402,7 +402,7 @@ static void do_vwrite_s(message * mp)
 
   port = mp->DL_PORT;
   if (port < 0 || port >= DE_PORT_NR)  /* Check for illegal port number */
-       panic(__FILE__, PortErrMsg, EINVAL);
+       panic(PortErrMsg, EINVAL);
 
   dep = &de_table[port];
   dep->de_client = mp->DL_PROC;
@@ -410,7 +410,7 @@ static void do_vwrite_s(message * mp)
   if (dep->de_mode == DEM_ENABLED) {
 
        if (dep->de_flags & DEF_SENDING)        /* Is sending in progress? */
-               panic(dep->de_name, "send already in progress ", NO_NUM);
+               panic("send already in progress ");
 
        dep->de_write_iovec.iod_proc_nr = mp->DL_PROC;
        get_userdata_s(mp->DL_PROC, mp->DL_GRANT, 0,
@@ -420,7 +420,7 @@ static void do_vwrite_s(message * mp)
        dep->de_write_iovec.iod_iovec_offset = 0;
        size = calc_iovec_size(&dep->de_write_iovec);
        if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE)
-               panic(dep->de_name, SizeErrMsg, size);
+               panic(SizeErrMsg, size);
 
        dep->de_flags |= DEF_SENDING;
        (*dep->de_sendf) (dep, FALSE, size);
@@ -443,7 +443,7 @@ static void do_vread_s(message * mp)
 
   port = mp->DL_PORT;
   if (port < 0 || port >= DE_PORT_NR)  /* Check for illegal port number */
-       panic(__FILE__, PortErrMsg, EINVAL);
+       panic(PortErrMsg, EINVAL);
 
   dep = &de_table[port];
   dep->de_client = mp->DL_PROC;
@@ -451,7 +451,7 @@ static void do_vread_s(message * mp)
   if (dep->de_mode == DEM_ENABLED) {
 
        if (dep->de_flags & DEF_READING)        /* Reading in progress */
-               panic(dep->de_name, "read already in progress", NO_NUM);
+               panic("read already in progress");
 
        dep->de_read_iovec.iod_proc_nr = mp->DL_PROC;
        get_userdata_s(mp->DL_PROC, (cp_grant_id_t) mp->DL_GRANT, 0,
@@ -460,7 +460,7 @@ static void do_vread_s(message * mp)
        dep->de_read_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
        dep->de_read_iovec.iod_iovec_offset = 0;
        size = calc_iovec_size(&dep->de_read_iovec);
-       if (size < ETH_MAX_PACK_SIZE) panic(dep->de_name, SizeErrMsg, size);
+       if (size < ETH_MAX_PACK_SIZE) panic(SizeErrMsg, size);
 
        dep->de_flags |= DEF_READING;
        (*dep->de_recvf) (dep, FALSE, size);
@@ -486,7 +486,7 @@ static void do_getstat_s(message * mp)
 
   port = mp->DL_PORT;
   if (port < 0 || port >= DE_PORT_NR)  /* Check for illegal port number */
-       panic(__FILE__, PortErrMsg, EINVAL);
+       panic(PortErrMsg, EINVAL);
 
   dep = &de_table[port];
   dep->de_client = mp->DL_PROC;
@@ -495,7 +495,7 @@ static void do_getstat_s(message * mp)
   if ((rc = sys_safecopyto(mp->DL_PROC, mp->DL_GRANT, 0,
                        (vir_bytes)&dep->de_stat,
                        (vir_bytes) sizeof(dep->de_stat), 0)) != OK)
-        panic(DevName, CopyErrMsg, rc);
+        panic(CopyErrMsg, rc);
   reply(dep, OK, DL_STAT_REPLY);
   return;
 }
@@ -510,7 +510,7 @@ message *mp;
        mp->m_type= DL_NAME_REPLY;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic("dpeth", "do_getname: send failed: %d\n", r);
+               panic("do_getname: send failed: %d", r);
 }
 
 /*
@@ -524,7 +524,7 @@ static void do_stop(message * mp)
 
   port = mp->DL_PORT;
   if (port < 0 || port >= DE_PORT_NR)  /* Check for illegal port number */
-       panic(__FILE__, PortErrMsg, EINVAL);
+       panic(PortErrMsg, EINVAL);
 
   dep = &de_table[port];
   if (dep->de_mode == DEM_ENABLED && (dep->de_flags & DEF_ENABLED)) {
@@ -600,7 +600,7 @@ PUBLIC int main(int argc, char **argv)
 
   while (TRUE) {
        if ((rc = sef_receive(ANY, &m)) != OK){
-               panic(__FILE__, RecvErrMsg, rc);
+               panic(RecvErrMsg, rc);
        }
 
        DEBUG(printf("eth: got message %d, ", m.m_type));
@@ -624,7 +624,7 @@ PUBLIC int main(int argc, char **argv)
                                break;
                        default:        
                                /* Invalid message type */
-                               panic(DevName, TypeErrMsg, m.m_type);
+                               panic(TypeErrMsg, m.m_type);
                                break;
                }
                /* message processed, get another one */
@@ -651,7 +651,7 @@ PUBLIC int main(int argc, char **argv)
                do_stop(&m);
                break;
            default:            /* Invalid message type */
-               panic(DevName, TypeErrMsg, m.m_type);
+               panic(TypeErrMsg, m.m_type);
                break;
        }
   }
index 5003c7ee2732ca6f732a8b1b961ce16c5ee1b4b8..2e40db004c2f90d3d1fa772f7cd50c875ba121a4 100644 (file)
@@ -123,7 +123,7 @@ PUBLIC void mem2user(dpeth_t *dep, buff_t *rxbuff)
        r= sys_safecopyto(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_grant, 0,
                (vir_bytes)buffer, bytes, D);
        if (r != OK)
-               panic(__FILE__, "mem2user: sys_safecopyto failed", r);
+               panic("mem2user: sys_safecopyto failed: %d", r);
        buffer += bytes;
 
        if (++ix >= IOVEC_NR) { /* Next buffer of IO vector */
@@ -153,7 +153,7 @@ PUBLIC void user2mem(dpeth_t *dep, buff_t *txbuff)
        r= sys_safecopyfrom(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_grant,
                0, (vir_bytes)buffer, bytes, D);
        if (r != OK)
-               panic(__FILE__, "user2mem: sys_safecopyfrom failed", r);
+               panic("user2mem: sys_safecopyfrom failed: %d", r);
        buffer += bytes;
 
        if (++ix >= IOVEC_NR) { /* Next buffer of IO vector */
index fe40ef69f6720a18dd3dd6d4b171b375cdd16585..6570c234e48d244edec382114a492f1fa213e28d 100644 (file)
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
     {
        if ((r= sef_receive(ANY, &m)) != OK)
        {
-           panic("e1000", "sef_receive failed", r);
+           panic("sef_receive failed: %d", r);
        }
        if (is_notify(m.m_type))
        {
@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
            case DL_GETSTAT_S:  e1000_getstat_s(&m);            break;
            case DL_GETNAME:    e1000_getname(&m);              break;
            default:
-               panic("e1000", "illegal message", m.m_type);
+               panic("illegal message: %d", m.m_type);
        }
     }
 }
@@ -145,7 +145,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
     /* Verify command-line arguments. */
     if (env_argc < 1)
     {
-       panic("e1000", "no program name given in argc/argv", NO_NUM);
+       panic("no program name given in argc/argv");
     }
     else
        (progname = strrchr(env_argv[0],'/')) ? progname++
@@ -157,7 +157,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
     /* Perform calibration. */
     if((r = tsc_calibrate()) != OK)
     {
-        panic("e1000", "tsc_calibrate failed", r);
+        panic("tsc_calibrate failed: %d", r);
     }
     /* Try to notify inet that we are present (again) */
     if ((r = ds_retrieve_label_num("inet", &tasknr)) == OK)
@@ -308,7 +308,7 @@ PRIVATE int e1000_probe(e1000_t *e)
     /* Reserve PCI resources found. */
     if ((r = pci_reserve_ok(devind)) != OK)
     {
-        panic("e1000", "failed to reserve PCI device", r);
+        panic("failed to reserve PCI device: %d", r);
     }
     /* Read PCI configuration. */
     e->irq   = pci_attr_r8(devind, PCI_ILR);
@@ -316,10 +316,8 @@ PRIVATE int e1000_probe(e1000_t *e)
                           0x20000);
                           
     /* Verify mapped registers. */
-    if (e->regs == (u8_t *) -1)
-    {
-       panic("e1000", "failed to map hardware registers from PCI\n", 
-                       NO_NUM);
+    if (e->regs == (u8_t *) -1) {
+               panic("failed to map hardware registers from PCI");
     }
     /* Optionally map flash memory. */
     if (pci_attr_r32(devind, PCI_BAR_3))
@@ -368,11 +366,11 @@ e1000_t *e;
      */
     if ((r = sys_irqsetpolicy(e->irq, 0, &e->irq_hook)) != OK)
     {
-        panic(e->name, "sys_irqsetpolicy failed", r);
+        panic("sys_irqsetpolicy failed: %d", r);
     }
     if ((r = sys_irqenable(&e->irq_hook)) != OK)
     {
-       panic(e->name, "sys_irqenable failed", r);
+       panic("sys_irqenable failed: %d", r);
     }
     /* Reset hardware. */
     e1000_reset_hw(e);
@@ -487,10 +485,8 @@ e1000_t *e;
     {
        if ((e->rx_desc = alloc_contig(sizeof(e1000_rx_desc_t) * 
                                       e->rx_desc_count, AC_ALIGN4K, 
-                                     &rx_desc_p)) == NULL)
-       {
-               panic(e->name, "failed to allocate RX descriptors", 
-                               NO_NUM);
+                                     &rx_desc_p)) == NULL) {
+               panic("failed to allocate RX descriptors");
        }
        memset(e->rx_desc, 0, sizeof(e1000_rx_desc_t) * e->rx_desc_count);
 
@@ -503,7 +499,7 @@ e1000_t *e;
        if ((e->rx_buffer = alloc_contig(e->rx_buffer_size,
                                         AC_ALIGN4K, &rx_buff_p)) == NULL)
        {
-           panic(e->name, "failed to allocate RX buffers", NO_NUM);
+           panic("failed to allocate RX buffers");
        }
        /* Setup receive descriptors. */
        for (i = 0; i < E1000_RXDESC_NR; i++)
@@ -518,10 +514,8 @@ e1000_t *e;
     {
         if ((e->tx_desc = alloc_contig(sizeof(e1000_tx_desc_t) * 
                                       e->tx_desc_count, AC_ALIGN4K, 
-                                     &tx_desc_p)) == NULL)
-       {
-               panic(e->name, "failed to allocate TX descriptors", 
-                               NO_NUM);
+                                     &tx_desc_p)) == NULL) {
+               panic("failed to allocate TX descriptors");
        }
        memset(e->tx_desc, 0, sizeof(e1000_tx_desc_t) * e->tx_desc_count);
 
@@ -534,7 +528,7 @@ e1000_t *e;
        if ((e->tx_buffer = alloc_contig(e->tx_buffer_size,
                                         AC_ALIGN4K, &tx_buff_p)) == NULL)
        {
-           panic(e->name, "failed to allocate TX buffers", NO_NUM);
+           panic("failed to allocate TX buffers");
        }
        /* Setup transmit descriptors. */
        for (i = 0; i < E1000_RXDESC_NR; i++)
@@ -614,7 +608,7 @@ int from_int;
                                  (vir_bytes) iovec, e->tx_message.DL_COUNT *
                                  sizeof(iovec_s_t), D)) != OK)
        {
-           panic(e->name, "sys_safecopyfrom() failed", r);
+           panic("sys_safecopyfrom() failed: %d", r);
        }
        /* Find the head, tail and current descriptors. */
        head =  e1000_reg_read(e, E1000_REG_TDH);
@@ -638,7 +632,7 @@ int from_int;
                                     (tail * E1000_IOBUF_SIZE),
                                      size, D)) != OK)
            {
-               panic(e->name, "sys_safecopyfrom() failed", r);
+               panic("sys_safecopyfrom() failed: %d", r);
            }
            /* Mark this descriptor ready. */
            desc->status  = 0;
@@ -702,7 +696,7 @@ int from_int;
                                  (vir_bytes) iovec, e->rx_message.DL_COUNT *
                                  sizeof(iovec_s_t), D)) != OK)
        {
-           panic(e->name, "sys_safecopyfrom() failed", r);
+           panic("sys_safecopyfrom() failed: %d", r);
        }
        /* Find the head, tail and current descriptors. */
        head = e1000_reg_read(e, E1000_REG_RDH);
@@ -737,7 +731,7 @@ int from_int;
                                   (cur * E1000_IOBUF_SIZE),
                                    size, D)) != OK)
            {
-               panic(e->name, "sys_safecopyto() failed", r);
+               panic("sys_safecopyto() failed: %d", r);
            }
            bytes += size;
        }
@@ -790,7 +784,7 @@ message *mp;
     mp->DL_PORT = mp->DL_PORT;
     mp->DL_STAT = OK;
     if((r=send(mp->m_source, mp)) != OK)
-       panic("e1000", "e1000_getstat: send() failed", r);
+       panic("e1000_getstat: send() failed: %d", r);
 }
 
 /*===========================================================================*
@@ -811,7 +805,7 @@ message *mp;
     mp->m_type = DL_NAME_REPLY;
     if ((r = send(mp->m_source, mp)) != OK)
     {
-       panic("e1000", "e1000_getname: send() failed", r);
+       panic("e1000_getname: send() failed: %d", r);
     }
 }
 
@@ -837,7 +831,7 @@ message *mp;
         /* Re-enable interrupts. */
         if (sys_irqenable(&e->irq_hook) != OK)
         {
-           panic("e1000", "failed to re-enable IRQ", NO_NUM);
+           panic("failed to re-enable IRQ");
         }
 
        /* Read the Interrupt Cause Read register. */
@@ -908,7 +902,7 @@ int num;
      */
     if (num < 0 || num >= E1000_PORT_NR)
     {
-       panic("e1000", "invalid port number given", num);
+       panic("invalid port number given: %d", num);
     }
 
     /*
@@ -916,7 +910,7 @@ int num;
      */
     if (!(e1000_table[num].status & E1000_DETECTED))
     {
-       panic("e1000", "inactive port number given", num);
+       panic("inactive port number given: %d", num);
     }
     return &e1000_table[num];
 }
@@ -1260,7 +1254,7 @@ int may_block;
     /* Acknowledge to INET. */
     if ((r = send(e->client, &msg)) != OK)
     {
-        panic("e1000", "send() failed", r);
+        panic("send() failed: %d", r);
     }
 }
 
@@ -1273,6 +1267,6 @@ message *reply_mess;
 {
     if (send(req->m_source, reply_mess) != OK)
     {
-        panic("e1000", "unable to send reply message", NO_NUM);
+        panic("unable to send reply message");
     }
 }
index dd7c4af53833648c337914bba7249deca513fa55..3396f1e7283d4accb1345366df6d2db5432715af 100644 (file)
@@ -61,7 +61,7 @@ static int driver_open(int which)
        gid = cpf_grant_direct(driver[which].endpt,
                (vir_bytes) &part, sizeof(part), CPF_WRITE);
        if(!GRANT_VALID(gid))
-               panic(__FILE__, "invalid grant", gid);
+               panic("invalid grant: %d", gid);
 
        msg.m_type = DEV_IOCTL_S;
        msg.REQUEST = DIOCGETP;
@@ -165,7 +165,7 @@ void driver_init(void)
                check_driver(DRIVER_MAIN);
        }
        else if (driver_open(DRIVER_MAIN) != OK) {
-               panic(__FILE__, "unhandled driver_open failure", NO_NUM);
+               panic("unhandled driver_open failure");
        }
 
        if(USE_MIRROR) {
@@ -174,7 +174,7 @@ void driver_init(void)
 
                if(!strcmp(driver[DRIVER_MAIN].label,
                                driver[DRIVER_BACKUP].label)) {
-                       panic(__FILE__, "same driver: not tested", NO_NUM);
+                       panic("same driver: not tested");
                }
 
                r = ds_retrieve_label_num(driver[DRIVER_BACKUP].label,
@@ -186,8 +186,7 @@ void driver_init(void)
                        check_driver(DRIVER_BACKUP);
                }
                else if (driver_open(DRIVER_BACKUP) != OK) {
-                       panic(__FILE__, "unhandled driver_open failure",
-                               NO_NUM);
+                       panic("unhandled driver_open failure");
                }
        }
 }
@@ -377,7 +376,7 @@ static int check_problem(int which, int problem, int retries, int *tell_rs)
                break;
 
        default:
-               panic(__FILE__, "invalid problem", problem);
+               panic("invalid problem: %d", problem);
        }
 
        /* At this point, the driver will be restarted. */
@@ -441,7 +440,7 @@ static void restart_driver(int which, int tell_rs)
                r = sendrec(RS_PROC_NR, &msg);
 
                if (r != OK || msg.m_type != OK)
-                       panic(__FILE__, "RS request failed", r);
+                       panic("RS request failed: %d", r);
 
 #if DEBUG
                printf("Filter: RS call succeeded\n");
@@ -545,7 +544,7 @@ static int flt_senda(message *mess, int which)
        r = senda(amsgtable, 2);
 
        if(r != OK)
-               panic(__FILE__, "senda returned error", r);
+               panic("senda returned error: %d", r);
 
        return r;
 }
@@ -585,7 +584,7 @@ static int flt_receive(message *mess, int which)
        for (;;) {
                r = sef_receive(ANY, mess);
                if(r != OK)
-                       panic(__FILE__, "sef_receive returned error", r);
+                       panic("sef_receive returned error: %d", r);
 
                if(mess->m_source == CLOCK && is_notify(mess->m_type)) {
                        if (mess->NOTIFY_TIMESTAMP < flt_alarm(-1)) {
@@ -727,7 +726,7 @@ static int do_sendrec_both(message *m1, message *m2)
        } else if (ma.m_source == driver[DRIVER_BACKUP].endpt) {
                which = DRIVER_MAIN;
        } else {
-               panic(__FILE__, "message from unexpected source",
+               panic("message from unexpected source: %d",
                        ma.m_source);
        }
 
@@ -822,7 +821,7 @@ static int single_grant(endpoint_t endpt, vir_bytes buf, int access,
 
                grant = cpf_grant_direct(endpt, buf, chunk, access);
                if (!GRANT_VALID(grant))
-                       panic(__FILE__, "invalid grant", grant);
+                       panic("invalid grant: %d", grant);
 
                vector[count].iov_grant = grant;
                vector[count].iov_size = chunk;
@@ -836,7 +835,7 @@ static int single_grant(endpoint_t endpt, vir_bytes buf, int access,
                sizeof(vector[0]) * count, CPF_READ | CPF_WRITE);
 
        if (!GRANT_VALID(*gid))
-               panic(__FILE__, "invalid grant", *gid);
+               panic("invalid grant: %d", *gid);
 
        return count;
 }
index b84036783bd3aae1bb31a3b10156e0b4eef50730..d13e2db8389b909fa106a76aa2b47a0fa3dcd1b0 100644 (file)
@@ -189,7 +189,7 @@ static int do_vrdwt(int flag_rw)
        grants = m_in.COUNT;
        if((r = sys_safecopyfrom(who_e, grant_id, 0, (vir_bytes) iov_proc,
                grants * sizeof(iovec_t), D)) != OK) {
-               panic(__FILE__, "copying in grant vector failed", r);
+               panic("copying in grant vector failed: %d", r);
        }
 
        pos = make64(m_in.POSITION, m_in.HIGHPOS);
@@ -240,7 +240,7 @@ static int do_vrdwt(int flag_rw)
        /* Copy the caller's grant-table back. */
        if((r = sys_safecopyto(who_e, grant_id, 0, (vir_bytes) iov_proc,
                grants * sizeof(iovec_t), D)) != OK) {
-               panic(__FILE__, "copying out grant vector failed", r);
+               panic("copying out grant vector failed: %d", r);
        }
 
        flt_free(buffer, size, buf_array);
@@ -405,7 +405,7 @@ int main(int argc, char *argv[])
        for (;;) {
                /* Wait for request. */
                if(sef_receive(ANY, &m_in) != OK) {
-                       panic(__FILE__, "sef_receive failed", NO_NUM);
+                       panic("sef_receive failed");
                }
 
 #if DEBUG2
@@ -480,7 +480,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
        }
 
        if ((buf_array = flt_malloc(BUF_SIZE, NULL, 0)) == NULL)
-               panic(__FILE__, "no memory available", NO_NUM);
+               panic("no memory available");
 
        sum_init();
 
index 86686da1c95dceb1e2b8df1b4accc25b036ecd64..e5554fbeb8933d721fc35492aa3b89fd388772bb 100644 (file)
@@ -28,7 +28,7 @@ void sum_init(void)
        rb1_array = flt_malloc(SBUF_SIZE, NULL, 0);
 
        if (ext_array == NULL || rb0_array == NULL || rb1_array == NULL)
-               panic(__FILE__, "no memory available", NO_NUM);
+               panic("no memory available");
 }
 
 /*===========================================================================*
@@ -92,7 +92,7 @@ static void calc_sum(unsigned sector, char *data, char *sum)
                break;
 
        default:
-               panic(__FILE__, "invalid checksum type", SUM_TYPE);
+               panic("invalid checksum type: %d", SUM_TYPE);
        }
 }
 
@@ -252,12 +252,12 @@ static int make_sum(sector_t current_sector, sector_t sectors_left)
                size = sectors_left * SECTOR_SIZE;
 
                if (group_left != NR_SUM_SEC - sector_in_group)
-                       panic(__FILE__, "group_left assertion", 0);
+                       panic("group_left assertion: %d", 0);
 
                gap = group_left - sectors_left;
 
                if (gap <= 0)
-                       panic(__FILE__, "gap assertion", 0);
+                       panic("gap assertion: %d", 0);
 
                if ((r = read_sectors(extp + size,
                                LOG2PHYS(current_sector) + sectors_left,
index 3e3274093f1402a5d6f0994566006e8819d02204..a0f8144cf01e82b74cfede15d10f664cb7cb81cb 100644 (file)
@@ -21,7 +21,7 @@ char *flt_malloc(size_t size, char *sbuf, size_t ssize)
                return sbuf;
 
        if(!(p = alloc_contig(size, 0, NULL)))
-               panic(__FILE__, "out of memory", size);
+               panic("out of memory: %d", size);
 
        return p;
 }
@@ -66,17 +66,17 @@ clock_t flt_alarm(clock_t dt)
        r = sys_setalarm(dt, 0);
 
        if(r != OK)
-               panic(__FILE__, "sys_setalarm failed", r);
+               panic("sys_setalarm failed: %d", r);
 
        if(dt == 0) {
                if(!next_alarm)
-                       panic(__FILE__, "clearing unset alarm", r);
+                       panic("clearing unset alarm: %d", r);
                next_alarm = 0;
        } else {
                if(next_alarm)
-                       panic(__FILE__, "overwriting alarm", r);
+                       panic("overwriting alarm: %d", r);
                if ((r = getuptime(&next_alarm)) != OK)
-                       panic(__FILE__, "getuptime failed", r);
+                       panic("getuptime failed: %d", r);
                next_alarm += dt;
        }
 
index 557af62a816b8516fb0b698eaa178c8dba176360..fcf8e5d87c67e4e84ad1712329ad5bffaeb91f85 100644 (file)
@@ -344,7 +344,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
   if(!(floppy_buf = alloc_contig(2*DMA_BUF_SIZE,
        AC_LOWER16M | AC_ALIGN4K, &floppy_buf_phys)))
-       panic("FLOPPY", "couldn't allocate dma buffer", NO_NUM);
+       panic("couldn't allocate dma buffer");
 
   f_next_timeout = TMR_NEVER;
   tmr_inittimer(&f_tmr_timeout);
@@ -361,9 +361,9 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
    */
   irq_hook_id = FLOPPY_IRQ;
   if ((s=sys_irqsetpolicy(FLOPPY_IRQ, 0, &irq_hook_id )) != OK)
-       panic("FLOPPY", "Couldn't set IRQ policy", s);
+       panic("Couldn't set IRQ policy: %d", s);
   if ((s=sys_irqenable(&irq_hook_id)) != OK)
-       panic("FLOPPY", "Couldn't enable IRQs", s);
+       panic("Couldn't enable IRQs: %d", s);
 
   /* Ignore signals */
   signal(SIGHUP, SIG_IGN);
@@ -384,7 +384,7 @@ PRIVATE void f_expire_tmrs(struct driver *dp, message *m_ptr)
 
   /* Get the current time to compare the timers against. */
   if ((s=getuptime(&now)) != OK)
-       panic("FLOPPY","Couldn't get uptime from clock.", s);
+       panic("Couldn't get uptime from clock: %d", s);
 
   /* Scan the timers queue for expired timers. Dispatch the watchdog function
    * for each expired timers. FLOPPY watchdog functions are f_tmr_timeout() 
@@ -396,7 +396,7 @@ PRIVATE void f_expire_tmrs(struct driver *dp, message *m_ptr)
   } else {                                       /* set new sync alarm */
        f_next_timeout = f_timers->tmr_exp_time;
        if ((s=sys_setalarm(f_next_timeout, 1)) != OK)
-               panic("FLOPPY","Couldn't set synchronous alarm.", s);
+               panic("Couldn't set synchronous alarm: %d", s);
   }
 }
 
@@ -413,7 +413,7 @@ tmr_func_t watchdog;                        /* watchdog function to be called */
 
   /* Get the current time. */
   if ((s=getuptime(&now)) != OK)
-       panic("FLOPPY","Couldn't get uptime from clock.", s);
+       panic("Couldn't get uptime from clock: %d", s);
 
   /* Add the timer to the local timer queue. */
   tmrs_settimer(&f_timers, tp, now + delta, watchdog, NULL);
@@ -425,7 +425,7 @@ tmr_func_t watchdog;                        /* watchdog function to be called */
   if (f_timers->tmr_exp_time != f_next_timeout) {
        f_next_timeout = f_timers->tmr_exp_time; 
        if ((s=sys_setalarm(f_next_timeout, 1)) != OK)
-               panic("FLOPPY","Couldn't set synchronous alarm.", s);
+               panic("Couldn't set synchronous alarm: %d", s);
   }
 }
 
@@ -544,7 +544,7 @@ unsigned nr_req;            /* length of request vector */
                        SECTOR_SIZE + iov_offset, (vir_bytes) &fmt_param,
                        (phys_bytes) sizeof(fmt_param), D);
                   if(s != OK)
-                       panic("FLOPPY", "sys_safecopyfrom failed", s);
+                       panic("sys_safecopyfrom failed: %d", s);
                } else {
                        memcpy(&fmt_param, (void *) (iov->iov_addr +
                                SECTOR_SIZE + iov_offset),
@@ -611,7 +611,7 @@ unsigned nr_req;            /* length of request vector */
                cmd[2] = SPEC2;
                (void) fdc_command(cmd, 3);
                if ((s=sys_outb(FDC_RATE, f_dp->rate)) != OK)
-                       panic("FLOPPY","Sys_outb failed", s);
+                       panic("Sys_outb failed: %d", s);
                prev_dp = f_dp;
        }
 
@@ -649,7 +649,7 @@ unsigned nr_req;            /* length of request vector */
                                        (vir_bytes) floppy_buf,
                                         (phys_bytes) SECTOR_SIZE, D);
                                   if(s != OK)
-                                       panic("FLOPPY", "sys_safecopyfrom failed", s);
+                                       panic("sys_safecopyfrom failed: %d", s);
                                } else {
                                   memcpy(floppy_buf, (void *) (*ug + *up), SECTOR_SIZE);
                                }
@@ -675,7 +675,7 @@ unsigned nr_req;            /* length of request vector */
                                (vir_bytes) floppy_buf,
                                 (phys_bytes) SECTOR_SIZE, D);
                        if(s != OK)
-                               panic("FLOPPY", "sys_safecopyto failed", s);
+                               panic("sys_safecopyto failed: %d", s);
                        } else {
                           memcpy((void *) (*ug + *up), floppy_buf, SECTOR_SIZE);
                        }
@@ -745,7 +745,7 @@ PRIVATE int dma_setup(
 
   /* First check the DMA memory address not to exceed maximum. */
   if (floppy_buf_phys != (floppy_buf_phys & DMA_ADDR_MASK)) {
-       report("FLOPPY", "DMA denied because address out of range", NO_NUM);
+       printf("floppy: DMA denied because address out of range");
        return(EIO);
   }
 
@@ -763,7 +763,7 @@ PRIVATE int dma_setup(
   pv_set(byte_out[8], DMA_INIT, 2);            /* some sort of enable */
 
   if ((s=sys_voutb(byte_out, 9)) != OK)
-       panic("FLOPPY","Sys_voutb in dma_setup() failed", s);
+       panic("Sys_voutb in dma_setup() failed: %d", s);
   return(OK);
 }
 
@@ -791,7 +791,7 @@ PRIVATE void start_motor(void)
 
   if ((s=sys_outb(DOR,
                (motor_status << MOTOR_SHIFT) | ENABLE_INT | f_drive)) != OK)
-       panic("FLOPPY","Sys_outb in start_motor() failed", s);
+       panic("Sys_outb in start_motor() failed: %d", s);
 
   /* If the motor was already running, we don't have to wait for it. */
   if (running) return;                 /* motor was already running */
@@ -831,7 +831,7 @@ PRIVATE void stop_motor(timer_t *tp)
   int s;
   motor_status &= ~(1 << tmr_arg(tp)->ta_int);
   if ((s=sys_outb(DOR, (motor_status << MOTOR_SHIFT) | ENABLE_INT)) != OK)
-       panic("FLOPPY","Sys_outb in stop_motor() failed", s);
+       panic("Sys_outb in stop_motor() failed: %d", s);
 }
 
 /*===========================================================================*
@@ -843,7 +843,7 @@ PRIVATE void floppy_stop(struct driver *dp, sigset_t *set)
   int s;
   if (sigismember(set, SIGTERM)) {
       if ((s=sys_outb(DOR, ENABLE_INT)) != OK)
-               panic("FLOPPY","Sys_outb in floppy_stop() failed", s);
+               panic("Sys_outb in floppy_stop() failed: %d", s);
       exit(0); 
   }
 }
@@ -1010,20 +1010,20 @@ PRIVATE int fdc_results(void)
         * the perfection of the mirror.
         */
        if ((s=sys_inb(FDC_STATUS, &status)) != OK)
-               panic("FLOPPY","Sys_inb in fdc_results() failed", s);
+               panic("Sys_inb in fdc_results() failed: %d", s);
        status &= (MASTER | DIRECTION | CTL_BUSY);
        if (status == (MASTER | DIRECTION | CTL_BUSY)) {
                unsigned long tmp_r;
                if (result_nr >= MAX_RESULTS) break;    /* too many results */
                if ((s=sys_inb(FDC_DATA, &tmp_r)) != OK)
-                  panic("FLOPPY","Sys_inb in fdc_results() failed", s);
+                  panic("Sys_inb in fdc_results() failed: %d", s);
                f_results[result_nr] = tmp_r;
                result_nr ++;
                continue;
        }
        if (status == MASTER) {                 /* all read */
                if ((s=sys_irqenable(&irq_hook_id)) != OK)
-                       panic("FLOPPY", "Couldn't enable IRQs", s);
+                       panic("Couldn't enable IRQs: %d", s);
 
                return(OK);                     /* only good exit */
        }
@@ -1032,7 +1032,7 @@ PRIVATE int fdc_results(void)
   need_reset = TRUE;           /* controller chip must be reset */
 
   if ((s=sys_irqenable(&irq_hook_id)) != OK)
-       panic("FLOPPY", "Couldn't enable IRQs", s);
+       panic("Couldn't enable IRQs: %d", s);
   return(ERR_STATUS);
 }
 
@@ -1087,12 +1087,12 @@ PRIVATE void fdc_out(
                return;
        }
        if ((s=sys_inb(FDC_STATUS, &status)) != OK)
-               panic("FLOPPY","Sys_inb in fdc_out() failed", s);
+               panic("Sys_inb in fdc_out() failed: %d", s);
   }
   while ((status & (MASTER | DIRECTION)) != (MASTER | 0)); 
   
   if ((s=sys_outb(FDC_DATA, val)) != OK)
-       panic("FLOPPY","Sys_outb in fdc_out() failed", s);
+       panic("Sys_outb in fdc_out() failed: %d", s);
 }
 
 /*===========================================================================*
@@ -1166,7 +1166,7 @@ PRIVATE void f_reset(void)
   pv_set(byte_out[0], DOR, 0);                 /* strobe reset bit low */
   pv_set(byte_out[1], DOR, ENABLE_INT);                /* strobe it high again */
   if ((s=sys_voutb(byte_out, 2)) != OK)
-       panic("FLOPPY", "Sys_voutb in f_reset() failed", s); 
+       panic("Sys_voutb in f_reset() failed: %d", s); 
 
   /* A synchronous alarm timer was set in fdc_command. Expect an interrupt,
    * but be prepared to handle a timeout.
index 7a51eaacb996bd40680c1da9b4ea60b81256eb5c..7499279a0c2c60f54a26c0e12411d7abe1c09d75 100644 (file)
@@ -278,7 +278,7 @@ PRIVATE void handle_hw_intr(void)
 
                r= sys_irqenable(&fp->fxp_hook);
                if (r != OK) {
-                       panic("FXP", "unable enable interrupts", r);
+                       panic("unable enable interrupts: %d", r);
                }
 
                if (!fp->fxp_got_int)
@@ -310,7 +310,7 @@ int main(int argc, char *argv[])
        while (TRUE)
        {
                if ((r= sef_receive(ANY, &m)) != OK)
-                       panic("FXP","sef_receive failed", r);
+                       panic("sef_receive failed: %d", r);
 
                if (is_notify(m.m_type)) {
                        switch (_ENDPOINT_P(m.m_source)) {
@@ -332,7 +332,7 @@ int main(int argc, char *argv[])
                                        fxp_expire_timers();
                                        break;
                                default:
-                                       panic("FXP"," illegal notify from", m.m_source);
+                                       panic(" illegal notify from: %d", m.m_source);
                        }
 
                        /* get new message */
@@ -352,7 +352,7 @@ int main(int argc, char *argv[])
                case DL_GETSTAT_S: fxp_getstat_s(&m);           break;
                case DL_GETNAME: fxp_getname(&m);               break;
                default:
-                       panic("FXP"," illegal message", m.m_type);
+                       panic(" illegal message: %d", m.m_type);
                }
        }
 }
@@ -387,7 +387,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
        system_hz = sys_hz();
 
        if (env_argc < 1)
-               panic("FXP", "A head which at this time has no name", NO_NUM);
+               panic("A head which at this time has no name");
        (progname=strrchr(env_argv[0],'/')) ? progname++
                : (progname=env_argv[0]);
 
@@ -398,12 +398,12 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
        eth_ign_proto= htons((u16_t) v);
 
        if(!(fxp_table = alloc_contig(ft, 0, &fxp_table_phys)))
-               panic("FXP","couldn't allocate table", ENOMEM);
+               panic("couldn't allocate table: %d", ENOMEM);
 
        memset(fxp_table, 0, ft);
 
        if((r=tsc_calibrate()) != OK)
-               panic("FXP","tsc_calibrate failed", r);
+               panic("tsc_calibrate failed: %d", r);
 
        /* Try to notify inet that we are present (again) */
        r= ds_retrieve_label_num("inet", &tasknr);
@@ -595,10 +595,8 @@ static int fxp_probe(fxp_t *fp)
                                continue;
                        if (pcitab_fxp[i].did != did)
                                continue;
-                       if (pcitab_fxp[i].checkclass)
-                       {
-                               panic("FXP","fxp_probe: class check not implemented",
-                                       NO_NUM);
+                       if (pcitab_fxp[i].checkclass) {
+                               panic("fxp_probe: class check not implemented");
                        }
                        break;
                }
@@ -630,10 +628,8 @@ static int fxp_probe(fxp_t *fp)
        pci_reserve(devind);
 
        bar= pci_attr_r32(devind, PCI_BAR_2) & 0xffffffe0;
-       if (bar < 0x400)
-       {
-               panic("FXP","fxp_probe: base address is not properly configured",
-                       NO_NUM);
+       if (bar < 0x400) {
+               panic("fxp_probe: base address is not properly configured");
        }
        fp->fxp_base_port= bar;
 
@@ -819,7 +815,7 @@ fxp_t *fp;
                }
                break;
        default:
-               panic("FXP","fxp_conf_hw: bad device type", fp->fxp_type);
+               panic("fxp_conf_hw: bad device type: %d", fp->fxp_type);
        }
 
 #if VERBOSE
@@ -852,13 +848,13 @@ fxp_t *fp;
        fp->fxp_hook = fp->fxp_irq;
        r= sys_irqsetpolicy(fp->fxp_irq, 0, &fp->fxp_hook);
        if (r != OK)
-               panic("FXP","sys_irqsetpolicy failed", r);
+               panic("sys_irqsetpolicy failed: %d", r);
 
        fxp_reset_hw(fp);
 
        r= sys_irqenable(&fp->fxp_hook);
        if (r != OK)
-               panic("FXP","sys_irqenable failed", r);
+               panic("sys_irqenable failed: %d", r);
 
        /* Reset PHY? */
 
@@ -868,7 +864,7 @@ fxp_t *fp;
        r= sys_umap(SELF, VM_D, (vir_bytes)&fp->fxp_stat, sizeof(fp->fxp_stat),
                &bus_addr);
        if (r != OK)
-               panic("FXP","sys_umap failed", r);
+               panic("sys_umap failed: %d", r);
        fxp_cu_ptr_cmd(fp, SC_CU_LOAD_DCA, bus_addr, TRUE /* check idle */);
 
        /* Ack previous interrupts */
@@ -920,10 +916,8 @@ fxp_t *fp;
                tot_bufsize += 4096 - (tot_bufsize % 4096);
        alloc_bufsize= tot_bufsize;
        alloc_buf= alloc_contig(alloc_bufsize, AC_ALIGN4K, &ph);
-       if (alloc_buf == NULL)
-       {
-               panic(__FILE__, "fxp_init_buf: unable to alloc_contig size",
-                       alloc_bufsize);
+       if (alloc_buf == NULL) {
+               panic("fxp_init_buf: unable to alloc_contig size: %d",                  alloc_bufsize);
        }
 
        buf= (phys_bytes)alloc_buf;
@@ -936,7 +930,7 @@ fxp_t *fp;
        r= sys_umap(SELF, VM_D, (vir_bytes)fp->fxp_rx_buf, rx_totbufsize,
                &fp->fxp_rx_busaddr);
        if (r != OK)
-               panic("FXP","sys_umap failed", r);
+               panic("sys_umap failed: %d", r);
 
 #if 0
        printf("fxp_init_buf: got phys 0x%x for vir 0x%x\n",
@@ -952,7 +946,7 @@ fxp_t *fp;
                        r= sys_umap(SELF, VM_D, (vir_bytes)&rfdp[1],
                                sizeof(rfdp[1]), &rfdp->rfd_linkaddr);
                        if (r != OK)
-                               panic("FXP","sys_umap failed", r);
+                               panic("sys_umap failed: %d", r);
                }
                else
                {
@@ -970,7 +964,7 @@ fxp_t *fp;
        r= sys_umap(SELF, VM_D, (vir_bytes)fp->fxp_tx_buf,
                (phys_bytes)tx_totbufsize, &fp->fxp_tx_busaddr);
        if (r != OK)
-               panic("FXP","sys_umap failed", r);
+               panic("sys_umap failed: %d", r);
 
        for (i= 0, txp= fp->fxp_tx_buf; i<fp->fxp_tx_nbuf; i++, txp++)
        {
@@ -982,7 +976,7 @@ fxp_t *fp;
                                (phys_bytes)sizeof(txp[1]),
                                &txp->tx_linkaddr);
                        if (r != OK)
-                               panic("FXP","sys_umap failed", r);
+                               panic("sys_umap failed: %d", r);
                }
                else
                {
@@ -1065,7 +1059,7 @@ static void fxp_confaddr(fxp_t *fp)
        r= sys_umap(SELF, VM_D, (vir_bytes)&tmpbufp->ias,
                (phys_bytes)sizeof(tmpbufp->ias), &bus_addr);
        if (r != OK)
-               panic("FXP","sys_umap failed", r);
+               panic("sys_umap failed: %d", r);
 
        fxp_cu_ptr_cmd(fp, SC_CU_START, bus_addr, TRUE /* check idle */);
 
@@ -1077,9 +1071,9 @@ static void fxp_confaddr(fxp_t *fp)
        } while (getuptime(&t1)==OK && (t1-t0) < micros_to_ticks(1000));
 
        if (!(tmpbufp->ias.ias_status & CBL_F_C))
-               panic("FXP","fxp_confaddr: CU command failed to complete", NO_NUM);
+               panic("fxp_confaddr: CU command failed to complete");
        if (!(tmpbufp->ias.ias_status & CBL_F_OK))
-               panic("FXP","fxp_confaddr: CU command failed", NO_NUM);
+               panic("fxp_confaddr: CU command failed");
 
 #if VERBOSE
        printf("%s: hardware ethernet address: ", fp->fxp_name);
@@ -1141,7 +1135,7 @@ int vectored;
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= FXP_PORT_NR)
-               panic("FXP","fxp_writev: illegal port", dl_port);
+               panic("fxp_writev: illegal port: %d", dl_port);
        fp= &fxp_table[dl_port];
        fxp_client= mp->DL_PROC;
        fp->fxp_client= fxp_client;
@@ -1203,42 +1197,38 @@ int vectored;
                                SELF, D, (vir_bytes)fp->fxp_iovec,
                                n * sizeof(fp->fxp_iovec[0]));
                        if (r != OK)
-                               panic("FXP","fxp_writev: sys_vircopy failed", r);
+                               panic("fxp_writev: sys_vircopy failed: %d", r);
 
                        for (j= 0, iovp= fp->fxp_iovec; j<n; j++, iovp++)
                        {
                                s= iovp->iov_size;
-                               if (size + s > ETH_MAX_PACK_SIZE_TAGGED)
-                               {
-                                       panic("FXP","fxp_writev: invalid packet size",
-                                               NO_NUM);
+                               if (size + s > ETH_MAX_PACK_SIZE_TAGGED) {
+                                       panic("fxp_writev: invalid packet size");
                                }
 
                                r= sys_vircopy(fxp_client, D, iovp->iov_addr, 
                                        SELF, D, (vir_bytes)(txp->tx_buf+o),
                                        s);
-                               if (r != OK)
-                               {
-                                       panic("FXP","fxp_writev: sys_vircopy failed",
-                                               r);
+                               if (r != OK) {
+                                       panic("fxp_writev: sys_vircopy failed: %d", r);
                                }
                                size += s;
                                o += s;
                        }
                }
                if (size < ETH_MIN_PACK_SIZE)
-                       panic("FXP","fxp_writev: invalid packet size", size);
+                       panic("fxp_writev: invalid packet size: %d", size);
        }
        else
        {  
                size= mp->DL_COUNT;
                if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE_TAGGED)
-                       panic("FXP","fxp_writev: invalid packet size", size);
+                       panic("fxp_writev: invalid packet size: %d", size);
 
                r= sys_vircopy(fxp_client, D, (vir_bytes)mp->DL_ADDR, 
                        SELF, D, (vir_bytes)txp->tx_buf, size);
                if (r != OK)
-                       panic("FXP","fxp_writev: sys_vircopy failed", r);
+                       panic("fxp_writev: sys_vircopy failed: %d", r);
        }
 
        txp->tx_status= 0;
@@ -1276,7 +1266,7 @@ int vectored;
 
 suspend:
        if (from_int)
-               panic("FXP","fxp: should not be sending\n", NO_NUM);
+               panic("fxp: should not be sending");
 
        fp->fxp_tx_mess= *mp;
        reply(fp, OK, FALSE);
@@ -1299,7 +1289,7 @@ static void fxp_writev_s(message *mp, int from_int)
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= FXP_PORT_NR)
-               panic("FXP","fxp_writev: illegal port", dl_port);
+               panic("fxp_writev: illegal port: %d", dl_port);
        fp= &fxp_table[dl_port];
        fxp_client= mp->DL_PROC;
        fp->fxp_client= fxp_client;
@@ -1359,31 +1349,26 @@ static void fxp_writev_s(message *mp, int from_int)
                        (vir_bytes)fp->fxp_iovec_s,
                        n * sizeof(fp->fxp_iovec_s[0]), D);
                if (r != OK)
-                       panic("FXP","fxp_writev: sys_safecopyfrom failed", r);
+                       panic("fxp_writev: sys_safecopyfrom failed: %d", r);
 
                for (j= 0, iovp= fp->fxp_iovec_s; j<n; j++, iovp++)
                {
                        s= iovp->iov_size;
-                       if (size + s > ETH_MAX_PACK_SIZE_TAGGED)
-                       {
-                               panic("FXP","fxp_writev: invalid packet size",
-                                       size + s);
+                       if (size + s > ETH_MAX_PACK_SIZE_TAGGED) {
+                               panic("fxp_writev: invalid packet size: %d", size + s);
                        }
 
                        r= sys_safecopyfrom(fxp_client, iovp->iov_grant,
                                0, (vir_bytes)(txp->tx_buf+o), s, D);
-                       if (r != OK)
-                       {
-                               panic("FXP",
-                               "fxp_writev_s: sys_safecopyfrom failed",
-                                       r);
+                       if (r != OK) {
+                               panic("fxp_writev_s: sys_safecopyfrom failed: %d", r);
                        }
                        size += s;
                        o += s;
                }
        }
        if (size < ETH_MIN_PACK_SIZE)
-               panic("FXP","fxp_writev: invalid packet size", size);
+               panic("fxp_writev: invalid packet size: %d", size);
 
        txp->tx_status= 0;
        txp->tx_command= TXC_EL | CBL_XMIT;
@@ -1420,7 +1405,7 @@ static void fxp_writev_s(message *mp, int from_int)
 
 suspend:
        if (from_int)
-               panic("FXP","fxp: should not be sending\n", NO_NUM);
+               panic("fxp: should not be sending");
 
        fp->fxp_tx_mess= *mp;
        reply(fp, OK, FALSE);
@@ -1449,7 +1434,7 @@ int vectored;
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= FXP_PORT_NR)
-               panic("FXP","fxp_readv: illegal port", dl_port);
+               panic("fxp_readv: illegal port: %d", dl_port);
        fp= &fxp_table[dl_port];
        fxp_client= mp->DL_PROC;
        fp->fxp_client= fxp_client;
@@ -1502,7 +1487,7 @@ int vectored;
                                SELF, D, (vir_bytes)fp->fxp_iovec,
                                n * sizeof(fp->fxp_iovec[0]));
                        if (r != OK)
-                               panic("FXP","fxp_readv: sys_vircopy failed", r);
+                               panic("fxp_readv: sys_vircopy failed: %d", r);
 
                        for (j= 0, iovp= fp->fxp_iovec; j<n; j++, iovp++)
                        {
@@ -1516,10 +1501,8 @@ int vectored;
                                r= sys_vircopy(SELF, D,
                                        (vir_bytes)(rfdp->rfd_buf+o),
                                        fxp_client, D, iovp->iov_addr, s);
-                               if (r != OK)
-                               {
-                                       panic("FXP","fxp_readv: sys_vircopy failed",
-                                               r);
+                               if (r != OK) {
+                                       panic("fxp_readv: sys_vircopy failed: %d", r);
                                }
 
                                size += s;
@@ -1629,7 +1612,7 @@ int from_int;
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= FXP_PORT_NR)
-               panic("FXP","fxp_readv: illegal port", dl_port);
+               panic("fxp_readv: illegal port: %d", dl_port);
        fp= &fxp_table[dl_port];
        fxp_client= mp->DL_PROC;
        fp->fxp_client= fxp_client;
@@ -1681,7 +1664,7 @@ int from_int;
                        (vir_bytes)fp->fxp_iovec_s,
                        n * sizeof(fp->fxp_iovec_s[0]), D);
                if (r != OK)
-                       panic("FXP","fxp_readv_s: sys_safecopyfrom failed", r);
+                       panic("fxp_readv_s: sys_safecopyfrom failed: %d", r);
 
                for (j= 0, iovp= fp->fxp_iovec_s; j<n; j++, iovp++)
                {
@@ -1696,8 +1679,7 @@ int from_int;
                                0, (vir_bytes)(rfdp->rfd_buf+o), s, D);
                        if (r != OK)
                        {
-                               panic("FXP","fxp_readv: sys_safecopyto failed",
-                                       r);
+                               panic("fxp_readv: sys_safecopyto failed: %d", r);
                        }
 
                        size += s;
@@ -1799,7 +1781,7 @@ fxp_t *fp;
        r= sys_umap(SELF, VM_D, (vir_bytes)&tmpbufp->cc,
                (phys_bytes)sizeof(tmpbufp->cc), &bus_addr);
        if (r != OK)
-               panic("FXP","sys_umap failed", r);
+               panic("sys_umap failed: %d", r);
 
        fxp_cu_ptr_cmd(fp, SC_CU_START, bus_addr, TRUE /* check idle */);
 
@@ -1811,9 +1793,9 @@ fxp_t *fp;
        } while (getuptime(&t1)==OK && (t1-t0) < micros_to_ticks(100000));
 
        if (!(tmpbufp->cc.cc_status & CBL_F_C))
-               panic("FXP","fxp_do_conf: CU command failed to complete", NO_NUM);
+               panic("fxp_do_conf: CU command failed to complete");
        if (!(tmpbufp->cc.cc_status & CBL_F_OK))
-               panic("FXP","fxp_do_conf: CU command failed", NO_NUM);
+               panic("fxp_do_conf: CU command failed");
 
 }
 
@@ -1836,7 +1818,7 @@ int check_idle;
        {
                /* Consistency check. Make sure that CU is idle */
                if ((fxp_inb(port, SCB_STATUS) & SS_CUS_MASK) != SS_CU_IDLE)
-                       panic("FXP","fxp_cu_ptr_cmd: CU is not idle", NO_NUM);
+                       panic("fxp_cu_ptr_cmd: CU is not idle");
        }
 
        fxp_outl(port, SCB_POINTER, bus_addr);
@@ -1854,7 +1836,7 @@ int check_idle;
        } while (getuptime(&t1)==OK && (t1-t0) < micros_to_ticks(100000));
 
        if ((scb_cmd & SC_CUC_MASK) != SC_CU_NOP)
-               panic("FXP","fxp_cu_ptr_cmd: CU does not accept command", NO_NUM);
+               panic("fxp_cu_ptr_cmd: CU does not accept command");
 }
 
 /*===========================================================================*
@@ -1876,7 +1858,7 @@ int check_idle;
        {
                /* Consistency check, make sure that RU is idle */
                if ((fxp_inb(port, SCB_STATUS) & SS_RUS_MASK) != SS_RU_IDLE)
-                       panic("FXP","fxp_ru_ptr_cmd: RU is not idle", NO_NUM);
+                       panic("fxp_ru_ptr_cmd: RU is not idle");
        }
 
        fxp_outl(port, SCB_POINTER, bus_addr);
@@ -1891,7 +1873,7 @@ int check_idle;
        } while (getuptime(&t1)==OK && (t1-t0) < micros_to_ticks(1000));
 
        if ((scb_cmd & SC_RUC_MASK) != SC_RU_NOP)
-               panic("FXP","fxp_ru_ptr_cmd: RU does not accept command", NO_NUM);
+               panic("fxp_ru_ptr_cmd: RU does not accept command");
 }
 
 /*===========================================================================*
@@ -1921,7 +1903,7 @@ fxp_t *fp;
 
        /* Make sure that RU is in the 'No resources' state */
        if ((fxp_inb(port, SCB_STATUS) & SS_RUS_MASK) != SS_RU_NORES)
-               panic("FXP","fxp_restart_ru: RU is in an unexpected state", NO_NUM);
+               panic("fxp_restart_ru: RU is in an unexpected state");
 
        fxp_ru_ptr_cmd(fp, SC_RU_START, fp->fxp_rx_busaddr,
                FALSE /* do not check idle */);
@@ -1941,7 +1923,7 @@ message *mp;
 
        dl_port = mp->DL_PORT;
        if (dl_port < 0 || dl_port >= FXP_PORT_NR)
-               panic("FXP","fxp_getstat: illegal port", dl_port);
+               panic("fxp_getstat: illegal port: %d", dl_port);
        fp= &fxp_table[dl_port];
        fp->fxp_client= mp->DL_PROC;
 
@@ -1964,9 +1946,9 @@ message *mp;
        } while (getuptime(&t1)==OK && (t1-t0) < micros_to_ticks(1000));
 
        if (*p == 0)
-               panic("FXP","fxp_getstat: CU command failed to complete", NO_NUM);
+               panic("fxp_getstat: CU command failed to complete");
        if (*p != SCM_DSC)
-               panic("FXP","fxp_getstat: bad magic", NO_NUM);
+               panic("fxp_getstat: bad magic");
 
        stats.ets_recvErr=
                fp->fxp_stat.sc_rx_crc +
@@ -1997,14 +1979,14 @@ message *mp;
        r= sys_vircopy(SELF, D, (vir_bytes)&stats,
                mp->DL_PROC, D, (vir_bytes) mp->DL_ADDR, sizeof(stats));
        if (r != OK)
-               panic(__FILE__,"fxp_getstat: sys_vircopy failed", r);
+               panic("fxp_getstat: sys_vircopy failed: %d", r);
 
        mp->m_type= DL_STAT_REPLY;
        mp->DL_PORT= dl_port;
        mp->DL_STAT= OK;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic(__FILE__, "fxp_getstat: send failed: %d\n", r);
+               panic("fxp_getstat: send failed: %d", r);
 }
 
 
@@ -2021,7 +2003,7 @@ static void fxp_getstat_s(message *mp)
 
        dl_port = mp->DL_PORT;
        if (dl_port < 0 || dl_port >= FXP_PORT_NR)
-               panic("FXP","fxp_getstat: illegal port", dl_port);
+               panic("fxp_getstat: illegal port: %d", dl_port);
        fp= &fxp_table[dl_port];
        fp->fxp_client= mp->DL_PROC;
 
@@ -2044,9 +2026,9 @@ static void fxp_getstat_s(message *mp)
        } while (getuptime(&t1)==OK && (t1-t0) < micros_to_ticks(1000));
 
        if (*p == 0)
-               panic("FXP","fxp_getstat: CU command failed to complete", NO_NUM);
+               panic("fxp_getstat: CU command failed to complete");
        if (*p != SCM_DSC)
-               panic("FXP","fxp_getstat: bad magic", NO_NUM);
+               panic("fxp_getstat: bad magic");
 
        stats.ets_recvErr=
                fp->fxp_stat.sc_rx_crc +
@@ -2077,14 +2059,14 @@ static void fxp_getstat_s(message *mp)
        r= sys_safecopyto(mp->DL_PROC, mp->DL_GRANT, 0, (vir_bytes)&stats,
                sizeof(stats), D);
        if (r != OK)
-               panic(__FILE__,"fxp_getstat_s: sys_safecopyto failed", r);
+               panic("fxp_getstat_s: sys_safecopyto failed: %d", r);
 
        mp->m_type= DL_STAT_REPLY;
        mp->DL_PORT= dl_port;
        mp->DL_STAT= OK;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic(__FILE__, "fxp_getstat_s: send failed: %d\n", r);
+               panic("fxp_getstat_s: send failed: %d", r);
 }
 
 
@@ -2100,7 +2082,7 @@ static void fxp_getname(message *mp)
        mp->m_type= DL_NAME_REPLY;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic("FXP", "fxp_getname: send failed", r);
+               panic("fxp_getname: send failed: %d", r);
 }
 
 /*===========================================================================*
@@ -2687,7 +2669,7 @@ int may_block;
        }
 
        if (r < 0)
-               panic("FXP","fxp: send failed:", r);
+               panic("fxp: send failed: %d", r);
        
        fp->fxp_read_s = 0;
        fp->fxp_flags &= ~(FF_PACK_SENT | FF_PACK_RECV);
@@ -2701,7 +2683,7 @@ message *req;
 message *reply_mess;
 {
        if (send(req->m_source, reply_mess) != OK)
-               panic("FXP","fxp: unable to mess_reply", NO_NUM);
+               panic("fxp: unable to mess_reply");
 }
 
 /*===========================================================================*
@@ -2802,7 +2784,7 @@ fxp_t *fp;
                        break;
        }
        if (i >= 32)
-               panic("FXP","eeprom_addrsize: failed", NO_NUM);
+               panic("eeprom_addrsize: failed");
        fp->fxp_ee_addrlen= i+1;
 
        /* Discard 16 data bits */
@@ -2839,7 +2821,7 @@ int reg;
        fp->fxp_mii_busy++;
 
        if (!(fxp_inl(port, CSR_MDI_CTL) & CM_READY))
-               panic("FXP","mii_read: MDI not ready", NO_NUM);
+               panic("mii_read: MDI not ready");
        fxp_outl(port, CSR_MDI_CTL, CM_READ | (1 << CM_PHYADDR_SHIFT) |
                (reg << CM_REG_SHIFT));
 
@@ -2851,7 +2833,7 @@ int reg;
        } while (getuptime(&t1)==OK && (t1-t0) < micros_to_ticks(100000));
 
        if (!(v & CM_READY))
-               panic("FXP","mii_read: MDI not ready after command", NO_NUM);
+               panic("mii_read: MDI not ready after command");
 
        fp->fxp_mii_busy--;
        assert(!fp->fxp_mii_busy);
@@ -2873,7 +2855,7 @@ tmr_func_t watchdog;                      /* watchdog function to be called */
        /* Get the current time. */
        r= getuptime(&now);
        if (r != OK)
-               panic("FXP","unable to get uptime from clock", r);
+               panic("unable to get uptime from clock: %d", r);
 
        /* Add the timer to the local timer queue. */
        tmrs_settimer(&fxp_timers, tp, now + delta, watchdog, NULL);
@@ -2891,7 +2873,7 @@ tmr_func_t watchdog;                      /* watchdog function to be called */
 #endif
                r= sys_setalarm(fxp_next_timeout, 1);
                if (r != OK)
-                       panic("FXP","unable to set synchronous alarm", r);
+                       panic("unable to set synchronous alarm: %d", r);
        }
 }
 
@@ -2909,7 +2891,7 @@ PRIVATE void fxp_expire_timers()
   /* Get the current time to compare the timers against. */
   r= getuptime(&now);
   if (r != OK)
-       panic("FXP","Unable to get uptime from clock.", r);
+       panic("Unable to get uptime from clock: %d", r);
 
   /* Scan the timers queue for expired timers. Dispatch the watchdog function
    * for each expired timers. Possibly a new alarm call must be scheduled.
@@ -2922,7 +2904,7 @@ PRIVATE void fxp_expire_timers()
        fxp_next_timeout = fxp_timers->tmr_exp_time;
        r= sys_setalarm(fxp_next_timeout, 1);
        if (r != OK)
-               panic("FXP","Unable to set synchronous alarm.", r);
+               panic("Unable to set synchronous alarm: %d", r);
   }
 }
 
@@ -2933,7 +2915,7 @@ static u8_t do_inb(port_t port)
 
        r= sys_inb(port, &value);
        if (r != OK)
-               panic("FXP","sys_inb failed", r);
+               panic("sys_inb failed: %d", r);
        return value;
 }
 
@@ -2944,7 +2926,7 @@ static u32_t do_inl(port_t port)
 
        r= sys_inl(port, &value);
        if (r != OK)
-               panic("FXP","sys_inl failed", r);
+               panic("sys_inl failed: %d", r);
        return value;
 }
 
@@ -2954,7 +2936,7 @@ static void do_outb(port_t port, u8_t value)
 
        r= sys_outb(port, value);
        if (r != OK)
-               panic("FXP","sys_outb failed", r);
+               panic("sys_outb failed: %d", r);
 }
 
 static void do_outl(port_t port, u32_t value)
@@ -2963,7 +2945,7 @@ static void do_outl(port_t port, u32_t value)
 
        r= sys_outl(port, value);
        if (r != OK)
-               panic("FXP","sys_outl failed", r);
+               panic("sys_outl failed: %d", r);
 }
 
 PRIVATE void tell_dev(buf, size, pci_bus, pci_dev, pci_func)
index cfffc5fdfd80ef0d683caeb417ad13de08247157..a6ef17d91e4f07b982b529d92c7fb9119e659584 100644 (file)
@@ -147,7 +147,7 @@ unsigned long vir2phys( unsigned long x )
 
    if ( (r=sys_umap( SELF, VM_D, x, 4, &value )) != OK ) {
       printf("lance: umap of 0x%lx failed\n",x );
-      panic( "lance", "sys_umap failed", r );
+      panic("sys_umap failed: %d", r);
    }
 
    return value;
@@ -289,7 +289,7 @@ void main( int argc, char **argv )
       }
 
       if ((r= sef_receive(ANY, &m)) != OK)
-        panic( "lance", "sef_receive failed", r);
+        panic("sef_receive failed: %d", r);
         
       for (i=0;i<EC_PORT_NR_MAX;++i)
       {
@@ -329,7 +329,7 @@ void main( int argc, char **argv )
                              break;
                      }
                      default:
-                             panic( "lance", "illegal notify source", m.m_source);
+                             panic("illegal notify source: %d", m.m_source);
              }
 
              /* get next message */
@@ -357,7 +357,7 @@ void main( int argc, char **argv )
          do_getname(&m);
          break;
       default:
-         panic( "lance", "illegal message", m.m_type);
+         panic("illegal message: %d", m.m_type);
       }
    }
 }
@@ -516,7 +516,7 @@ message *mp;
    pci_init();
 
    if(!lance_buf && !(lance_buf = alloc_contig(LANCE_BUF_SIZE, AC_ALIGN4K|AC_LOWER16M, &lance_buf_phys))) {
-      panic( "lance", "alloc_contig failed", LANCE_BUF_SIZE);
+      panic("alloc_contig failed: %d", LANCE_BUF_SIZE);
    }
 
    port = mp->DL_PORT;
@@ -542,7 +542,7 @@ message *mp;
       }
       else
       {
-         report( "LANCE", "DMA denied because address out of range", NO_NUM );
+         printf("LANCE: DMA denied because address out of range\n" );
       }
 
       if (ec->mode == EC_DISABLED)
@@ -744,7 +744,7 @@ int may_block;
    reply.DL_COUNT = ec->read_s;
 
    if ((r=getuptime(&now)) != OK)
-      panic("lance", "getuptime() failed:", r);
+      panic("getuptime() failed: %d", r);
    reply.DL_CLCK = now;
 
    r = send(ec->client, &reply);
@@ -753,7 +753,7 @@ int may_block;
       return;
    }
    if (r < 0)
-      panic( "lance", "send failed:", r);
+      panic("send failed: %d", r);
 
    ec->read_s = 0;
    ec->flags &= ~(ECF_PACK_SEND | ECF_PACK_RECV);
@@ -768,7 +768,7 @@ message *req;
 message *reply_mess;
 {
    if (send(req->m_source, reply_mess) != OK)
-      panic( "lance", "unable to mess_reply", NO_NUM);
+      panic("unable to mess_reply");
 }
 
 
@@ -867,7 +867,7 @@ ether_card_t *ec;
    unsigned short ioaddr = ec->ec_port;
 
    if (!(ec->flags & ECF_ENABLED))
-      panic( "lance", "got premature interrupt", NO_NUM);
+      panic("got premature interrupt");
 
    for (;;)
    {
@@ -959,7 +959,7 @@ ether_card_t *ec;
          }
          else
          {
-            panic( "lance", "got premature TX INT...", NO_NUM);
+            panic("got premature TX INT..");
          }
          if (check==1)
          {
@@ -1065,7 +1065,7 @@ ether_card_t *ec;
    {
    case DL_WRITEV_S: do_vwrite_s(&ec->sendmsg, TRUE);        break;
    default:
-      panic( "lance", "wrong type:", ec->sendmsg.m_type);
+      panic("wrong type: %d", ec->sendmsg.m_type);
       break;
    }
 }
@@ -1088,8 +1088,7 @@ static void do_vread_s(message *mp)
                         (count > IOVEC_NR ? IOVEC_NR : count) *
                         sizeof(iovec_s_t), D);
    if (r != OK)
-      panic(__FILE__,
-            "do_vread_s: sys_safecopyfrom failed: %d\n", r);
+       panic("do_vread_s: sys_safecopyfrom failed: %d", r);
    ec->read_iovec.iod_iovec_s    = count;
    ec->read_iovec.iod_proc_nr    = mp->DL_PROC;
    ec->read_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
@@ -1207,9 +1206,7 @@ int from_int;
                         (count > IOVEC_NR ? IOVEC_NR : count) *
                         sizeof(iovec_s_t), D);
    if (r != OK)
-      panic(__FILE__,
-            "do_vwrite_s: sys_safecopyfrom failed: %d\n", r);
-
+       panic("do_vwrite_s: sys_safecopyfrom failed: %d", r);
    ec->write_iovec.iod_iovec_s    = count;
    ec->write_iovec.iod_proc_nr    = mp->DL_PROC;
    ec->write_iovec.iod_grant      = mp->DL_GRANT;
@@ -1283,7 +1280,7 @@ vir_bytes count;
       if ( (r=sys_safecopyfrom(iovp->iod_proc_nr,
                                iovp->iod_iovec[i].iov_grant, offset,
                                nic_addr, bytes, D )) != OK )
-         panic( __FILE__, "ec_user2nic: sys_safecopyfrom failed", r );
+         panic("ec_user2nic: sys_safecopyfrom failed: %d", r);
 
       count -= bytes;
       nic_addr += bytes;
@@ -1323,7 +1320,7 @@ vir_bytes count;
          bytes = count;
       if ( (r=sys_safecopyto( iovp->iod_proc_nr, iovp->iod_iovec[i].iov_grant,
                               offset, nic_addr, bytes, D )) != OK )
-         panic( __FILE__, "ec_nic2user: sys_safecopyto failed: ", r );
+         panic("ec_nic2user: sys_safecopyto failed: %d", r);
       
       count -= bytes;
       nic_addr += bytes;
@@ -1374,8 +1371,7 @@ iovec_dat_t *iovp;
                          IOVEC_NR : iovp->iod_iovec_s) *
                         sizeof(iovec_s_t), D);
    if (r != OK)
-      panic(__FILE__,
-            "ec_next_iovec: sys_safecopyfrom failed: %d\n", r);
+       panic("ec_next_iovec: sys_safecopyfrom failed: %d", r);
 }
 
 
@@ -1390,7 +1386,7 @@ message *mp;
 
    port = mp->DL_PORT;
    if (port < 0 || port >= EC_PORT_NR_MAX)
-      panic( "lance", "illegal port", port);
+      panic("illegal port: %d", port);
 
    ec= &ec_table[port];
    ec->client= mp->DL_PROC;
@@ -1399,15 +1395,14 @@ message *mp;
                       (vir_bytes)&ec->eth_stat, sizeof(ec->eth_stat), D);
 
    if (r != OK)
-      panic(__FILE__,
-            "do_getstat_s: sys_safecopyto failed: %d\n", r);
+       panic("do_getstat_s: sys_safecopyto failed: %d", r);
 
    mp->m_type= DL_STAT_REPLY;
    mp->DL_PORT= port;
    mp->DL_STAT= OK;
    r= send(mp->m_source, mp);
    if (r != OK)
-      panic(__FILE__, "do_getstat_s: send failed: %d\n", r);
+      panic("do_getstat_s: send failed: %d", r);
 }
 
 /*===========================================================================*
@@ -1422,7 +1417,7 @@ message *mp;
 
    port = mp->DL_PORT;
    if (port < 0 || port >= EC_PORT_NR_MAX)
-      panic( "lance", "illegal port", port);
+      panic("illegal port: %d", port);
    ec = &ec_table[port];
 
    if (!(ec->flags & ECF_ENABLED))
@@ -1516,10 +1511,8 @@ ether_card_t *ec;
             continue;
          if (pcitab[i].did != did)
             continue;
-         if (pcitab[i].checkclass)
-         {
-            panic("lance",
-                  "class check not implemented", NO_NUM);
+         if (pcitab[i].checkclass) {
+               panic("class check not implemented");
          }
          break;
       }
@@ -1610,7 +1603,7 @@ message *mp;
    mp->m_type= DL_NAME_REPLY;
    r= send(mp->m_source, mp);
    if (r != OK)
-      panic("LANCE", "do_getname: send failed", r);
+      panic("do_getname: send failed: %d", r);
 }
 
 /*===========================================================================*
@@ -1731,7 +1724,7 @@ static u8_t in_byte(port_t port)
 
        r= sys_inb(port, &value);
        if (r != OK)
-               panic("lance","sys_inb failed", r);
+               panic("sys_inb failed: %d", r);
        return value;
 }
 
@@ -1745,7 +1738,7 @@ static u16_t in_word(port_t port)
 
        r= sys_inw(port, &value);
        if (r != OK)
-               panic("lance","sys_inw failed", r);
+               panic("sys_inw failed: %d", r);
        return value;
 }
 
@@ -1759,7 +1752,7 @@ static void out_word(port_t port, u16_t value)
 
        r= sys_outw(port, value);
        if (r != OK)
-               panic("lance","sys_outw failed", r);
+               panic("sys_outw failed: %d", r);
 }
 
 /*===========================================================================*
index 5b3c630bd8023e820f595483ab2fc2786f7f8f3e..5d1c2f32d39ce5bed47114b7904bc92adc72f0d9 100644 (file)
@@ -146,7 +146,7 @@ int type;           /* Driver type (DRIVER_STD or DRIVER_ASYN) */
                int s;
                /* Wait for a request to read or write a disk block. */
                if ((s=sef_receive(ANY, &mess)) != OK)
-                       panic((*dp->dr_name)(),"sef_receive() failed", s);
+                       panic("sef_receive() failed: %d", s);
        }
 
        device_caller = mess.m_source;
@@ -239,7 +239,7 @@ send_reply:
                break;
 
        default:
-               panic(__FILE__, "unknown driver type", type);
+               panic("unknown driver type: %d", type);
        }
   }
 }
@@ -256,7 +256,7 @@ PUBLIC void init_buffer(void)
  */
 
   if(!(tmp_buf = alloc_contig(2*DMA_BUF_SIZE, AC_ALIGN4K, &tmp_phys)))
-       panic(__FILE__, "can't allocate tmp_buf", DMA_BUF_SIZE);
+       panic("can't allocate tmp_buf: %d", DMA_BUF_SIZE);
 }
 
 /*===========================================================================*
@@ -317,7 +317,7 @@ message *mp;                /* pointer to read or write message */
 
   if (OK != sys_safecopyfrom(mp->m_source, (vir_bytes) mp->IO_GRANT, 
                0, (vir_bytes) iovec, iovec_size, D)) {
-       panic((*dp->dr_name)(),"bad I/O vector by", mp->m_source);
+       panic("bad I/O vector by: %d", mp->m_source);
   }
 
   /* Prepare for I/O. */
@@ -331,7 +331,7 @@ message *mp;                /* pointer to read or write message */
   /* Copy the I/O vector back to the caller. */
   if (OK != sys_safecopyto(mp->m_source, (vir_bytes) mp->IO_GRANT, 
                0, (vir_bytes) iovec, iovec_size, D)) {
-       panic((*dp->dr_name)(),"couldn't return I/O vector", mp->m_source);
+       panic("couldn't return I/O vector: %d", mp->m_source);
   }
 
   return(r);
@@ -485,7 +485,7 @@ PUBLIC int mq_queue(message *m)
        mq_t *mq, *mi;
 
        if(!(mq = mq_get()))
-               panic("libdriver","mq_queue: mq_get failed", NO_NUM);
+               panic("mq_queue: mq_get failed");
        memcpy(&mq->mq_mess, m, sizeof(mq->mq_mess));
        mq->mq_next = NULL;
        if(!queue_head) {
index 27e4cfcf3e305718cbc9fd7c99ac4dae9be80481..4d6ac1244954665d1fe1f579a2c29f2ca9c9e741 100644 (file)
@@ -40,9 +40,6 @@ endpoint_t from;                              /* who sent this message? */
                CPF_WRITE);
        if (gid == -1)
        {
-#if 0
-               report("LOG","cpf_grant_direct failed for TTY", errno);
-#endif
                return EDONTREPLY;
        }
 
@@ -55,7 +52,7 @@ endpoint_t from;                              /* who sent this message? */
        if (r == OK) r= mess.m_type;
        if (r != OK)
        {
-               report("LOG","couldn't get copy of kmessages from TTY", r);
+               printf("log: couldn't get copy of kmessages from TTY: %d\n", r);
                return EDONTREPLY;
        }
   }
@@ -63,7 +60,7 @@ endpoint_t from;                              /* who sent this message? */
   {
        /* Try to get a fresh copy of the buffer with kernel messages. */
        if ((r=sys_getkmessages(&kmess)) != OK) {
-               report("LOG","couldn't get copy of kmessages", r);
+               printf("log: couldn't get copy of kmessages: %d\n", r);
                return EDONTREPLY;
        }
        prev_nextp= &kernel_prev_next;
index 3467b0a2bfad83de2f67758095d7026b002920c8..0f7d402108b61b503a7b3b05dd8319a51ba7e618 100644 (file)
@@ -128,11 +128,11 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
   sa.sa_handler = SIG_MESS;
   sigemptyset(&sa.sa_mask);
   sa.sa_flags = 0;
-  if (sigaction(SIGTERM,&sa,NULL)<0) panic("MEM","sigaction failed", errno);
+  if (sigaction(SIGTERM,&sa,NULL)<0) panic("sigaction failed: %d", errno);
 
   /* Initialize all minor devices one by one. */
   if (OK != (s=sys_getkinfo(&kinfo))) {
-      panic("MEM","Couldn't get kernel information.",s);
+      panic("Couldn't get kernel information: %d", s);
   }
 
 #if 0
@@ -255,7 +255,7 @@ unsigned nr_req;            /* length of request vector */
                  dev_vaddr + position, count, D);
            }
            if(r != OK) {
-              panic("MEM","I/O copy failed",r);
+              panic("I/O copy failed: %d", r);
            }
            break;
 
@@ -287,7 +287,7 @@ unsigned nr_req;            /* length of request vector */
            if(!any_mapped || pagestart_mapped != pagestart) {
             if(any_mapped) {
                if(vm_unmap_phys(SELF, vaddr, I386_PAGE_SIZE) != OK)
-                       panic("MEM","vm_unmap_phys failed",NO_NUM);
+                       panic("vm_unmap_phys failed");
                any_mapped = 0;
             }
             vaddr = vm_map_phys(SELF, (void *) pagestart, I386_PAGE_SIZE);
@@ -331,7 +331,7 @@ unsigned nr_req;            /* length of request vector */
                     s=sys_safecopyto(proc_nr, user_vir,
                       vir_offset+suboffset, (vir_bytes) dev_zero, chunk, D);
                    if(s != OK)
-                       report("MEM","sys_safecopyto failed", s);
+                       printf("MEM: sys_safecopyto failed: %d\n", s);
                    left -= chunk;
                    suboffset += chunk;
                }
@@ -372,7 +372,7 @@ message *m_ptr;
   }
 
   if(m_device < 0 || m_device >= NR_DEVS) {
-      panic("MEM","wrong m_device",m_device);
+      panic("wrong m_device: %d", m_device);
   }
 
   openct[m_device]++;
@@ -392,11 +392,11 @@ message *m_ptr;
   if (m_prepare(m_ptr->DEVICE) == NIL_DEV) return(ENXIO);
 
   if(m_device < 0 || m_device >= NR_DEVS) {
-      panic("MEM","wrong m_device",m_device);
+      panic("wrong m_device: %d", m_device);
   }
 
   if(openct[m_device] < 1) {
-      panic("MEM","closed too often",NO_NUM);
+      panic("closed too often");
   }
   openct[m_device]--;
 
@@ -449,7 +449,7 @@ message *m_ptr;                             /* pointer to control message */
        if(m_vaddrs[dev]) {
                u32_t size;
                if(ex64hi(dv->dv_size)) {
-                       panic("MEM","huge old ramdisk", NO_NUM);
+                       panic("huge old ramdisk");
                }
                size = ex64lo(dv->dv_size);
                free((void *) m_vaddrs[dev]);
index b216756bba05180cd0d954a959c5ba6bb1098ff4..b230d8bcf725d65017198fc23e7603e095367054 100644 (file)
@@ -248,7 +248,7 @@ int main(int argc, char *argv[]) {
 
        while (TRUE) {
                if ((r = sef_receive (ANY, &m)) != OK)
-                       panic(__FILE__, "orinoco: sef_receive failed", NO_NUM);
+                       panic("orinoco: sef_receive failed");
 
                if (is_notify(m.m_type)) {
                        switch (_ENDPOINT_P(m.m_source)) {
@@ -275,8 +275,7 @@ int main(int argc, char *argv[]) {
                                        break;
                                }
                                default:
-                                       panic(__FILE__,
-                                               "orinoco: illegal notify from:",
+                                       panic("orinoco: illegal notify from: %d",
                                                m.m_source);
                        }
 
@@ -316,7 +315,7 @@ int main(int argc, char *argv[]) {
                        or_getname(&m);
                        break;
                default:
-                       panic(__FILE__,"orinoco: illegal message:", m.m_type);
+                       panic("orinoco: illegal message: %d", m.m_type);
                }
        }
 }
@@ -406,7 +405,7 @@ static void or_getname(message *mp) {
 
        r = send(mp->m_source, mp);
        if(r != OK) {
-               panic(__FILE__, "or_getname: send failed", r);
+               panic("or_getname: send failed: %d", r);
        }
 }
 
@@ -465,7 +464,7 @@ static void or_reset() {
        u16_t irqmask;
 
        if (OK != (r = getuptime(&now)))
-               panic(__FILE__, "orinoco: getuptime() failed:", r);
+               panic("orinoco: getuptime() failed: %d", r);
 
        if(now - last_reset < system_hz * 10) {
                printf("Resetting card too often. Going to reset driver\n");
@@ -706,8 +705,7 @@ static int or_probe (t_or * orp) {
                        if (pcitab[i].did != did)
                                continue;
                        if (pcitab[i].checkclass) {
-                           panic(__FILE__, "or_probe:class check not implmnted", 
-                                 NO_NUM);
+                               panic("or_probe:class check not implmnted");
                        }
                        /* we have found the card in the pci bus */
                        break;
@@ -769,7 +767,7 @@ static void map_hw_buffer(t_or *orp) {
 
        buf = (char *)malloc(size);
        if(buf == NULL) 
-               panic(__FILE__, "map_hw_buffer: cannot malloc size:", size);
+               panic("map_hw_buffer: cannot malloc size: %d", size);
 
        /* Let the mapped memory by I386_PAGE_SIZE aligned */
        o = I386_PAGE_SIZE - ((vir_bytes)buf % I386_PAGE_SIZE);
@@ -783,7 +781,7 @@ static void map_hw_buffer(t_or *orp) {
 #endif
 
        if(r!=OK) 
-               panic(__FILE__, "map_hw_buffer: sys_vm_map failed:", r);
+               panic("map_hw_buffer: sys_vm_map failed: %d", r);
 
 
        hw->locmem = abuf;
@@ -814,8 +812,7 @@ static u32_t or_get_bar (int devind, t_or * orp) {
                bar = pci_attr_r32 (devind, PCI_BAR) & 0xffffffe0;
 
                if ((bar & 0x3ff) >= 0x100 - 32 || bar < 0x400)
-                       panic(__FILE__,"base address isn't properly configured",
-                              NO_NUM);
+                       panic("base address isn't properly configured");
 
                /* In I/O space registers are 2 bytes wide, without any spacing
                 * in between */
@@ -827,7 +824,7 @@ static u32_t or_get_bar (int devind, t_or * orp) {
                                orp->or_name, bar, orp->or_irq);
                }
 
-               panic(__FILE__, "Not implemente yet", NO_NUM);
+               panic("Not implemente yet");
                /* Although we are able to find the desired bar and irq for an 
                 * I/O spaced card, we haven't implemented the right register 
                 * accessing functions. This wouldn't be difficult, but we were
@@ -1347,7 +1344,7 @@ static void or_watchdog_f(timer_t *tp) {
 
 static void mess_reply (message * req, message * reply_mess) {
        if (send (req->m_source, reply_mess) != 0)
-               panic(__FILE__, "orinoco: unable to mess_reply", NO_NUM);
+               panic("orinoco: unable to mess_reply");
 
 }
 
@@ -1379,7 +1376,7 @@ static void or_writev (message * mp, int from_int, int vectored) {
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= OR_PORT_NR)
-               panic(__FILE__, "orinoco: illegal port", NO_NUM);
+               panic("orinoco: illegal port");
        
        or_client = mp->DL_PROC;
        orp = &or_table[port];
@@ -1555,7 +1552,7 @@ static void or_writev_s (message * mp, int from_int) {
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= OR_PORT_NR)
-               panic(__FILE__, "orinoco: illegal port", NO_NUM);
+               panic("orinoco: illegal port");
 
        or_client = mp->DL_PROC;
        orp = &or_table[port];
@@ -1745,7 +1742,7 @@ static void reply (t_or * orp, int err, int may_block) {
        reply.DL_COUNT = orp->or_read_s;
 
        if (OK != (r = getuptime(&now)))
-               panic(__FILE__, "orinoco: getuptime() failed:", r);
+               panic("orinoco: getuptime() failed: %d", r);
 
        reply.DL_CLCK = now;
        r = send (orp->or_client, &reply);
@@ -1755,7 +1752,7 @@ static void reply (t_or * orp, int err, int may_block) {
        }
 
        if (r < 0)
-               panic(__FILE__, "orinoco: send failed:", r);
+               panic("orinoco: send failed: %d", r);
 
        orp->or_read_s = 0;
        orp->or_flags &= ~(OR_F_PACK_SENT | OR_F_PACK_RECV);
@@ -1995,7 +1992,7 @@ static void or_readv (message * mp, int from_int, int vectored) {
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= OR_PORT_NR)
-               panic(__FILE__, "orinoco: illegal port:", dl_port);
+               panic("orinoco: illegal port: %d", dl_port);
 
        orp = &or_table[dl_port];
        or_client = mp->DL_PROC;
@@ -2116,7 +2113,7 @@ static void or_readv_s (message * mp, int from_int) {
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= OR_PORT_NR)
-               panic(__FILE__, "orinoco: illegal port:", dl_port);
+               panic("orinoco: illegal port: %d", dl_port);
 
        orp = &or_table[dl_port];
        or_client = mp->DL_PROC;
@@ -2162,8 +2159,7 @@ static void or_readv_s (message * mp, int from_int) {
                                (vir_bytes)orp->or_iovec_s,
                                n * sizeof(orp->or_iovec_s[0]), D);
                if (cps != OK) 
-                       panic(__FILE__, 
-                       "orinoco: warning, sys_safecopytp failed:", cps);
+                       panic("orinoco: warning: sys_safecopytp failed: %d", cps);
 
                for (j = 0, iovp = orp->or_iovec_s; j < n; j++, iovp++) {
                        s = iovp->iov_size;
@@ -2174,9 +2170,7 @@ static void or_readv_s (message * mp, int from_int) {
                        cps = sys_safecopyto(or_client, iovp->iov_grant, 0, 
                                        (vir_bytes) databuf + o, s, D);
                        if (cps != OK) 
-                               panic(__FILE__, 
-                               "orinoco: warning, sys_safecopy failed:", 
-                               cps);
+                               panic("orinoco: warning: sys_safecopy failed: %d", cps);
 
                        size += s;
                        if (size == length)
@@ -2336,7 +2330,7 @@ static void or_getstat (message * mp) {
 
        port = mp->DL_PORT;
        if (port < 0 || port >= OR_PORT_NR)
-               panic(__FILE__, "orinoco: illegal port:", port);
+               panic("orinoco: illegal port: %d", port);
        orp = &or_table[port];
        orp->or_client = mp->DL_PROC;
 
@@ -2348,7 +2342,7 @@ static void or_getstat (message * mp) {
        r = sys_datacopy(SELF, (vir_bytes)&stats, mp->DL_PROC,
                        (vir_bytes) mp->DL_ADDR, sizeof(stats));
        if(r != OK) {
-               panic(__FILE__, "or_getstat: send failed:", r); 
+               panic("or_getstat: send failed: %d", r);        
        }
 
        mp->m_type = DL_STAT_REPLY;
@@ -2357,7 +2351,7 @@ static void or_getstat (message * mp) {
 
        r = send(mp->m_source, mp);
        if(r != OK)
-               panic(__FILE__, "orinoco: getstat failed:", r);
+               panic("orinoco: getstat failed: %d", r);
 
        /*reply (orp, OK, FALSE);*/
 
@@ -2376,7 +2370,7 @@ static void or_getstat_s (message * mp) {
 
        port = mp->DL_PORT;
        if (port < 0 || port >= OR_PORT_NR)
-               panic(__FILE__, "orinoco: illegal port:", port);
+               panic("orinoco: illegal port: %d", port);
        assert(port==0);
        orp = &or_table[port];
        orp->or_client = mp->DL_PROC;
@@ -2389,7 +2383,7 @@ static void or_getstat_s (message * mp) {
        r = sys_safecopyto(mp->DL_PROC, mp->DL_GRANT, 0, 
                                (vir_bytes) &stats, sizeof(stats), D);
        if(r != OK) {
-               panic(__FILE__, "or_getstat_s: sys_safecopyto failed:", r);
+               panic("or_getstat_s: sys_safecopyto failed: %d", r);
        }
 
        mp->m_type = DL_STAT_REPLY;
@@ -2398,6 +2392,6 @@ static void or_getstat_s (message * mp) {
 
        r = send(mp->m_source, mp);
        if(r != OK)
-               panic(__FILE__, "orinoco: getstat_s failed:", r);
+               panic("orinoco: getstat_s failed: %d", r);
 }
 
index 29cdfdae233d47424461b31922675a80810cdb8b..38cb1489ea39bd962be0538c7f24262ec2ebc855 100644 (file)
@@ -173,12 +173,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("pci", "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("pci", "unable to map service", r);
+                               panic("unable to map service: %d", r);
                        }
                }
        }
@@ -696,7 +696,7 @@ PRIVATE void pci_intel_init()
 #endif
 
        if (nr_pcibus >= NR_PCIBUS)
-               panic("PCI","too many PCI busses", nr_pcibus);
+               panic("too many PCI busses: %d", nr_pcibus);
        busind= nr_pcibus;
        nr_pcibus++;
        pcibus[busind].pb_type= PBT_INTEL_HOST;
@@ -766,7 +766,7 @@ PRIVATE void probe_bus(int busind)
 printf("probe_bus(%d)\n", busind);
 #endif
        if (nr_pcidev >= NR_PCIDEV)
-               panic("PCI","too many PCI devices", nr_pcidev);
+               panic("too many PCI devices: %d", nr_pcidev);
        devind= nr_pcidev;
 
        busnr= pcibus[busind].pb_busnr;
@@ -894,7 +894,7 @@ printf("probe_bus(%d)\n", busind);
 #endif
 
                        if (nr_pcidev >= NR_PCIDEV)
-                         panic("PCI","too many PCI devices", nr_pcidev);
+                         panic("too many PCI devices: %d", nr_pcidev);
                        devind= nr_pcidev;
 
                        if (func == 0 && !(headt & PHT_MULTIFUNC))
@@ -1373,7 +1373,7 @@ PRIVATE void complete_bars(void)
 
        r= env_get_param("memory", memstr, sizeof(memstr));
        if (r != OK)
-               panic("pci", "env_get_param failed", r);
+               panic("env_get_param failed: %d", r);
        
        /* Set memgap_low to just above physical memory */
        memgap_low= 0;
@@ -1444,7 +1444,7 @@ PRIVATE void complete_bars(void)
        {
                printf("PCI: bad memory gap: [0x%x .. 0x%x>\n",
                        memgap_low, memgap_high);
-               panic(NULL, NULL, NO_NUM);
+               panic(NULL);
        }
 
        iogap_high= 0x10000;
@@ -1488,7 +1488,7 @@ PRIVATE void complete_bars(void)
                        printf("iogap_high too low, should panic\n");
                }
                else
-                       panic("pci", "iogap_high too low", iogap_high);
+                       panic("iogap_high too low: %d", iogap_high);
        }
        if (debug)
                printf("I/O range = [0x%x..0x%x>\n", iogap_low, iogap_high);
@@ -1507,7 +1507,7 @@ PRIVATE void complete_bars(void)
                        base= memgap_high-size;
                        base &= ~(u32_t)(size-1);
                        if (base < memgap_low)
-                               panic("pci", "memory base too low", base);
+                               panic("memory base too low: %d", base);
                        memgap_high= base;
                        bar_nr= pcidev[i].pd_bar[j].pb_nr;
                        reg= PCI_BAR + 4*bar_nr;
@@ -1542,7 +1542,7 @@ PRIVATE void complete_bars(void)
                        base &= 0xfcff;
 
                        if (base < iogap_low)
-                               panic("pci", "I/O base too low", base);
+                               panic("I/O base too low: %d", base);
 
                        iogap_high= base;
                        bar_nr= pcidev[i].pd_bar[j].pb_nr;
@@ -1581,7 +1581,7 @@ PRIVATE void complete_bars(void)
 
 bad_mem_string:
        printf("PCI: bad memory environment string '%s'\n", memstr);
-       panic(NULL, NULL, NO_NUM);
+       panic(NULL);
 }
 
 /*===========================================================================*
@@ -1607,7 +1607,7 @@ u32_t io_size;
                return; 
        }
        if (type != PBT_CARDBUS)
-               panic("pci", "update_bridge4dev_io: strange bus type", type);
+               panic("update_bridge4dev_io: strange bus type: %d", type);
 
        if (debug)
        {
@@ -1727,7 +1727,7 @@ int busind;
                        r= do_sis_isabr(bridge_dev);
                        break;
                default:
-                       panic("PCI","unknown ISA bridge type", type);
+                       panic("unknown ISA bridge type: %d", type);
                }
                return r;
        }
@@ -1847,7 +1847,7 @@ int busind;
                sbusn= pci_attr_r8_u(devind, PPB_SECBN);
 
                if (nr_pcibus >= NR_PCIBUS)
-                       panic("PCI","too many PCI busses", nr_pcibus);
+                       panic("too many PCI busses: %d", nr_pcibus);
                ind= nr_pcibus;
                nr_pcibus++;
                pcibus[ind].pb_type= PBT_PCIBRIDGE;
@@ -1878,7 +1878,7 @@ int busind;
                        pcibus[ind].pb_wsts= pcibr_via_wsts;
                        break;
                default:
-                   panic("PCI","unknown PCI-PCI bridge type", type);
+                   panic("unknown PCI-PCI bridge type: %d", type);
                }
                if (debug)
                {
@@ -1913,7 +1913,7 @@ int busnr;
                if (pcibus[i].pb_busnr == busnr)
                        return i;
        }
-       panic("pci", "get_busind: can't find bus", busnr);
+       panic("get_busind: can't find bus: %d", busnr);
 }
 
 /*===========================================================================*
@@ -1981,7 +1981,7 @@ PRIVATE int do_amd_isabr(int devind)
 
        /* Fake a device with the required function */
        if (nr_pcidev >= NR_PCIDEV)
-               panic("PCI","too many PCI devices", nr_pcidev);
+               panic("too many PCI devices: %d", nr_pcidev);
        xdevind= nr_pcidev;
        pcidev[xdevind].pd_busnr= busnr;
        pcidev[xdevind].pd_dev= dev;
index 3afd390621813ccc5e4db71e55b4f166d51ecf30..92447c37cd0bb816a68945e240e0c96e3ee038a8 100644 (file)
@@ -197,7 +197,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
   sa.sa_handler = SIG_MESS;
   sigemptyset(&sa.sa_mask);
   sa.sa_flags = 0;
-  if (sigaction(SIGTERM,&sa,NULL)<0) panic("PRN","sigaction failed", errno);
+  if (sigaction(SIGTERM,&sa,NULL)<0) panic("sigaction failed: %d", errno);
 
   return(OK);
 }
@@ -258,7 +258,7 @@ int safe;                   /* use virtual addresses or grant id's? */
         while (--retries > 0) {
             if(sys_inb(port_base + 1, &status) != OK) {
                printf("printer: sys_inb of %x failed\n", port_base+1);
-               panic(__FILE__,"sys_inb failed", NO_NUM);
+               panic("sys_inb failed");
            }
             if ((status & ON_LINE)) {          /* printer online! */
                prepare_output();
@@ -387,21 +387,21 @@ PRIVATE void do_initialize()
   /* Get the base port for first printer.  */
   if(sys_vircopy(SELF, BIOS_SEG, LPT1_IO_PORT_ADDR, 
        SELF, D, (vir_bytes) &port_base, LPT1_IO_PORT_SIZE) != OK) {
-       panic(__FILE__, "do_initialize: sys_vircopy failed", NO_NUM);
+       panic("do_initialize: sys_vircopy failed");
   }
   if(sys_outb(port_base + 2, INIT_PRINTER) != OK) {
        printf("printer: sys_outb of %x failed\n", port_base+2);
-       panic(__FILE__, "do_initialize: sys_outb init failed", NO_NUM);
+       panic("do_initialize: sys_outb init failed");
   }
   micro_delay(1000000/20);     /* easily satisfies Centronics minimum */
   if(sys_outb(port_base + 2, PR_SELECT) != OK) {
        printf("printer: sys_outb of %x failed\n", port_base+2);
-       panic(__FILE__, "do_initialize: sys_outb select failed", NO_NUM);
+       panic("do_initialize: sys_outb select failed");
   }
   irq_hook_id = 0;
   if(sys_irqsetpolicy(PRINTER_IRQ, 0, &irq_hook_id) != OK ||
      sys_irqenable(&irq_hook_id) != OK) {
-       panic(__FILE__, "do_initialize: irq enabling failed", NO_NUM);
+       panic("do_initialize: irq enabling failed");
   }
 }
 
@@ -453,10 +453,10 @@ PRIVATE void do_printer_output()
         */
        if(sys_outb(port_base + 2, PR_SELECT) != OK) {
                printf("printer: sys_outb of %x failed\n", port_base+2);
-               panic(__FILE__,"sys_outb failed", NO_NUM);
+               panic("sys_outb failed");
        }
        if(sys_irqenable(&irq_hook_id) != OK) {
-               panic(__FILE__,"sys_irqenable failed", NO_NUM);
+               panic("sys_irqenable failed");
        }
        return;
   }
@@ -467,7 +467,7 @@ PRIVATE void do_printer_output()
         */
        if(sys_inb(port_base + 1, &status) != OK) {
                printf("printer: sys_inb of %x failed\n", port_base+1);
-               panic(__FILE__,"sys_inb failed", NO_NUM);
+               panic("sys_inb failed");
        }
        if ((status & STATUS_MASK) == BUSY_STATUS) {
                /* Still busy with last output.  This normally happens
@@ -477,7 +477,7 @@ PRIVATE void do_printer_output()
                 * interrupts.  It may happen after a spurious interrupt.
                 */
                if(sys_irqenable(&irq_hook_id) != OK) {
-                       panic(__FILE__, "sys_irqenable failed\n", NO_NUM);
+                       panic("sys_irqenable failed");
                }
                return;
        }
@@ -489,7 +489,7 @@ PRIVATE void do_printer_output()
                pv_set(char_out[2], port_base+2, NEGATE_STROBE);
                if(sys_voutb(char_out, 3) != OK) {
                        /* request series of port outb */
-                       panic(__FILE__, "sys_voutb failed\n", NO_NUM);
+                       panic("sys_voutb failed");
                }
 
                user_vir_d++;
@@ -499,7 +499,7 @@ PRIVATE void do_printer_output()
                done_status = status;
                output_done();
                if(sys_irqenable(&irq_hook_id) != OK) {
-                       panic(__FILE__, "sys_irqenable failed\n", NO_NUM);
+                       panic("sys_irqenable failed");
                }
                return;
        }
@@ -510,7 +510,7 @@ PRIVATE void do_printer_output()
   done_status = OK;
   output_done();
   if(sys_irqenable(&irq_hook_id) != OK) {
-       panic(__FILE__, "sys_irqenable failed\n", NO_NUM);
+       panic("sys_irqenable failed");
   }
 }
 
index 666a48ecf89c4a8f028fec502459a6f244c469f7..4e383a677cc90f83837b486d01744b811978489e 100644 (file)
@@ -102,7 +102,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
   /* Retrieve first randomness buffer with parameters. */
   if (OK != (s=sys_getrandomness(&krandom))) {
-       report("RANDOM", "sys_getrandomness failed", s);
+       printf("RANDOM: sys_getrandomness failed: %d\n", s);
        exit(1);
   }
 
@@ -317,7 +317,7 @@ message *m_ptr;                             /* pointer to alarm message */
 
   /* Schedule new alarm for next m_random call. */
   if (OK != (s=sys_setalarm(KRANDOM_PERIOD, 0)))
-       report("RANDOM", "sys_setalarm failed", s);
+       printf("RANDOM: sys_setalarm failed: %d\n", s);
 }
 
 /*============================================================================*
index 001a1a78fd7961eb2522b49bf02060424ea36ed9..ad81e36764e2fc555bf91defb5c20121e4365ec4 100644 (file)
@@ -73,7 +73,7 @@ int count;
        printf("random_update: got %d samples for source %d\n", count, source);
 #endif
        if (source < 0 || source >= TOTAL_SOURCES)
-               panic("memory", "random_update: bad source", source);
+               panic("random_update: bad source: %d", source);
        for (i= 0; i<count; i++)
                add_sample(source, buf[i]);
        reseed();
index 06bd9204b5ef5b325b6d19160e46dfd5bd031566..fddf454b15bc8bda116f223a7932e870500bfbcb 100644 (file)
@@ -215,7 +215,7 @@ int main(int argc, char *argv[])
        while (TRUE)
        {
                if ((r= sef_receive(ANY, &m)) != OK)
-                       panic("rtl8139","sef_receive failed", r);
+                       panic("sef_receive failed: %d", r);
 
                if (is_notify(m.m_type)) {
                        switch (_ENDPOINT_P(m.m_source)) {
@@ -255,8 +255,8 @@ int main(int argc, char *argv[])
                                        break;
                                }
                                default:
-                                       panic("rtl8139","illegal notify from",
-                                                               m.m_source);
+                                       panic("illegal notify from: %d",
+                                       m.m_source);
                        }
 
                        /* done, get nwe message */
@@ -279,7 +279,7 @@ int main(int argc, char *argv[])
                case DL_STOP:   do_stop(&m);                    break;
 #endif
                default:
-                       panic("rtl8139","illegal message", m.m_type);
+                       panic("illegal message: %d", m.m_type);
                }
        }
 }
@@ -610,10 +610,8 @@ re_t *rep;
                                continue;
                        if (pcitab[i].did != did)
                                continue;
-                       if (pcitab[i].checkclass)
-                       {
-                         panic("rtl_probe",
-                           "class check not implemented", NO_NUM);
+                       if (pcitab[i].checkclass) {
+                               panic("class check not implemented");
                        }
                        break;
                }
@@ -645,10 +643,8 @@ re_t *rep;
        pci_reserve(devind);
        /* printf("cr = 0x%x\n", pci_attr_r16(devind, PCI_CR)); */
        bar= pci_attr_r32(devind, PCI_BAR) & 0xffffffe0;
-       if (bar < 0x400)
-       {
-               panic("rtl_probe",
-                       "base address is not properly configured", NO_NUM);
+       if (bar < 0x400) {
+               panic("base address is not properly configured");
        }
        rep->re_base_port= bar;
 
@@ -720,7 +716,7 @@ re_t *rep;
 #define BUF_ALIGNMENT (64*1024)
 
        if(!(mallocbuf = alloc_contig(BUF_ALIGNMENT + tot_bufsize, 0, &buf))) {
-           panic("RTL8139","Couldn't allocate kernel buffer",NO_NUM);
+           panic("Couldn't allocate kernel buffer");
        }
 
        /* click-align mallocced buffer. this is what we used to get
@@ -816,7 +812,7 @@ re_t *rep;
                        break;
        } while (getuptime(&t1)==OK && (t1-t0) < system_hz);
        if (rl_inb(port, RL_BMCR) & MII_CTRL_RST)
-               panic("rtl8139","reset PHY failed to complete", NO_NUM);
+               panic("reset PHY failed to complete");
 #endif
 
        /* Reset the device */
@@ -995,7 +991,7 @@ static void rl_readv(message *mp, int from_int, int vectored)
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= RE_PORT_NR)
-               panic("rtl8139"," illegal port", dl_port);
+               panic(" illegal port: %d", dl_port);
        rep= &re_table[dl_port];
        re_client= mp->DL_PROC;
        rep->re_client= re_client;
@@ -1048,7 +1044,7 @@ static void rl_readv(message *mp, int from_int, int vectored)
                printf("rxstat = 0x%08lx\n", rxstat);
                printf("d_start: 0x%x, d_end: 0x%x, rxstat: 0x%lx\n",
                        d_start, d_end, rxstat);
-               panic("rtl8139","received packet not OK", NO_NUM);
+               panic("received packet not OK");
        }
        totlen= (rxstat >> RL_RXS_LEN_S);
        if (totlen < 8 || totlen > 2*ETH_MAX_PACK_SIZE)
@@ -1060,7 +1056,7 @@ static void rl_readv(message *mp, int from_int, int vectored)
                printf(
                "d_start: 0x%x, d_end: 0x%x, totlen: %d, rxstat: 0x%lx\n",
                        d_start, d_end, totlen, rxstat);
-               panic(NULL, NULL, NO_NUM);
+               panic(NULL);
        }
 
 #if 0
@@ -1167,9 +1163,9 @@ static void rl_readv(message *mp, int from_int, int vectored)
 #if 0
                size= mp->DL_COUNT;
                if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE_TAGGED)
-                       panic("rtl8139","invalid packet size", size);
+                       panic("invalid packet size: %d", size);
                if (OK != sys_umap(re_client, D, (vir_bytes)mp->DL_ADDR, size, &phys_user))
-                       panic("rtl8139","umap_local failed", NO_NUM);
+                       panic("umap_local failed");
 
                p= rep->re_tx[tx_head].ret_buf;
                cps = sys_abscopy(phys_user, p, size);
@@ -1243,7 +1239,7 @@ static void rl_readv_s(message *mp, int from_int)
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= RE_PORT_NR)
-               panic("rtl8139"," illegal port", dl_port);
+               panic(" illegal port: %d", dl_port);
        rep= &re_table[dl_port];
        re_client= mp->DL_PROC;
        rep->re_client= re_client;
@@ -1296,7 +1292,7 @@ static void rl_readv_s(message *mp, int from_int)
                printf("rxstat = 0x%08lx\n", rxstat);
                printf("d_start: 0x%x, d_end: 0x%x, rxstat: 0x%lx\n",
                        d_start, d_end, rxstat);
-               panic("rtl8139","received packet not OK", NO_NUM);
+               panic("received packet not OK");
        }
        totlen= (rxstat >> RL_RXS_LEN_S);
        if (totlen < 8 || totlen > 2*ETH_MAX_PACK_SIZE)
@@ -1308,7 +1304,7 @@ static void rl_readv_s(message *mp, int from_int)
                printf(
                "d_start: 0x%x, d_end: 0x%x, totlen: %d, rxstat: 0x%lx\n",
                        d_start, d_end, totlen, rxstat);
-               panic(NULL, NULL, NO_NUM);
+               panic(NULL);
        }
 
 #if 0
@@ -1337,9 +1333,8 @@ static void rl_readv_s(message *mp, int from_int)
                cps = sys_safecopyfrom(re_client, mp->DL_GRANT, iov_offset,
                        (vir_bytes) rep->re_iovec_s,
                        n * sizeof(rep->re_iovec_s[0]), D);
-               if (cps != OK)
-               {
-                       panic(__FILE__, "rl_readv_s: sys_safecopyfrom failed",
+               if (cps != OK) {
+                       panic("rl_readv_s: sys_safecopyfrom failed: %d",
                                cps);
                }
 
@@ -1354,7 +1349,7 @@ static void rl_readv_s(message *mp, int from_int)
 
 #if 0
                        if (sys_umap(re_client, D, iovp->iov_addr, s, &dst_phys) != OK)
-                         panic("rtl8139","umap_local failed\n", NO_NUM);
+                         panic("umap_local failed");
 #endif
 
                        if (o >= RX_BUFSIZE)
@@ -1371,20 +1366,15 @@ static void rl_readv_s(message *mp, int from_int)
                                cps = sys_safecopyto(re_client,
                                        iovp->iov_grant, 0, 
                                        (vir_bytes) rep->v_re_rx_buf+o, s1, D);
-                               if (cps != OK)
-                               {
-                                       panic(__FILE__,
-                                       "rl_readv_s: sys_safecopyto failed",
-                                               cps);
+                               if (cps != OK) { 
+                                       panic("rl_readv_s: sys_safecopyto failed: %d",
+                                       cps);
                                }
                                cps = sys_safecopyto(re_client,
                                        iovp->iov_grant, s1, 
                                        (vir_bytes) rep->v_re_rx_buf, s-s1, S);
-                               if (cps != OK)
-                               {
-                                       panic(__FILE__,
-                                       "rl_readv_s: sys_safecopyto failed",
-                                               cps);
+                               if (cps != OK) {
+                                       panic("rl_readv_s: sys_safecopyto failed: %d", cps);
                                }
                        }
                        else
@@ -1393,9 +1383,7 @@ static void rl_readv_s(message *mp, int from_int)
                                        iovp->iov_grant, 0,
                                        (vir_bytes) rep->v_re_rx_buf+o, s, D);
                                if (cps != OK)
-                                       panic(__FILE__,
-                                       "rl_readv_s: sys_safecopyto failed",
-                                               cps);
+                                       panic("rl_readv_s: sys_safecopyto failed: %d", cps);
                        }
 
                        size += s;
@@ -1474,7 +1462,7 @@ static void rl_writev(message *mp, int from_int, int vectored)
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= RE_PORT_NR)
-               panic("rtl8139","illegal port", port);
+               panic("illegal port: %d", port);
        rep= &re_table[port];
        re_client= mp->DL_PROC;
        rep->re_client= re_client;
@@ -1532,14 +1520,12 @@ if (cps != OK) printf("RTL8139: warning, sys_vircopy failed: %d\n", cps);
                        for (j= 0, iovp= rep->re_iovec; j<n; j++, iovp++)
                        {
                                s= iovp->iov_size;
-                               if (size + s > ETH_MAX_PACK_SIZE_TAGGED)
-                               {
-                                 panic("rtl8139","invalid packet size",
-                                   NO_NUM);
+                               if (size + s > ETH_MAX_PACK_SIZE_TAGGED) { 
+                                       panic("invalid packet size");
                                }
 
                                if (OK != sys_umap(re_client, D, iovp->iov_addr, s, &phys_user))
-                                 panic("rtl8139","umap_local failed\n", NO_NUM);
+                                 panic("umap_local failed");
 
                                cps = sys_vircopy(re_client, D, iovp->iov_addr,
                                        SELF, D, (vir_bytes) ret, s);
@@ -1549,13 +1535,13 @@ if (cps != OK) printf("RTL8139: warning, sys_vircopy failed: %d\n", cps);
                        }
                }
                if (size < ETH_MIN_PACK_SIZE)
-                       panic("rtl8139","invalid packet size", size);
+                       panic("invalid packet size: %d", size);
        }
        else
        {  
                size= mp->DL_COUNT;
                if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE_TAGGED)
-                       panic("rtl8139","invalid packet size", size);
+                       panic("invalid packet size: %d", size);
                ret = rep->re_tx[tx_head].v_ret_buf;
                cps = sys_vircopy(re_client, D, (vir_bytes)mp->DL_ADDR, 
                        SELF, D, (vir_bytes) ret, size);
@@ -1595,7 +1581,7 @@ suspend:
 #endif
 
        if (from_int)
-               panic("rtl8139","should not be sending\n", NO_NUM);
+               panic("should not be sending");
 
        rep->re_tx_mess= *mp;
        reply(rep, OK, FALSE);
@@ -1617,7 +1603,7 @@ static void rl_writev_s(message *mp, int from_int)
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= RE_PORT_NR)
-               panic("rtl8139","illegal port", port);
+               panic("illegal port: %d", port);
        rep= &re_table[port];
        re_client= mp->DL_PROC;
        rep->re_client= re_client;
@@ -1666,34 +1652,27 @@ static void rl_writev_s(message *mp, int from_int)
                cps = sys_safecopyfrom(re_client, mp->DL_GRANT, iov_offset,
                        (vir_bytes) rep->re_iovec_s,
                        n * sizeof(rep->re_iovec_s[0]), D);
-               if (cps != OK)
-               {
-                       panic(__FILE__, "rl_writev_s: sys_safecopyfrom failed",
-                               cps);
+               if (cps != OK) {
+                       panic("rl_writev_s: sys_safecopyfrom failed: %d", cps);
                }
 
                for (j= 0, iovp= rep->re_iovec_s; j<n; j++, iovp++)
                {
                        s= iovp->iov_size;
-                       if (size + s > ETH_MAX_PACK_SIZE_TAGGED)
-                       {
-                         panic("rtl8139","invalid packet size",
-                           NO_NUM);
+                       if (size + s > ETH_MAX_PACK_SIZE_TAGGED) {
+                               panic("invalid packet size");
                        }
                        cps = sys_safecopyfrom(re_client, iovp->iov_grant, 0,
                                (vir_bytes) ret, s, D);
-                       if (cps != OK)
-                       {
-                               panic(__FILE__,
-                                       "rl_writev_s: sys_safecopyfrom failed",
-                                       cps);
+                       if (cps != OK) { 
+                               panic("rl_writev_s: sys_safecopyfrom failed: %d",       cps);
                        }
                        size += s;
                        ret += s;
                }
        }
        if (size < ETH_MIN_PACK_SIZE)
-               panic("rtl8139","invalid packet size", size);
+               panic("invalid packet size: %d", size);
 
        rl_outl(rep->re_base_port, RL_TSD0+tx_head*4, 
                rep->re_ertxth | size);
@@ -1728,7 +1707,7 @@ suspend:
 #endif
 
        if (from_int)
-               panic("rtl8139","should not be sending\n", NO_NUM);
+               panic("should not be sending");
 
        rep->re_tx_mess= *mp;
        reply(rep, OK, FALSE);
@@ -2152,7 +2131,7 @@ re_t *rep;
                        break;
        } while (getuptime(&t1)==OK && (t1-t0) < system_hz);
        if (rl_inb(port, RL_CR) & RL_CR_RE)
-               panic("rtl8139","cannot disable receiver", NO_NUM);
+               panic("cannot disable receiver");
 
 #if 0
        printf("RBSTART = 0x%08x\n", rl_inl(port, RL_RBSTART));
@@ -2200,7 +2179,7 @@ message *mp;
 
        port = mp->DL_PORT;
        if (port < 0 || port >= RE_PORT_NR)
-               panic("rtl8139","illegal port", port);
+               panic("illegal port: %d", port);
        rep= &re_table[port];
        rep->re_client= mp->DL_PROC;
 
@@ -2212,14 +2191,14 @@ message *mp;
        r = sys_datacopy(SELF, (vir_bytes) &stats, mp->DL_PROC,
                (vir_bytes) mp->DL_ADDR, sizeof(stats));
        if (r != OK)
-               panic(__FILE__, "rl_getstat: sys_datacopy failed", r);
+               panic("rl_getstat: sys_datacopy failed: %d", r);
 
        mp->m_type= DL_STAT_REPLY;
        mp->DL_PORT= port;
        mp->DL_STAT= OK;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic("RTL8139", "rl_getstat: send failed: %d\n", r);
+               panic("rl_getstat: send failed: %d", r);
 }
 
 /*===========================================================================*
@@ -2234,7 +2213,7 @@ message *mp;
 
        port = mp->DL_PORT;
        if (port < 0 || port >= RE_PORT_NR)
-               panic("rtl8139","illegal port", port);
+               panic("illegal port: %d", port);
        rep= &re_table[port];
        rep->re_client= mp->DL_PROC;
 
@@ -2246,14 +2225,14 @@ message *mp;
        r = sys_safecopyto(mp->DL_PROC, mp->DL_GRANT, 0,
                (vir_bytes) &stats, sizeof(stats), D);
        if (r != OK)
-               panic(__FILE__, "rl_getstat_s: sys_safecopyto failed", r);
+               panic("rl_getstat_s: sys_safecopyto failed: %d", r);
 
        mp->m_type= DL_STAT_REPLY;
        mp->DL_PORT= port;
        mp->DL_STAT= OK;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic("RTL8139", "rl_getstat_s: send failed: %d\n", r);
+               panic("rl_getstat_s: send failed: %d", r);
 }
 
 
@@ -2270,7 +2249,7 @@ message *mp;
        mp->m_type= DL_NAME_REPLY;
        r= send(mp->m_source, mp);
        if (r != OK)
-               panic("RTL8139", "rl_getname: send failed: %d\n", r);
+               panic("rl_getname: send failed: %d", r);
 }
 
 
@@ -2299,7 +2278,7 @@ int may_block;
        reply.DL_STAT = status | ((u32_t) err << 16);
        reply.DL_COUNT = rep->re_read_s;
        if (OK != (r = getuptime(&now)))
-               panic("rtl8139","getuptime() failed:", r);
+               panic("getuptime() failed: %d", r);
        reply.DL_CLCK = now;
 
        r= send(rep->re_client, &reply);
@@ -2314,7 +2293,7 @@ int may_block;
 
        if (r < 0) {
                printf("RTL8139 tried sending to %d, type %d\n", rep->re_client, reply.m_type);
-               panic("rtl8139","send failed:", r);
+               panic("send failed: %d", r);
        }
        
        rep->re_read_s = 0;
@@ -2329,7 +2308,7 @@ message *req;
 message *reply_mess;
 {
        if (send(req->m_source, reply_mess) != OK)
-               panic("rtl8139","unable to mess_reply", NO_NUM);
+               panic("unable to mess_reply");
 }
 
 #if 0
@@ -2553,10 +2532,8 @@ re_t *rep;
                                if (!(rl_inb(port, RL_CR) & RL_CR_TE))
                                        break;
                        } while (getuptime(&t1)==OK && (t1-t0) < system_hz);
-                       if (rl_inb(port, RL_CR) & RL_CR_TE)
-                       {
-                         panic("rtl8139","cannot disable transmitter",
-                                       NO_NUM);
+                       if (rl_inb(port, RL_CR) & RL_CR_TE) {
+                               panic("cannot disable transmitter");
                        }
                        rl_outb(port, RL_CR, cr | RL_CR_TE);
 
@@ -2963,7 +2940,7 @@ u16_t w;
                        break;
        } while (getuptime(&t1) == OK && (t1 == t0));
        if (!(inb_reg3(dep, 1) & 1))
-               panic("set_ee_word","device remains busy", NO_NUM);
+               panic("device remains busy");
 }
 
 static void ee_wds(dep)
index 0dae314f1574f76eaff5bd619dc6a4190c8bb1c3..26d5fc5c96f3f13e68895eafb19846a41def0e57 100644 (file)
@@ -296,7 +296,7 @@ int main(int argc, char *argv[])
 
        while (TRUE) {
                if ((r = sef_receive(ANY, &m)) != OK)
-                       panic("rtl8169", "sef_receive failed", r);
+                       panic("sef_receive failed: %d", r);
 
                if (is_notify(m.m_type)) {
                        switch (_ENDPOINT_P(m.m_source)) {
@@ -333,8 +333,7 @@ int main(int argc, char *argv[])
                                break;
                        }
                        default:
-                               panic("rtl8169", "illegal notify from",
-                                       m.m_type);
+                               panic("illegal notify from: %d",        m.m_type);
                        }
 
                        /* done, get nwe message */
@@ -349,7 +348,7 @@ int main(int argc, char *argv[])
                case DL_GETSTAT_S:      rl_getstat_s(&m);        break;
                case DL_GETNAME:        rl_getname(&m);          break;
                default:
-                       panic("rtl8169", "illegal message", m.m_type);
+                       panic("illegal message: %d", m.m_type);
                }
        }
 }
@@ -750,8 +749,7 @@ re_t *rep;
                        if (pcitab[i].did != did)
                                continue;
                        if (pcitab[i].checkclass) {
-                               panic("rtl_probe",
-                                       "class check not implemented", NO_NUM);
+                               panic("class check not implemented");
                        }
                        break;
                }
@@ -780,8 +778,7 @@ re_t *rep;
        pci_reserve(devind);
        bar = pci_attr_r32(devind, PCI_BAR) & 0xffffffe0;
        if (bar < 0x400) {
-               panic("rtl_probe",
-                       "base address is not properly configured", NO_NUM);
+               panic("base address is not properly configured");
        }
        rep->re_base_port = bar;
 
@@ -855,7 +852,7 @@ re_t *rep;
                tot_bufsize += 4096 - (tot_bufsize % 4096);
 
        if (!(mallocbuf = alloc_contig(tot_bufsize, AC_ALIGN64K, &buf)))
-               panic("RTL8169", "Couldn't allocate kernel buffer", NO_NUM);
+               panic("Couldn't allocate kernel buffer");
 
        /* Rx Descriptor */
        rep->re_rx_desc = (re_desc *)mallocbuf;
@@ -1279,7 +1276,7 @@ void transmittest(re_t *rep)
                        message m;
                        int r;
                        if ((r = sef_receive(ANY, &m)) != OK)
-                               panic("rtl8169", "sef_receive failed", r);
+                               panic("sef_receive failed: %d", r);
                } while(m.m_source != HARDWARE);
                assert(!(rep->re_flags & REF_SEND_AVAIL));
                rep->re_flags |= REF_SEND_AVAIL;
@@ -1306,7 +1303,7 @@ static void rl_readv_s(message *mp, int from_int)
        dl_port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (dl_port < 0 || dl_port >= RE_PORT_NR)
-               panic("rtl8169", " illegal port", dl_port);
+               panic(" illegal port: %d", dl_port);
        rep = &re_table[dl_port];
        re_client = mp->DL_PROC;
        rep->re_client = re_client;
@@ -1355,7 +1352,7 @@ readvs_loop:
                /* Someting went wrong */
                printf("rl_readv_s: bad length (%u) in status 0x%08lx\n",
                        totlen, rxstat);
-               panic(NULL, NULL, NO_NUM);
+               panic(NULL);
        }
 
        /* Should subtract the CRC */
@@ -1372,8 +1369,7 @@ readvs_loop:
                        (vir_bytes) rep->re_iovec_s,
                        n * sizeof(rep->re_iovec_s[0]), D);
                if (cps != OK) {
-                       panic(__FILE__, "rl_readv_s: sys_safecopyfrom failed",
-                               cps);
+                       panic("rl_readv_s: sys_safecopyfrom failed: %d",                                cps);
                }
 
                for (j = 0, iovp = rep->re_iovec_s; j < n; j++, iovp++) {
@@ -1386,8 +1382,7 @@ readvs_loop:
                        cps = sys_safecopyto(re_client, iovp->iov_grant, 0,
                                (vir_bytes) rep->re_rx[index].v_ret_buf + size, s, D);
                        if (cps != OK)
-                               panic(__FILE__,
-                               "rl_readv_s: sys_safecopyto failed", cps);
+                               panic("rl_readv_s: sys_safecopyto failed: %d", cps);
 
                        size += s;
                        if (size == packlen)
@@ -1449,7 +1444,7 @@ static void rl_writev_s(message *mp, int from_int)
        port = mp->DL_PORT;
        count = mp->DL_COUNT;
        if (port < 0 || port >= RE_PORT_NR)
-               panic("rtl8169", "illegal port", port);
+               panic("illegal port: %d", port);
        rep = &re_table[port];
        assert(mp);
        assert(port >= 0 && port < RE_PORT_NR);
@@ -1516,21 +1511,18 @@ static void rl_writev_s(message *mp, int from_int)
                        (vir_bytes) rep->re_iovec_s,
                        n * sizeof(rep->re_iovec_s[0]), D);
                if (cps != OK) {
-                       panic(__FILE__, "rl_writev_s: sys_safecopyfrom failed",
-                               cps);
+                       panic("rl_writev_s: sys_safecopyfrom failed: %d",                               cps);
                }
 
                for (j = 0, iovp = rep->re_iovec_s; j < n; j++, iovp++) {
                        s = iovp->iov_size;
                        if (size + s > ETH_MAX_PACK_SIZE_TAGGED)
-                               panic("rtl8169", "invalid packet size", NO_NUM);
+                               panic("invalid packet size");
 
                        cps = sys_safecopyfrom(re_client, iovp->iov_grant, 0,
                                (vir_bytes) ret, s, D);
                        if (cps != OK) {
-                               panic(__FILE__,
-                                       "rl_writev_s: sys_safecopyfrom failed",
-                                       cps);
+                               panic("rl_writev_s: sys_safecopyfrom failed: %d", cps);
                        }
                        size += s;
                        ret += s;
@@ -1538,7 +1530,7 @@ static void rl_writev_s(message *mp, int from_int)
        }
        assert(desc);
        if (size < ETH_MIN_PACK_SIZE)
-               panic("rtl8169", "invalid packet size", size);
+               panic("invalid packet size: %d", size);
 
        rep->re_tx[tx_head].ret_busy = TRUE;
 
@@ -1567,7 +1559,7 @@ static void rl_writev_s(message *mp, int from_int)
 
 suspend:
        if (from_int)
-               panic("rtl8169", "should not be sending\n", NO_NUM);
+               panic("should not be sending");
 
        rep->re_tx_mess = *mp;
        reply(rep, OK, FALSE);
@@ -1673,7 +1665,7 @@ message *mp;
 
        port = mp->DL_PORT;
        if (port < 0 || port >= RE_PORT_NR)
-               panic("rtl8169", "illegal port", port);
+               panic("illegal port: %d", port);
        rep = &re_table[port];
        rep->re_client = mp->DL_PROC;
 
@@ -1685,14 +1677,14 @@ message *mp;
        r = sys_datacopy(SELF, (vir_bytes) &stats, mp->DL_PROC,
                (vir_bytes) mp->DL_ADDR, sizeof(stats));
        if (r != OK)
-               panic(__FILE__, "rl_getstat: sys_datacopy failed", r);
+               panic("rl_getstat: sys_datacopy failed: %d", r);
 
        mp->m_type = DL_STAT_REPLY;
        mp->DL_PORT = port;
        mp->DL_STAT = OK;
        r = send(mp->m_source, mp);
        if (r != OK)
-               panic("RTL8169", "rl_getstat: send failed: %d\n", r);
+               panic("rl_getstat: send failed: %d", r);
 }
 
 /*===========================================================================*
@@ -1707,7 +1699,7 @@ message *mp;
 
        port = mp->DL_PORT;
        if (port < 0 || port >= RE_PORT_NR)
-               panic("rtl8169", "illegal port", port);
+               panic("illegal port: %d", port);
        rep = &re_table[port];
        rep->re_client = mp->DL_PROC;
 
@@ -1719,14 +1711,14 @@ message *mp;
        r = sys_safecopyto(mp->DL_PROC, mp->DL_GRANT, 0,
                (vir_bytes) &stats, sizeof(stats), D);
        if (r != OK)
-               panic(__FILE__, "rl_getstat_s: sys_safecopyto failed", r);
+               panic("rl_getstat_s: sys_safecopyto failed: %d", r);
 
        mp->m_type = DL_STAT_REPLY;
        mp->DL_PORT = port;
        mp->DL_STAT = OK;
        r = send(mp->m_source, mp);
        if (r != OK)
-               panic("RTL8169", "rl_getstat_s: send failed: %d\n", r);
+               panic("rl_getstat_s: send failed: %d", r);
 }
 
 
@@ -1743,7 +1735,7 @@ message *mp;
        mp->m_type = DL_NAME_REPLY;
        r = send(mp->m_source, mp);
        if (r != OK)
-               panic("RTL8169", "rl_getname: send failed: %d\n", r);
+               panic("rl_getname: send failed: %d", r);
 }
 
 
@@ -1772,7 +1764,7 @@ int may_block;
        reply.DL_STAT = status | ((u32_t) err << 16);
        reply.DL_COUNT = rep->re_read_s;
        if (OK != (r = getuptime(&now)))
-               panic("rtl8169", "getuptime() failed:", r);
+               panic("getuptime() failed: %d", r);
        reply.DL_CLCK = now;
 
        r = send(rep->re_client, &reply);
@@ -1785,7 +1777,7 @@ int may_block;
        if (r < 0) {
                printf("RTL8169 tried sending to %d, type %d\n",
                        rep->re_client, reply.m_type);
-               panic("rtl8169", "send failed:", r);
+               panic("send failed: %d", r);
        }
 
        rep->re_read_s = 0;
@@ -1800,7 +1792,7 @@ message *req;
 message *reply_mess;
 {
        if (send(req->m_source, reply_mess) != OK)
-               panic("rtl8169", "unable to mess_reply", NO_NUM);
+               panic("unable to mess_reply");
 }
 
 static void dump_phy(re_t *rep)
index 11f5f6f427cf0f49fa412a57c6d6c3efc8855fe0..c8cd4bfeea56586523884c359b0ce785faffa73d 100644 (file)
@@ -27,7 +27,7 @@ int port;
        unsigned long value;
 
        if ((s=sys_inb(port, &value)) != OK)
-               panic("SB16DSP","sys_inb() failed", s);
+               panic("sys_inb() failed: %d", s);
        
        return value;
 }
@@ -43,5 +43,5 @@ int value;
        int s;
        
        if ((s=sys_outb(port, value)) != OK)
-               panic("SB16DSP","sys_outb() failed", s);
+               panic("sys_outb() failed: %d", s);
 }
index 67e7ca935177a1267473655f0a19de4209e24c68..26722e66198e2902f71e53952ecb7ffaedacac9f 100644 (file)
@@ -182,7 +182,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
                DmaPhys += left;
        }
 #else /* CHIP != INTEL */
-       panic("SB16DSP","initialization failed, CHIP != INTEL", 0);
+       panic("initialization failed: CHIP != INTEL: %d", 0);
 #endif /* CHIP == INTEL */
 
        return(OK);
@@ -452,9 +452,9 @@ PRIVATE int dsp_init()
 
        /* register interrupt vector and enable irq */
        if ((s=sys_irqsetpolicy(SB_IRQ, IRQ_REENABLE, &irq_hook_id )) != OK)
-               panic("SB16DSP", "Couldn't set IRQ policy", s);
+               panic("Couldn't set IRQ policy: %d", s);
        if ((s=sys_irqenable(&irq_hook_id)) != OK)
-               panic("SB16DSP", "Couldn't enable IRQ", s);
+               panic("Couldn't enable IRQ: %d", s);
 
        DspAvail = 1;
        return OK;
index fe232de1ecb5b1346f2018e0bc11b6bb19b9ced0..b48e8de74d1ab1d8699ffb5265378c1ce96efc80 100644 (file)
@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
        {
                r= sef_receive(ANY, &m);
                if (r != OK)
-                       panic("ti1225", "sef_receive failed", r);
+                       panic("sef_receive failed: %d", r);
                printf("ti1225: got message %u from %d\n",
                        m.m_type, m.m_source);
        }
@@ -116,16 +116,16 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
                : (progname=env_argv[0]);
 
        if((r=tsc_calibrate()) != OK)
-               panic("ti1225", "tsc_calibrate failed", r);
+               panic("tsc_calibrate failed: %d", r);
 
        debug= 0;
        while (c= getopt(env_argc, env_argv, "d?"), c != -1)
        {
                switch(c)
                {
-               case '?': panic("ti1225", "Usage: ti1225 [-d]", NO_NUM);
+               case '?': panic("Usage: ti1225 [-d]");
                case 'd': debug++; break;
-               default: panic("ti1225", "getopt failed", NO_NUM);
+               default: panic("getopt failed");
                }
        }
 
@@ -151,11 +151,8 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
                                continue;
                        if (pcitab_ti[i].did != did)
                                continue;
-                       if (pcitab_ti[i].checkclass)
-                       {
-                               panic("ti1225",
-                               "fxp_probe: class check not implemented",
-                                       NO_NUM);
+                       if (pcitab_ti[i].checkclass) {
+                               panic("fxp_probe: class check not implemented");
                        }
                        break;
                }
@@ -236,7 +233,7 @@ struct port *pp;
        }
 
        if (v32 == 0)
-               panic("ti1225", "bad legacy-mode base address 0x%x\n", v32);
+               panic("bad legacy-mode base address: %d", v32);
        pp->p_exca_port= v32;
 
        if (debug)
@@ -249,7 +246,7 @@ struct port *pp;
        pp->p_hook = pp->p_irq;
        r= sys_irqsetpolicy(pp->p_irq, 0, &pp->p_hook);
        if (r != OK)
-               panic("ti1225","sys_irqsetpolicy failed", r);
+               panic("sys_irqsetpolicy failed: %d", r);
 #endif
 
        /* Clear CBB_BC_INTEXCA */
@@ -279,7 +276,7 @@ struct port *pp;
 #if USE_INTS
        r= sys_irqenable(&pp->p_hook);
        if (r != OK)
-               panic("ti1225","unable enable interrupts", r);
+               panic("unable enable interrupts: %d", r);
 #endif
 }
 
@@ -308,7 +305,7 @@ PRIVATE void map_regs(struct port *pp, u32_t base)
        r = ENOSYS;
 #endif
        if (r != OK)
-               panic("ti1225", "map_regs: sys_vm_map failed", r);
+               panic("map_regs: sys_vm_map failed: %d", r);
 }
 
 PRIVATE void do_int(pp)
@@ -489,7 +486,7 @@ struct port *pp;
 #if USE_INTS
        r= sys_irqenable(&pp->p_hook);
        if (r != OK)
-               panic("ti1225","unable enable interrupts", r);
+               panic("unable enable interrupts: %d", r);
 #endif
 
 }
@@ -502,7 +499,7 @@ PRIVATE u8_t do_inb(port_t port)
 
        r= sys_inb(port, &value);
        if (r != OK)
-               panic("ti1225","sys_inb failed", r);
+               panic("sys_inb failed: %d", r);
        return value;
 }
 
@@ -512,7 +509,7 @@ PRIVATE void do_outb(port_t port, u8_t value)
 
        r= sys_outb(port, value);
        if (r != OK)
-               panic("ti1225","sys_outb failed", r);
+               panic("sys_outb failed: %d", r);
 }
 
 
index 618c98a4ea74e6dfa40b253acaef57a0f9828c0e..8e1cbcb30363fcda4a47153893da19c8454801f0 100644 (file)
@@ -773,7 +773,7 @@ PRIVATE void beep()
   
   /* Fetch current time in advance to prevent beeping delay. */
   if ((s=getuptime(&now)) != OK)
-       panic("TTY","Console couldn't get clock's uptime.", s);
+       panic("Console couldn't get clock's uptime: %d", s);
   if (!beeping) {
        /* Set timer channel 2, square wave, with given frequency. */
         pv_set(char_out[0], TIMER_MODE, 0xB6); 
@@ -790,7 +790,7 @@ PRIVATE void beep()
   if (tty_timers->tmr_exp_time != tty_next_timeout) {
        tty_next_timeout = tty_timers->tmr_exp_time;
        if ((s=sys_setalarm(tty_next_timeout, 1)) != OK)
-               panic("TTY","Console couldn't set alarm.", s);
+               panic("Console couldn't set alarm: %d", s);
   }
 }
 
@@ -901,7 +901,7 @@ clock_t dur;
 
   /* Fetch current time in advance to prevent beeping delay. */
   if ((s=getuptime(&now)) != OK)
-       panic("TTY","Console couldn't get clock's uptime.", s);
+       panic("Console couldn't get clock's uptime: %d", s);
   if (!beeping) {
        /* Set timer channel 2, square wave, with given frequency. */
         pv_set(char_out[0], TIMER_MODE, 0xB6); 
@@ -918,7 +918,7 @@ clock_t dur;
   if (tty_timers->tmr_exp_time != tty_next_timeout) {
        tty_next_timeout = tty_timers->tmr_exp_time;
        if ((s=sys_setalarm(tty_next_timeout, 1)) != OK)
-               panic("TTY","Console couldn't set alarm.", s);
+               panic("Console couldn't set alarm: %d", s);
   }
 }
 
@@ -994,12 +994,12 @@ tty_t *tp;
        console_memory = vm_map_phys(SELF, (void *) vid_base, vid_size);
 
        if(console_memory == MAP_FAILED) 
-               panic("TTY","Console couldn't map video memory", NO_NUM);
+               panic("Console couldn't map video memory");
 
        font_memory = vm_map_phys(SELF, (void *)GA_VIDEO_ADDRESS, GA_FONT_SIZE);
 
        if(font_memory == MAP_FAILED) 
-               panic("TTY","Console couldn't map font memory", NO_NUM);
+               panic("Console couldn't map font memory");
 
 
        vid_size >>= 1;         /* word count */
@@ -1050,10 +1050,6 @@ PUBLIC void kputc(int c)
   return;
 #endif
 
-#if 0
-  if (panicing)
-#endif
-       cons_putk(c);
   if (c != 0) {
       kmess.km_buf[kmess.km_next] = c; /* put normal char in buffer */
       if (kmess.km_size < _KMESS_BUF_SIZE)
index f1fbfadbf965cb1f908121bca2ff52eddc7719bd..9a3be7b6f38581756875af555d0759018e2fb872 100644 (file)
@@ -259,7 +259,7 @@ message *m;
                if (kbdp->offset + n > KBD_BUFSZ)
                        n= KBD_BUFSZ-kbdp->offset;
                if (n <= 0)
-                       panic("TTY", "do_kbd(READ): bad n", n);
+                       panic("do_kbd(READ): bad n: %d", n);
                if(safecopy) {
                  r= sys_safecopyto(m->IO_ENDPT, (vir_bytes) m->ADDRESS, 0, 
                        (vir_bytes) &kbdp->buf[kbdp->offset], n, D);
@@ -427,7 +427,7 @@ message *m;
                if (kbdp->offset + n > KBD_BUFSZ)
                        n= KBD_BUFSZ-kbdp->offset;
                if (n <= 0)
-                       panic("TTY", "kbd_status: bad n", n);
+                       panic("kbd_status: bad n: %d", n);
                kbdp->req_size= 0;
                if(kbdp->req_safe) {
                  r= sys_safecopyto(kbdp->req_proc, kbdp->req_addr_g, 0,
@@ -519,7 +519,7 @@ message *m_ptr;
 
   if (isaux)
        kbdp= &kbdaux;
-  else if (kbd.nr_open && !panicing)
+  else if (kbd.nr_open)
        kbdp= &kbd;
   else
        kbdp= NULL;
@@ -707,13 +707,13 @@ PRIVATE void kbd_send()
                 * alarm.
                 */
                if ((r= getuptime(&now)) != OK)
-                       panic("TTY","Keyboard couldn't get clock's uptime.", r);
+                       panic("Keyboard couldn't get clock's uptime: %d", r);
                tmrs_settimer(&tty_timers, &tmr_kbd_wd, now+system_hz, kbd_watchdog,
                        NULL);
                if (tty_timers->tmr_exp_time != tty_next_timeout) {
                        tty_next_timeout = tty_timers->tmr_exp_time;
                        if ((r= sys_setalarm(tty_next_timeout, 1)) != OK)
-                               panic("TTY","Keyboard couldn't set alarm.", r);
+                               panic("Keyboard couldn't set alarm: %d", r);
                }
                kbd_watchdog_set= 1;
         }
@@ -919,7 +919,7 @@ PRIVATE int kbc_read()
 #if 0
        while (micro_elapsed(&ms) < 1000000);
 #endif
-       panic("TTY", "kbc_read failed to complete", NO_NUM);
+       panic("kbc_read failed to complete");
        return EINVAL;
 }
 
@@ -1017,18 +1017,18 @@ PUBLIC void kb_init_once(void)
       /* Set interrupt handler and enable keyboard IRQ. */
       irq_hook_id = KEYBOARD_IRQ;      /* id to be returned on interrupt */
       if ((i=sys_irqsetpolicy(KEYBOARD_IRQ, IRQ_REENABLE, &irq_hook_id)) != OK)
-          panic("TTY",  "Couldn't set keyboard IRQ policy", i);
+          panic("Couldn't set keyboard IRQ policy: %d", i);
       if ((i=sys_irqenable(&irq_hook_id)) != OK)
-          panic("TTY", "Couldn't enable keyboard IRQs", i);
+          panic("Couldn't enable keyboard IRQs: %d", i);
       kbd_irq_set |= (1 << KEYBOARD_IRQ);
 
       /* Set AUX interrupt handler and enable AUX IRQ. */
       aux_irq_hook_id = KBD_AUX_IRQ;   /* id to be returned on interrupt */
       if ((i=sys_irqsetpolicy(KBD_AUX_IRQ, IRQ_REENABLE,
                &aux_irq_hook_id)) != OK)
-          panic("TTY",  "Couldn't set AUX IRQ policy", i);
+          panic("Couldn't set AUX IRQ policy: %d", i);
       if ((i=sys_irqenable(&aux_irq_hook_id)) != OK)
-          panic("TTY", "Couldn't enable AUX IRQs", i);
+          panic("Couldn't enable AUX IRQs: %d", i);
       kbd_irq_set |= (1 << KBD_AUX_IRQ);
 
        /* Disable the keyboard and aux */
@@ -1319,13 +1319,13 @@ timer_t *tmrp;
        kbd_alive= 0;
 
        if ((r= getuptime(&now)) != OK)
-               panic("TTY","Keyboard couldn't get clock's uptime.", r);
+               panic("Keyboard couldn't get clock's uptime: %d", r);
        tmrs_settimer(&tty_timers, &tmr_kbd_wd, now+system_hz, kbd_watchdog,
                NULL);
        if (tty_timers->tmr_exp_time != tty_next_timeout) {
                tty_next_timeout = tty_timers->tmr_exp_time;
                if ((r= sys_setalarm(tty_next_timeout, 1)) != OK)
-                       panic("TTY","Keyboard couldn't set alarm.", r);
+                       panic("Keyboard couldn't set alarm: %d", r);
        }
        kbd_watchdog_set= 1;
 }
index 9f737eb1b9975d958469bfd3e96e243149539792..dbe45080627240bfa027915669ac675eea42b6fb 100644 (file)
@@ -171,7 +171,7 @@ PUBLIC int main(void)
        /* Get a request message. */
        r= sef_receive(ANY, &tty_mess);
        if (r != 0)
-               panic("TTY", "sef_receive failed with %d", r);
+               panic("sef_receive failed with: %d", r);
 
        /* First handle all kernel notification types that the TTY supports. 
         *  - An alarm went off, expire all timers and handle the events. 
@@ -342,7 +342,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
   /* Get kernel environment (protected_mode, pc_at and ega are needed). */ 
   if (OK != (r=sys_getmachine(&machine))) {
-    panic("TTY","Couldn't obtain kernel environment.", r);
+    panic("Couldn't obtain kernel environment: %d", r);
   }
 
   /* Initialize the TTY driver. */
@@ -1538,9 +1538,8 @@ int status;                       /* reply code */
    * placeholder for something that is not supposed to be a message.
    */
   if(code == TTY_REVIVE) {
-       panicing = 1;
        printf("%s:%d: ", file, line);
-       panic("TTY","tty_reply sending TTY_REVIVE", NO_NUM);
+       panic("tty_reply sending TTY_REVIVE");
   }
 
   status = sendnb(replyee, &tty_mess);
@@ -1565,7 +1564,7 @@ int mayflush;
 
   if (tp->tty_pgrp != 0)  {
       if (OK != (status = sys_kill(tp->tty_pgrp, sig))) {
-        panic("TTY","Error, call to sys_kill failed", status);
+        panic("Error; call to sys_kill failed: %d", status);
       }
   }
 
@@ -1668,7 +1667,7 @@ PRIVATE void expire_timers(void)
 
   /* Get the current time to compare the timers against. */
   if ((s=getuptime(&now)) != OK)
-       panic("TTY","Couldn't get uptime from clock.", s);
+       panic("Couldn't get uptime from clock: %d", s);
 
   /* Scan the queue of timers for expired timers. This dispatch the watchdog
    * functions of expired timers. Possibly a new alarm call must be scheduled.
@@ -1678,7 +1677,7 @@ PRIVATE void expire_timers(void)
   else {                                         /* set new sync alarm */
        tty_next_timeout = tty_timers->tmr_exp_time;
        if ((s=sys_setalarm(tty_next_timeout, 1)) != OK)
-               panic("TTY","Couldn't set synchronous alarm.", s);
+               panic("Couldn't set synchronous alarm: %d", s);
   }
 }
 
@@ -1695,7 +1694,7 @@ int enable;                       /* set timer if true, otherwise unset */
 
   /* Get the current time to calculate the timeout time. */
   if ((s=getuptime(&now)) != OK)
-       panic("TTY","Couldn't get uptime from clock.", s);
+       panic("Couldn't get uptime from clock: %d", s);
   if (enable) {
        exp_time = now + tty_ptr->tty_termios.c_cc[VTIME] * (system_hz/10);
        /* Set a new timer for enabling the TTY events flags. */
@@ -1714,7 +1713,7 @@ int enable;                       /* set timer if true, otherwise unset */
   else if (tty_timers->tmr_exp_time != tty_next_timeout) { 
        tty_next_timeout = tty_timers->tmr_exp_time;
        if ((s=sys_setalarm(tty_next_timeout, 1)) != OK)
-               panic("TTY","Couldn't set synchronous alarm.", s);
+               panic("Couldn't set synchronous alarm: %d", s);
   }
 }
 
index 82da3a7001d6e90b511f0d4f2d1147f7e8a4b705..e609781090ca648b9900177bedead332ac829f3e 100644 (file)
@@ -111,8 +111,6 @@ extern u32_t system_hz;             /* system clock frequency */
 extern unsigned long kbd_irq_set;
 extern unsigned long rs_irq_set;
 
-extern int panicing;   /* From panic.c in sysutil */
-
 /* Values for the fields. */
 #define NOT_ESCAPED        0   /* previous character is not LNEXT (^V) */
 #define ESCAPED            1   /* previous character was LNEXT (^V) */
index 1d6ac73cb740483c9f121ea1b4f1c74b81ea1c31..ea3aa37bcc036e046ea468dacb4a96784c433b56 100644 (file)
@@ -60,7 +60,6 @@
 #define BYTE            0377   /* mask for 8 bits */
 #define READING            0   /* copy data to user */
 #define WRITING            1   /* copy data from user */
-#define NO_NUM        0x8000   /* used as numerical argument to panic() */
 #define NIL_PTR   (char *) 0   /* generally useful expression */
 #define HAVE_SCATTERED_IO  1   /* scattered I/O is now standard */
 
index fbcd6f962b4a083b06160f58eb77a34f8c3d5704..dc3d7ea7f5b73292eb4670eb6b9476b875407046 100644 (file)
@@ -32,7 +32,7 @@ typedef struct { u16_t port; u32_t value; } pvl_pair_t;
                printf("%s:%d: actual port: 0x%x != 0x%lx || "  \
                        "actual value: 0x%x != 0x%lx\n",        \
                        __FILE__, __LINE__, (pv).port, _p, (pv).value, _v); \
-               panic(__FILE__, "pv_set(" #pv ", " #p ", " #v ")", NO_NUM); \
+               panic("pv_set(" #pv ", " #p ", " #v ")"); \
        }                                                       \
 } while(0)
 
index cc09c2dd452dabe958734224d92e4655d6cc655e..c6e4edb336e5d855f7eee1aeaeb7cddba2fdc2c0 100644 (file)
@@ -44,8 +44,7 @@ _PROTOTYPE( int fkey_ctl, (int req, int *fkeys, int *sfkeys)          );
 
 _PROTOTYPE( int printf, (const char *fmt, ...));
 _PROTOTYPE( void kputc, (int c));
-_PROTOTYPE( void report, (char *who, char *mess, int num));
-_PROTOTYPE( void panic, (char *who, char *mess, int num));
+_PROTOTYPE( void panic, (const char *fmt, ...));
 _PROTOTYPE( int getuptime, (clock_t *ticks));
 _PROTOTYPE( int getuptime2, (clock_t *ticks, time_t *boottime));
 _PROTOTYPE( int tickdelay, (clock_t ticks));
@@ -65,7 +64,7 @@ _PROTOTYPE( void get_randomness, (struct k_randomness *, int));
 #define asynsend(ep, msg) asynsend3(ep, msg, 0)
 _PROTOTYPE( int asynsend3, (endpoint_t ep, message *msg, int flags));
 
-#define ASSERT(c) if(!(c)) { panic(__FILE__, "assert " #c " failed at line", __LINE__); }
+#define ASSERT(c) if(!(c)) { panic("%s:%d: assert %s failed", __FILE__, __LINE__, #c); }
 
 /* timing library */
 #define TIMING_CATEGORIES       20
index f176632d18c1e65d1322fa166138561166ddfcc2..4503cddb4dbaa3bf3963ef7401dad13489e423e8 100644 (file)
@@ -167,7 +167,7 @@ struct memory {
 #define STATICINIT(v, n) \
        if(!(v)) {      \
                if(!((v) = alloc_contig(sizeof(*(v)) * (n), 0, NULL))) { \
-                       panic(__FILE__, "allocating " #v " failed", n); \
+                       panic("allocating " #v " failed: %d", n);       \
                }       \
        }
 
index 78ca63f6b0e53fec31fe8fd3b003b2b779ea0af9..d3b32a855f2a6d10f43087ebe159f58b16041190 100644 (file)
@@ -48,8 +48,7 @@ struct proc *p;
                        return ESRCH;
                pagefaults = rp->p_nextpagefault;
                if(!RTS_ISSET(rp, RTS_PAGEFAULT))
-                       minix_panic("non-PAGEFAULT process on pagefault chain",
-                               rp->p_endpoint);
+                       panic( "non-PAGEFAULT process on pagefault chain: %d",                          rp->p_endpoint);
                 m_ptr->SVMCTL_PF_WHO = rp->p_endpoint;
                 m_ptr->SVMCTL_PF_I386_CR2 = rp->p_pagefault.pf_virtual;
                m_ptr->SVMCTL_PF_I386_ERR = rp->p_pagefault.pf_flags;
index 4d9393abb0f49d1be1ebd32a3688ed453a377983..004b67a05781b2a817ac4fa2f34bc225d173eb91 100644 (file)
@@ -70,7 +70,7 @@ void pagefault( struct proc *pr,
                        proc_stacktrace(proc_addr(SYSTEM));
                }
                printf("pc of pagefault: 0x%lx\n", frame->eip);
-               minix_panic("page fault in system process", pr->p_endpoint);
+               panic("page fault in system process: %d",  pr->p_endpoint);
 
                return;
        }
@@ -163,8 +163,7 @@ PUBLIC void exception_handler(int is_nested, struct exception_frame * frame)
                        frame->eip = (reg_t) __user_copy_msg_pointer_failure;
                        return;
                default:
-                       minix_panic("Copy involving a user pointer "
-                                       "failed unexpectedly!", NO_NUM);
+                       panic("Copy involving a user pointer failed unexpectedly!");
                }
        }
   }
@@ -216,11 +215,11 @@ PUBLIC void exception_handler(int is_nested, struct exception_frame * frame)
                          (unsigned) saved_proc->p_reg.pc);
          proc_stacktrace(saved_proc);
 
-         minix_panic("exception in a kernel task", saved_proc->p_endpoint);
+         panic("exception in a kernel task: %d",  saved_proc->p_endpoint);
   }
   else {
          /* in an early stage of boot process we don't have processes yet */
-         minix_panic("exception in kernel while booting", NO_NUM);
+         panic("exception in kernel while booting");
   }
 }
 
index 095913cddedff7716374d150c8e8a578575f9986..742539502af56cb6e1cca57b1ff8c15d5150c98c 100644 (file)
@@ -48,7 +48,7 @@ FORWARD _PROTOTYPE( void vm_enable_paging, (void)                     );
 PUBLIC void vm_init(struct proc *newptproc)
 {
        if(vm_running)
-               minix_panic("vm_init: vm_running", NO_NUM);
+               panic("vm_init: vm_running");
        switch_address_space(newptproc);
        vm_enable_paging();
        vm_running = 1;
@@ -198,7 +198,7 @@ PRIVATE int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
                                NOREC_RETURN(linlincopy, EFAULT_DST);
                        }
 
-                       minix_panic("lin_lin_copy fault out of range", NO_NUM);
+                       panic("lin_lin_copy fault out of range");
 
                        /* Not reached. */
                        NOREC_RETURN(linlincopy, EFAULT);
@@ -229,7 +229,7 @@ PRIVATE u32_t phys_get32(phys_bytes addr)
 
        if((r=lin_lin_copy(NULL, addr, 
                proc_addr(SYSTEM), vir2phys(&v), sizeof(v))) != OK) {
-               minix_panic("lin_lin_copy for phys_get32 failed", r);
+               panic("lin_lin_copy for phys_get32 failed: %d",  r);
        }
 
        return v;
@@ -364,7 +364,7 @@ vir_bytes bytes;                /* # of bytes to be copied */
   phys_bytes seg_base;
 
   if(seg != T && seg != D && seg != S)
-       minix_panic("umap_local: wrong seg", seg);
+       panic("umap_local: wrong seg: %d",  seg);
 
   if (bytes <= 0) return( (phys_bytes) 0);
   if (vir_addr + bytes <= vir_addr) return 0;   /* overflow */
@@ -413,7 +413,7 @@ vir_bytes bytes;                /* # of bytes to be copied */
                                phys = 0;
                        }
                        if(phys == 0)
-                               minix_panic("vm_lookup returned phys", phys);
+                               panic("vm_lookup returned phys: %d",  phys);
                }
        
 
@@ -603,7 +603,7 @@ int delivermsg(struct proc *rp)
                printf("vir: 0x%lx lin was: 0x%lx umap now: 0x%lx\n",
                rp->p_delivermsg_vir, rp->p_delivermsg_lin,
                umap_local(rp, D, rp->p_delivermsg_vir, sizeof(message)));
-               minix_panic("that's wrong", NO_NUM);
+               panic("that's wrong");
        }
 
 #endif
@@ -847,7 +847,7 @@ int vmcheck;                        /* if nonzero, can return VMSUSPEND */
                struct proc *target;
                phys_bytes lin;
                if(r != EFAULT_SRC && r != EFAULT_DST)
-                       minix_panic("lin_lin_copy failed", r);
+                       panic("lin_lin_copy failed: %d",  r);
                if(!vmcheck || !caller) {
                        NOREC_RETURN(virtualcopy, r);
                }
@@ -861,7 +861,7 @@ int vmcheck;                        /* if nonzero, can return VMSUSPEND */
                        lin = phys_addr[_DST_];
                        target = procs[_DST_];
                } else {
-                       minix_panic("r strange", r);
+                       panic("r strange: %d",  r);
                }
 
 #if 0
index 539948d0ba9f54e52e431a5c0fd7c10e6108aac3..7866c8d520aaa3f25122de2e95c1a2202d564477 100644 (file)
@@ -648,9 +648,8 @@ copr_return:
        jmp     restart
 
 copr_not_available_in_kernel:
-       movl    $NO_NUM, 4(%esp)
        movl    $0, (%esp)
-       call    minix_panic
+       call    panic
 
 double_fault:
        EXCEPTION_ERR_CODE(DOUBLE_FAULT_VECTOR)
index 4fa7285185bf56575a5d4326505b7a4c439d6b5c..bbef77763c3a79823fc159085bf684f7d76e7f22 100644 (file)
@@ -135,7 +135,7 @@ PUBLIC void prot_init(void)
 
   /* Click-round kernel. */
   if(kinfo.data_base % CLICK_SIZE)
-       minix_panic("kinfo.data_base not aligned", NO_NUM);
+       panic("kinfo.data_base not aligned");
   kinfo.data_size = (phys_bytes) (CLICK_CEIL(kinfo.data_size));
 
   /* Build gdt and idt pointers in GDT where the BIOS expects them. */
@@ -330,7 +330,7 @@ for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; ++rp) {
      }
      if(fail) {
        printf("%d/%d checks failed\n", fail, checked);
-       minix_panic("wrong", fail);
+       panic("wrong: %d",  fail);
      }
 }
 
@@ -391,7 +391,7 @@ PUBLIC void printseg(char *banner, int iscs, struct proc *pr, u32_t selector)
        }
 
        if(desc->granularity & 0x20) {  /* reserved */
-               minix_panic("granularity reserved field set", NO_NUM);
+               panic("granularity reserved field set");
        }
 
        if(!(desc->access & PRESENT))
index a3f09ff0d39baa8afda5e0af0f92c0e571c8ca1f..8cada4f6382b5f9e10f85287842d4d1a62b1c96a 100644 (file)
@@ -118,7 +118,7 @@ void arch_watchdog_lockup(struct nmi_frame * frame)
                        frame->cs,
                        frame->eflags
                        );
-       minix_panic("Kernel lockup\n", NO_NUM);
+       panic("Kernel lockup");
 }
 
 void i386_watchdog_start(void)
index 60d3c1a6888f0829ea8582be0ec28e33f64b8d09..407a8ebfd4495ed89d0689d6e9e319ef1428af0a 100644 (file)
@@ -24,8 +24,7 @@ check_runqueues_f(char *file, int line)
   FIXME("check_runqueues being done");
 
 #define MYPANIC(msg) {         \
-       printf("check_runqueues:%s:%d: %s\n", file, line, msg); \
-       minix_panic("check_runqueues failed", NO_NUM);  \
+       panic("check_runqueues:%s:%d: %s\n", file, line, msg); \
        }
 
   for (xp = BEG_PROC_ADDR; xp < END_PROC_ADDR; ++xp) {
index cf376434aa1ad7b1efeab181f1c109aebdd73b0e..52dd75cba4c89f9f31a60304b3e921761fa6111f 100644 (file)
 
 #if DEBUG_VMASSERT
 #define vmassert(t) { \
-       if(!(t)) { minix_panic("vm: assert " #t " failed in " __FILE__, __LINE__); } }
+       if(!(t)) { panic("kernel:%s:%d: assert %s failed", __FILE__, __LINE__, #t); } }
 #else
 #define vmassert(t) { }
 #endif
 
 #define NOT_REACHABLE  do {                                            \
-       printf("NOT_REACHABLE at %s:%d\n", __FILE__, __LINE__); \
-       minix_panic("execution at an unexpected location\n", NO_NUM);   \
+       panic("NOT_REACHABLE at %s:%d", __FILE__, __LINE__);    \
        for(;;);                                                        \
 } while(0)
 
 #define NOT_IMPLEMENTED do {   \
-               printf("NOT_IMPLEMENTED at %s:%d\n", __FILE__, __LINE__); \
-               minix_panic("NOT_IMPLEMENTED", NO_NUM); \
+               panic("NOT_IMPLEMENTED at %s:%d", __FILE__, __LINE__); \
 } while(0)
 
 #ifdef CONFIG_BOOT_VERBOSE
index 33380b5ef61c5f3a24f48913e22d31ae8b4c2b00..d1168113d9aaaf1defe43a12d641919e064f87db 100644 (file)
@@ -32,7 +32,7 @@ PUBLIC void put_irq_handler( irq_hook_t* hook, int irq, irq_handler_t handler)
   unsigned long bitmap;
 
   if( irq < 0 || irq >= NR_IRQ_VECTORS )
-       minix_panic("invalid call to put_irq_handler", irq);
+       panic("invalid call to put_irq_handler: %d",  irq);
 
   line = &irq_handlers[irq];
 
@@ -48,7 +48,7 @@ PUBLIC void put_irq_handler( irq_hook_t* hook, int irq, irq_handler_t handler)
        if (!(bitmap & id)) break;
 
   if(id == 0)
-       minix_panic("Too many handlers for irq", irq);
+       panic("Too many handlers for irq: %d",  irq);
   
   hook->next = NULL;
   hook->handler = handler;
@@ -76,7 +76,7 @@ PUBLIC void rm_irq_handler( irq_hook_t* hook ) {
   irq_hook_t **line;
 
   if( irq < 0 || irq >= NR_IRQ_VECTORS ) 
-       minix_panic("invalid call to rm_irq_handler", irq);
+       panic("invalid call to rm_irq_handler: %d",  irq);
 
   /* disable the irq.  */
   irq_actids[hook->irq] |= hook->id;
index 17e99b290ef5290d730ef2d1bfaa1ea47fd7a35c..baa9d5f8ba081f9082f7724bbdaf617c7c63ef92 100644 (file)
@@ -241,10 +241,10 @@ PUBLIC void main()
   /*
    * enable timer interrupts and clock task on the boot CPU
    */
+
   if (boot_cpu_init_timer(system_hz)) {
-         minix_panic("FATAL : failed to initialize timer interrupts, "
-                         "cannot continue without any clock source!",
-                         NO_NUM);
+         panic( "FATAL : failed to initialize timer interrupts; "
+               "cannot continue without any clock source!");
   }
 
 /* Warnings for sanity checks that take time. These warnings are printed
index 26d612252dcb5d236a6b2927377f1fe58c494eb0..e159945e5250bef4fa46d62f3d4fc499e6363ff7 100644 (file)
@@ -210,8 +210,7 @@ check_misc_flags:
 
 #if DEBUG_SCHED_CHECK
                        if (proc_ptr->p_misc_flags & MF_SC_ACTIVE)
-                               minix_panic("MF_SC_ACTIVE and MF_SC_DEFER set",
-                                       NO_NUM);
+                               panic("MF_SC_ACTIVE and MF_SC_DEFER set");
 #endif
 
                        arch_do_syscall(proc_ptr);
@@ -311,7 +310,7 @@ long bit_map;                       /* notification event set or flags */
 
 #if DEBUG_SCHED_CHECK
        if (caller_ptr->p_misc_flags & MF_SC_ACTIVE)
-               minix_panic("MF_SC_ACTIVE already set", NO_NUM);
+               panic("MF_SC_ACTIVE already set");
 #endif
 
        /* Set a flag to allow reliable tracing of leaving the system call. */
@@ -322,7 +321,7 @@ long bit_map;                       /* notification event set or flags */
   if(caller_ptr->p_misc_flags & MF_DELIVERMSG) {
        printf("sys_call: MF_DELIVERMSG on for %s / %d\n",
                caller_ptr->p_name, caller_ptr->p_endpoint);
-       minix_panic("MF_DELIVERMSG on", NO_NUM);
+       panic("MF_DELIVERMSG on");
   }
 #endif
 
@@ -699,7 +698,7 @@ int flags;
            vmassert(!(caller_ptr->p_misc_flags & MF_DELIVERMSG));      
            vmassert(src_e == ANY || hisep == src_e);
            if((r=QueueMess(hisep, vir2phys(&m), caller_ptr)) != OK)  {
-               minix_panic("mini_receive: local QueueMess failed", NO_NUM);
+               panic("mini_receive: local QueueMess failed");
            }
             return(OK);                                        /* report success */
         }
@@ -794,7 +793,7 @@ endpoint_t dst_e;                   /* which process to notify */
       BuildNotifyMessage(&m, proc_nr(caller_ptr), dst_ptr);
       vmassert(!(dst_ptr->p_misc_flags & MF_DELIVERMSG));
       if((r=QueueMess(caller_ptr->p_endpoint, vir2phys(&m), dst_ptr)) != OK) {
-       minix_panic("mini_notify: local QueueMess failed", NO_NUM);
+       panic("mini_notify: local QueueMess failed");
       }
       RTS_UNSET(dst_ptr, RTS_RECEIVING);
       return(OK);
@@ -1165,7 +1164,7 @@ register struct proc *rp; /* this process is now runnable */
   NOREC_ENTER(enqueuefunc);
 
 #if DEBUG_SCHED_CHECK
-  if (rp->p_ready) minix_panic("enqueue already ready process", NO_NUM);
+  if (rp->p_ready) panic("enqueue already ready process");
 #endif
 
   /* Determine where to insert to process. */
@@ -1224,7 +1223,7 @@ PRIVATE void enqueue_head(struct proc *rp)
   int q = rp->p_priority;                      /* scheduling queue to use */
 
 #if DEBUG_SCHED_CHECK
-  if (rp->p_ready) minix_panic("enqueue already ready process", NO_NUM);
+  if (rp->p_ready) panic("enqueue already ready process");
 #endif
 
   /*
@@ -1271,12 +1270,12 @@ register struct proc *rp;       /* this process is no longer runnable */
   /* Side-effect for kernel: check if the task's stack still is ok? */
   if (iskernelp(rp)) {                                 
        if (*priv(rp)->s_stack_guard != STACK_GUARD)
-               minix_panic("stack overrun by task", proc_nr(rp));
+               panic("stack overrun by task: %d",  proc_nr(rp));
   }
 #endif
 
 #if DEBUG_SCHED_CHECK
-  if (! rp->p_ready) minix_panic("dequeue() already unready process", NO_NUM);
+  if (! rp->p_ready) panic("dequeue() already unready process");
 #endif
 
   /* Now make sure that the process is not in its ready queue. Remove the 
@@ -1466,7 +1465,7 @@ int *p, fatalflag;
 #endif
        } else ok = 1;
        if(!ok && fatalflag) {
-               minix_panic("invalid endpoint ", e);
+               panic("invalid endpoint: %d",  e);
        }
        return ok;
 }
index fc099f64567e6f8b70cbc44611861a8a5c95c189..eb9141876c7cbf504a66268d0b36617f96c7e380 100644 (file)
@@ -35,9 +35,6 @@ _PROTOTYPE( void main, (void)                                         );
 _PROTOTYPE( void prepare_shutdown, (int how)                           );
 _PROTOTYPE( void minix_shutdown, (struct timer *tp)                    );
 
-/* utility.c */
-_PROTOTYPE( void minix_panic, (char *s, int n)                         );
-
 /* proc.c */
 _PROTOTYPE( int do_ipc, (int call_nr, int src_dst, 
                                        message *m_ptr, long bit_map)   );
index 1674e589767abf8b0cb59c3d749025add1a0fa1c..6cc9179b34ddacaaf1410a7abbb1e7e7ec3ef890 100644 (file)
@@ -324,7 +324,7 @@ PUBLIC void send_sig(int proc_nr, int sig_nr)
   register struct proc *rp;
 
   if(!isokprocn(proc_nr) || isemptyn(proc_nr))
-       minix_panic("send_sig to empty process", proc_nr);
+       panic("send_sig to empty process: %d",  proc_nr);
 
   rp = proc_addr(proc_nr);
   sigaddset(&priv(rp)->s_sig_pending, sig_nr);
@@ -354,7 +354,7 @@ int sig_nr;                 /* signal to be sent */
   register struct proc *rp;
 
   if (proc_nr == PM_PROC_NR)
-       minix_panic("cause_sig: PM gets signal", NO_NUM);
+       panic("cause_sig: PM gets signal");
 
   /* Check if the signal is already pending. Process it otherwise. */
   rp = proc_addr(proc_nr);
@@ -458,7 +458,7 @@ register struct proc *rc;           /* slot of process to clean up */
   register struct proc *rp;            /* iterate over process table */
   register struct proc **xpp;          /* iterate over caller queue */
 
-  if(isemptyp(rc)) minix_panic("clear_proc: empty process", rc->p_endpoint);
+  if(isemptyp(rc)) panic("clear_proc: empty process: %d",  rc->p_endpoint);
 
   if(rc->p_endpoint == PM_PROC_NR || rc->p_endpoint == VFS_PROC_NR ||
        rc->p_endpoint == VM_PROC_NR)
@@ -468,7 +468,7 @@ register struct proc *rc;           /* slot of process to clean up */
         */
        printf("died: ");
        proc_stacktrace(rc);
-       minix_panic("system process died", rc->p_endpoint);
+       panic("system process died: %d",  rc->p_endpoint);
   }
 
   /* Make sure that the exiting process is no longer scheduled. */
index ac078b6f1b0e2dbc5c51c9c1eb227bd932840a02..7656e2586da2998cf6e57740e2b18af15b62998e 100644 (file)
@@ -147,7 +147,7 @@ irq_hook_t *hook;
    * automatically get their interrupt hooks unhooked.
    */
   if(!isokendpt(hook->proc_nr_e, &proc_nr))
-     minix_panic("invalid interrupt handler", hook->proc_nr_e);
+     panic("invalid interrupt handler: %d", hook->proc_nr_e);
 
   /* Add a bit for this interrupt to the process' pending interrupts. When 
    * sending the notification message, this bit map will be magically set
index 721c8349fee6dd8ab35ba3c58d3a0809857ae639..688ce223dafdc805bd0122f7e0d8dea9209f8e83 100644 (file)
@@ -350,7 +350,7 @@ PUBLIC int do_safecopy(struct proc * caller, message * m_ptr)
                src_seg = m_ptr->SCP_SEG;
                dst_seg = D;
                access = CPF_WRITE;
-       } else minix_panic("Impossible system call nr. ", m_ptr->m_type);
+       } else panic("Impossible system call nr.: %d", m_ptr->m_type);
 
        return safecopy(caller, m_ptr->SCP_FROM_TO, caller->p_endpoint,
                (cp_grant_id_t) m_ptr->SCP_GID, src_seg, dst_seg,
index f9b06b0024ce3dd8636f4b3b5f82b8f962cf9157..0bb92579554fcee7d51ecbb0d80b34994a683d7e 100644 (file)
@@ -47,7 +47,7 @@ PUBLIC int do_sysctl(struct proc * caller, message * m_ptr)
         return(EINVAL);
   }
 
-  minix_panic("do_sysctl: can't happen", NO_NUM);
+  panic("do_sysctl: can't happen");
 
   return(OK);
 }
index 4ed207d39558fc1b21c225342324f37b5dc9dbc8..6a4d66a5ab486428e197291c5019a879ca65f8d8 100644 (file)
@@ -91,7 +91,7 @@ PUBLIC int do_umap(struct proc * caller, message * m_ptr)
        return EFAULT;
       }
       if(phys_addr == 0)
-       minix_panic("vm_lookup returned zero physical address", NO_NUM);
+       panic("vm_lookup returned zero physical address");
       break;
   default:
       if((r=arch_umap(targetpr, offset, count, seg_type, &lin_addr))
index 87bd52f78847debcf46818db143033d0eff25aad..d4ca807ec634011f319556b9f5f347d9ec3d6013 100644 (file)
@@ -158,7 +158,7 @@ PUBLIC int do_vdevio(struct proc * caller, message * m_ptr)
   return(OK);
 
 bad:
-       minix_panic("do_vdevio: unaligned port", port);
+       panic("do_vdevio: unaligned port: %d", port);
        return EPERM;
 }
 
index d5955fd278ccc048d6fe02541d56ee4045c2d89e..94adbde3cfd364f0f1011d8d201a2f3a554e8741 100644 (file)
@@ -56,8 +56,7 @@ PUBLIC int do_vmctl(struct proc * caller, message * m_ptr)
 #if 0
                if(!RTS_ISSET(target, RTS_VMREQTARGET)) {
                        printf("set stack: %s\n", rp->p_vmrequest.stacktrace);
-                       minix_panic("RTS_VMREQTARGET not set for target",
-                               NO_NUM);
+                       panic( "RTS_VMREQTARGET not set for target");
                }
 #endif
 #endif
@@ -95,7 +94,7 @@ PUBLIC int do_vmctl(struct proc * caller, message * m_ptr)
                                (void *) rp->p_endpoint;
                        break;
                default:
-                       minix_panic("VMREQUEST wrong type", NO_NUM);
+                       panic("VMREQUEST wrong type");
                }
 
                rp->p_vmrequest.vmresult = VMSUSPEND;
@@ -148,8 +147,7 @@ PUBLIC int do_vmctl(struct proc * caller, message * m_ptr)
                        printf("suspended with stack: %s\n",
                                p->p_vmrequest.stacktrace);
 #endif
-                       minix_panic("strange request type",
-                               p->p_vmrequest.type);
+                       panic( "strange request type: %d",p->p_vmrequest.type);
                }
 
                RTS_UNSET(p, RTS_VMREQUEST);
@@ -157,17 +155,17 @@ PUBLIC int do_vmctl(struct proc * caller, message * m_ptr)
 
        case VMCTL_ENABLE_PAGING:
                if(vm_running) 
-                       minix_panic("do_vmctl: paging already enabled", NO_NUM);
+                       panic("do_vmctl: paging already enabled");
                vm_init(p);
                if(!vm_running)
-                       minix_panic("do_vmctl: paging enabling failed", NO_NUM);
+                       panic("do_vmctl: paging enabling failed");
                vmassert(p->p_delivermsg_lin ==
                  umap_local(p, D, p->p_delivermsg_vir, sizeof(message)));
                if ((err = arch_enable_paging()) != OK) {
                        return err;
                }
                if(newmap(caller, p, (struct mem_map *) m_ptr->SVMCTL_VALUE) != OK)
-                       minix_panic("do_vmctl: newmap failed", NO_NUM);
+                       panic("do_vmctl: newmap failed");
                FIXLINMSG(p);
                vmassert(p->p_delivermsg_lin);
                return OK;
index 3c46a2d7105cd3607d7a18a4f29b3faabfb1fcc3..5a1cf4fc87f8606075d47f3962231c67eec77923 100644 (file)
@@ -1,42 +1,35 @@
 /* This file contains a collection of miscellaneous procedures:
- *   minix_panic:    abort MINIX due to a fatal error
+ *   panic:    abort MINIX due to a fatal error
  *   kputc:          buffered putc used by kernel printf
  */
 
 #include "kernel.h"
 #include "proc.h"
 
+#include <minix/syslib.h>
 #include <unistd.h>
+#include <stdarg.h>
 #include <signal.h>
 
 #include <minix/sys_config.h>
 
-/*===========================================================================*
- *                     panic                                        *
- *===========================================================================*/
-PUBLIC void panic(char *what, char *mess,int nr)
-{
-/* This function is for when a library call wants to panic.
- * The library call calls printf() and tries to exit a process,
- * which isn't applicable in the kernel.
- */
-       minix_panic(mess, nr);
-}
+#define ARE_PANICING 0xDEADC0FF
 
 /*===========================================================================*
- *                     minix_panic                                        *
+ *                     panic                                          *
  *===========================================================================*/
-PUBLIC void minix_panic(char *mess,int nr)
+PUBLIC void panic(const char *fmt, ...)
 {
-/* The system has run aground of a fatal kernel error. Terminate execution. */
-if (minix_panicing++) {
+  va_list arg;
+  /* The system has run aground of a fatal kernel error. Terminate execution. */
+  if (minix_panicing == ARE_PANICING) {
        arch_monitor();
-}
-
-  if (mess != NULL) {
-       printf("kernel panic: %s", mess);
-       if(nr != NO_NUM)
-               printf(" %d", nr);
+  }
+  minix_panicing = ARE_PANICING;
+  if (fmt != NULL) {
+       printf("kernel panic: ");
+       va_start(arg, fmt);
+       vprintf(fmt, arg);
        printf("\n");
   }
 
index 3198f4d54d36a5382b7955c15f6e99b82efee38d..afd80727b1827c2a2ae9417c74433038447e8d24 100644 (file)
@@ -103,7 +103,6 @@ SRCS=  \
        env_prefix.c \
        fkey_ctl.c \
        tsc_util.c \
-       report.c \
        read_tsc.S \
        read_tsc_64.c \
        ser_putc.c \
@@ -111,6 +110,7 @@ SRCS=  \
        sys_hz.c \
        timing.c \
        profile_extern.c \
-       profile.c
+       profile.c \
+       vprintf.c
 
 .include <minix.lib.mk>
index 217d1a7939d111a0eb963e486ac1a12a2aa89ae6..d3c01234e9041af2a37a4ec2a5ec7f751b0c6c66 100644 (file)
@@ -68,7 +68,7 @@ void *alloc_contig(size_t len, int flags, phys_bytes *phys)
 
        /* Get physical address, if requested. */
         if(phys != NULL && sys_umap_data_fb(SELF, buf, len, phys) != OK)
-               panic("alloc_contig.c", "sys_umap_data_fb failed", NO_NUM);
+               panic("sys_umap_data_fb failed");
 
        return (void *) buf;
 }
index 22f312532104e7d60e5143e9cc6fe984e2085ba7..fa2da1fd915f4ec8367e813c66b4e035f1629726 100644 (file)
@@ -9,6 +9,5 @@
 #include       <minix/sysutil.h>
 
 void __bad_assertion(const char *mess) {
-       printf("%s", mess);
-       panic(NULL, NULL, NO_NUM);
+       panic("%s", mess);
 }
index 86def12ab6bdf90bf21f35a92f368c2ecc08d043..7c942edb0b6c9114cb2da6667b2b917c260240dc 100644 (file)
@@ -79,7 +79,7 @@ int fl;
                /* Tell the kernel to stop processing */
                r= senda(NULL, 0);
                if (r != OK)
-                       panic(__FILE__, "asynsend: senda failed", r);
+                       panic("asynsend: senda failed: %d", r);
 
                dst_ind= 0;
                for (src_ind= first_slot; src_ind<next_slot; src_ind++)
@@ -112,7 +112,7 @@ int fl;
                first_slot= 0;
                next_slot= dst_ind;
                if (next_slot >= ASYN_NR)
-                       panic(__FILE__, "asynsend: msgtable full", NO_NUM);
+                       panic("asynsend: msgtable full");
        }
 
        fl |= AMF_VALID;
index 9d724feec47f7004ceac0d7b28161043105baf3f..d487cc5d069599e470de16d3c36497ea1525a8dc 100644 (file)
@@ -14,6 +14,6 @@ char *key;            /* environment variable whose value is bogus */
        printf("WARNING: env_get_param() failed in env_panic(): %d\n", s);
   }
   printf("Bad environment setting: '%s = %s'\n", key, value);
-  panic("","", NO_NUM);
+  panic("");
 }
 
index 5d8e2196cdf4be0b41e8649682982c296b57d8b9..6453349e7765d0d6850993ee036b5f757aaa7b68 100644 (file)
  */
 #define nil 0
 #include <stdarg.h>
+#include <stdio.h>
 #include <stddef.h>
 #include <limits.h>
 
-#define isdigit(c)     ((unsigned) ((c) - '0') <  (unsigned) 10)
-
-#if !__STDC__
-/* Classic C stuff, ignore. */
-void kputc();
-int printf(fmt) char *fmt;
-#else
-
-/* Printf() uses kputc() to print characters. */
-void kputc(int c);
-
-#define count_kputc(c) do { charcount++; kputc(c); } while(0)
-
 int printf(const char *fmt, ...)
-#endif
 {
-       int c, charcount = 0;
-       enum { LEFT, RIGHT } adjust;
-       enum { LONG, INT } intsize;
-       int fill;
-       int width, max, len, base;
-       static char X2C_tab[]= "0123456789ABCDEF";
-       static char x2c_tab[]= "0123456789abcdef";
-       char *x2c;
-       char *p;
-       long i;
-       unsigned long u;
-       char temp[8 * sizeof(long) / 3 + 2];
-
-       va_list argp;
-
-       va_start(argp, fmt);
-
-       while ((c= *fmt++) != 0) {
-               if (c != '%') {
-                       /* Ordinary character. */
-                       count_kputc(c);
-                       continue;
-               }
-
-               /* Format specifier of the form:
-                *      %[adjust][fill][width][.max]keys
-                */
-               c= *fmt++;
-
-               adjust= RIGHT;
-               if (c == '-') {
-                       adjust= LEFT;
-                       c= *fmt++;
-               }
-
-               fill= ' ';
-               if (c == '0') {
-                       fill= '0';
-                       c= *fmt++;
-               }
-
-               width= 0;
-               if (c == '*') {
-                       /* Width is specified as an argument, e.g. %*d. */
-                       width= va_arg(argp, int);
-                       c= *fmt++;
-               } else
-               if (isdigit(c)) {
-                       /* A number tells the width, e.g. %10d. */
-                       do {
-                               width= width * 10 + (c - '0');
-                       } while (isdigit(c= *fmt++));
-               }
-
-               max= INT_MAX;
-               if (c == '.') {
-                       /* Max field length coming up. */
-                       if ((c= *fmt++) == '*') {
-                               max= va_arg(argp, int);
-                               c= *fmt++;
-                       } else
-                       if (isdigit(c)) {
-                               max= 0;
-                               do {
-                                       max= max * 10 + (c - '0');
-                               } while (isdigit(c= *fmt++));
-                       }
-               }
+       int n;
+       va_list ap;
 
-               /* Set a few flags to the default. */
-               x2c= x2c_tab;
-               i= 0;
-               base= 10;
-               intsize= INT;
-               if (c == 'l' || c == 'L') {
-                       /* "Long" key, e.g. %ld. */
-                       intsize= LONG;
-                       c= *fmt++;
-               }
-               if (c == 0) break;
+       va_start(ap, fmt);
+       n = vprintf(fmt, ap);
+       va_end(ap);
 
-               switch (c) {
-                       /* Decimal. */
-               case 'd':
-                       i= intsize == LONG ? va_arg(argp, long)
-                                               : va_arg(argp, int);
-                       u= i < 0 ? -i : i;
-                       goto int2ascii;
-
-                       /* Octal. */
-               case 'o':
-                       base= 010;
-                       goto getint;
-
-                       /* Pointer, interpret as %X or %lX. */
-               case 'p':
-                       if (sizeof(char *) > sizeof(int)) intsize= LONG;
-
-                       /* Hexadecimal.  %X prints upper case A-F, not %lx. */
-               case 'X':
-                       x2c= X2C_tab;
-               case 'x':
-                       base= 0x10;
-                       goto getint;
-
-                       /* Unsigned decimal. */
-               case 'u':
-               getint:
-                       u= intsize == LONG ? va_arg(argp, unsigned long)
-                                               : va_arg(argp, unsigned int);
-               int2ascii:
-                       p= temp + sizeof(temp)-1;
-                       *p= 0;
-                       do {
-                               *--p= x2c[(ptrdiff_t) (u % base)];
-                       } while ((u /= base) > 0);
-                       goto string_length;
-
-                       /* A character. */
-               case 'c':
-                       p= temp;
-                       *p= va_arg(argp, int);
-                       len= 1;
-                       goto string_print;
-
-                       /* Simply a percent. */
-               case '%':
-                       p= temp;
-                       *p= '%';
-                       len= 1;
-                       goto string_print;
-
-                       /* A string.  The other cases will join in here. */
-               case 's':
-                       p= va_arg(argp, char *);
-
-               string_length:
-                       for (len= 0; p[len] != 0 && len < max; len++) {}
-
-               string_print:
-                       width -= len;
-                       if (i < 0) width--;
-                       if (fill == '0' && i < 0) count_kputc('-');
-                       if (adjust == RIGHT) {
-                               while (width > 0) { count_kputc(fill); width--; }
-                       }
-                       if (fill == ' ' && i < 0) count_kputc('-');
-                       while (len > 0) { count_kputc((unsigned char) *p++); len--; }
-                       while (width > 0) { count_kputc(fill); width--; }
-                       break;
-
-                       /* Unrecognized format key, echo it back. */
-               default:
-                       count_kputc('%');
-                       count_kputc(c);
-               }
-       }
-
-       /* Mark the end with a null (should be something else, like -1). */
-       kputc(0);
-       va_end(argp);
-       return charcount;
+       return n;
 }
 
-/*
- * $PchId: kprintf.c,v 1.5 1996/04/11 06:59:05 philip Exp $
- */
index 0128c9e04f3fdc036fbfe1e8bd72d0e904ed3186..0abab10db2f6c21c1f1be1df4f82fe68c76780f1 100644 (file)
@@ -1,19 +1,15 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <unistd.h>
+#include <stdarg.h>
 #include <minix/sysutil.h>
 
 #include "syslib.h"
 
-int panicing= 0;
-
 /*===========================================================================*
- *                             panic                                        *
+ *                             panic                                *
  *===========================================================================*/
-PUBLIC void panic(who, mess, num)
-char *who;                     /* server identification */
-char *mess;                    /* message format string */
-int num;                       /* number to go with format string */
+PUBLIC void panic(const char *fmt, ...)
 {
 /* Something awful has happened. Panics are caused when an internal
  * inconsistency is detected, e.g., a programming error or illegal 
@@ -23,24 +19,29 @@ int num;                    /* number to go with format string */
   endpoint_t me = NONE;
   char name[20];
   void (*suicide)(void);
+  static int panicing= 0;
+  va_list args;
+
   if(panicing) return;
   panicing= 1;
 
   if(sys_whoami(&me, name, sizeof(name)) == OK && me != NONE)
-       printf("%s(%d): ", name, me);
+       printf("%s(%d): panic: ", name, me);
   else
-       printf("(sys_whoami failed): ");
+       printf("(sys_whoami failed): panic: ");
+
+  if(fmt) {
+       va_start(args, fmt);
+       vprintf(fmt, args);
+       va_end(fmt);
+  } else {
+       printf("no message\n");
+  }
+  printf("\n");
+
   printf("syslib:panic.c: stacktrace: ");
   util_stacktrace();
 
-  if (NULL != who && NULL != mess) {
-      if (num != NO_NUM) {
-          printf("Panic in %s: %s: %d\n", who, mess, num); 
-      } else {
-          printf("Panic in %s: %s\n", who, mess); 
-      }
-  }
-
   /* Try exit */
   _exit(1);
 
index 03de6151a75d89931dd0c7d92d71aa820c6570e7..e040c6bfe6e09e232af394e05165960eee726bd3 100644 (file)
@@ -22,10 +22,10 @@ int port;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_attr_r16: can't talk to PCI", r);
+               panic("pci_attr_r16: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_attr_r16: got bad reply from PCI", m.m_type);
+               panic("pci_attr_r16: got bad reply from PCI: %d", m.m_type);
 
        return m.m2_l1;
 }
index 0a3aefe493a062ee8aa6d4a83614ac3d4435c8c0..ef3b23af907b1bc1fd243be69ac0c129cd8d6c58 100644 (file)
@@ -22,10 +22,10 @@ int port;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_attr_r32: can't talk to PCI", r);
+               panic("pci_attr_r32: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_attr_r32: got bad reply from PCI", m.m_type);
+               panic("pci_attr_r32: got bad reply from PCI: %d", m.m_type);
 
        return m.m2_l1;
 }
index d08a6851ef39de31f2cb6737000362ea1558bba1..4ee072d1709766733a503df1d3fc30e831273d02 100644 (file)
@@ -22,10 +22,10 @@ int port;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_attr_r8: can't talk to PCI", r);
+               panic("pci_attr_r8: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_attr_r8: got bad reply from PCI", m.m_type);
+               panic("pci_attr_r8: got bad reply from PCI: %d", m.m_type);
 
        return m.m2_l1;
 }
index a201f5c003746cea127a4a7a9840c33a39c738d0..7fee1322ac05b275a3db0a24593f24b87be6fb94 100644 (file)
@@ -24,9 +24,9 @@ u16_t value;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_attr_w16: can't talk to PCI", r);
+               panic("pci_attr_w16: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_attr_w16: got bad reply from PCI", m.m_type);
+               panic("pci_attr_w16: got bad reply from PCI: %d", m.m_type);
 }
 
index 775570b68849b2047f392785dfa794ad141cc6e2..05bbefcf0465633fda237cf514f27c96c5b3e749 100644 (file)
@@ -24,9 +24,9 @@ u32_t value;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_attr_w32: can't talk to PCI", r);
+               panic("pci_attr_w32: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_attr_w32: got bad reply from PCI", m.m_type);
+               panic("pci_attr_w32: got bad reply from PCI: %d", m.m_type);
 }
 
index f4fa9eb2fcfc5e56d54b57816fa70664afe31a77..65ec7e9c9be441d03e6dd7638d8f5c835b56a41f 100644 (file)
@@ -24,9 +24,9 @@ u8_t value;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_attr_w8: can't talk to PCI", r);
+               panic("pci_attr_w8: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_attr_w8: got bad reply from PCI", m.m_type);
+               panic("pci_attr_w8: got bad reply from PCI: %d", m.m_type);
 }
 
index 9fc5db49450c4f917ff299762b508baf88b0f747..6b4184f156f793fcdbac106ed4b1b2a935ab1efa 100644 (file)
@@ -24,9 +24,7 @@ endpoint_t proc_ep;
                r= ds_retrieve_label_num("pci", &u32);
                if (r != 0)
                {
-                       panic("syslib/" __FILE__,
-                               "pci_del_acl: _pm_findproc failed for 'pci'",
-                               r);
+                       panic("pci_del_acl: _pm_findproc failed for 'pci': %d", r);
                }
                pci_procnr = u32;
        }
@@ -37,7 +35,7 @@ endpoint_t proc_ep;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_del_acl: can't talk to PCI", r);
+               panic("pci_del_acl: can't talk to PCI: %d", r);
 
        return m.m_type;
 }
index 3469205ebbb3a9a7411d9ba1424b1b3d6bdb81ad..88ac26f40fb8aca93fde29c4263e443bb36c7c43 100644 (file)
@@ -37,7 +37,7 @@ u16_t did;
        r= sendrec(pci_procnr, &m);
        cpf_revoke(gid);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_dev_name: can't talk to PCI", r);
+               panic("pci_dev_name: can't talk to PCI: %d", r);
 
        if (m.m_type == ENOENT)
        {
@@ -47,7 +47,7 @@ u16_t did;
                return NULL;    /* No name for this device */
        }
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_dev_name: got bad reply from PCI", m.m_type);
+               panic("pci_dev_name: got bad reply from PCI: %d", m.m_type);
 
        name[sizeof(name)-1]= '\0';     /* Make sure that the string is NUL
                                         * terminated.
index db60548cb468fecefcf8786334eeeb5911b4d662..1761dbe0ec993afc84b1a5c4685440b16cce0053 100644 (file)
@@ -25,7 +25,7 @@ int *devindp;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_find_dev: can't talk to PCI", r);
+               panic("pci_find_dev: can't talk to PCI: %d", r);
 
        if (m.m_type == 1)
        {
@@ -35,7 +35,7 @@ int *devindp;
                return 1;
        }
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_find_dev: got bad reply from PCI", m.m_type);
+               panic("pci_find_dev: got bad reply from PCI: %d", m.m_type);
 
        printf("pci_find_dev: got nothing\n");
        return 0;
index 55d51f6b08a07b02a6bd8ffcaed1f428aebe27f7..9937c278a3073e7f945bc3dbd9164f77c1886faa 100644 (file)
@@ -20,7 +20,7 @@ u16_t *didp;
        m.m_type= BUSC_PCI_FIRST_DEV;
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_first_dev: can't talk to PCI", r);
+               panic("pci_first_dev: can't talk to PCI: %d", r);
        if (m.m_type == 1)
        {
                *devindp= m.m1_i1;
@@ -33,7 +33,7 @@ u16_t *didp;
                return 1;
        }
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_first_dev: got bad reply from PCI", m.m_type);
+               panic("pci_first_dev: got bad reply from PCI: %d", m.m_type);
 
 #if DEBUG
        printf("pci_first_dev: got nothing\n");
index 38c30a485a18cd81e939febfccf585d5040448f2..910db54afc60cbf5ec52e5a66501131e1085c414 100644 (file)
@@ -22,10 +22,10 @@ u16_t *didp;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_ids: can't talk to PCI", r);
+               panic("pci_ids: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_ids: got bad reply from PCI", m.m_type);
+               panic("pci_ids: got bad reply from PCI: %d", m.m_type);
        *vidp= m.m1_i1;
        *didp= m.m1_i2;
        printf("pci_ids: %04x/%04x\n", *vidp, *didp);
index 758d88b0ddbe2a7f3cd5c481ca482316eb6690c9..be929d9b85c307fd55653ae911cd5bb14dd167c0 100644 (file)
@@ -24,7 +24,7 @@ char *name;
 
        r= ds_retrieve_label_num("pci", &u32);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_init1: ds_retrieve_label_num failed for 'pci'", r);
+               panic("pci_init1: ds_retrieve_label_num failed for 'pci': %d", r);
        pci_procnr= u32;
 
        m.m_type= BUSC_PCI_INIT;
@@ -39,8 +39,8 @@ char *name;
        }
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_init1: can't talk to PCI", r);
+               panic("pci_init1: can't talk to PCI: %d", r);
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_init1: got bad reply from PCI", m.m_type);
+               panic("pci_init1: got bad reply from PCI: %d", m.m_type);
 }
 
index 5471868815591d695fd94b30a0b5f3bbca849836..5bd989510c16b79ca991eb11622a2cf1267e073b 100644 (file)
@@ -22,7 +22,7 @@ u16_t *didp;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_next_dev: can't talk to PCI", r);
+               panic("pci_next_dev: can't talk to PCI: %d", r);
 
        if (m.m_type == 1)
        {
@@ -36,7 +36,7 @@ u16_t *didp;
                return 1;
        }
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_next_dev: got bad reply from PCI", m.m_type);
+               panic("pci_next_dev: got bad reply from PCI: %d", m.m_type);
 
        return 0;
 }
index ef0aed1ef902ba30811dd8e1b73560ee52a5aa55..a60a238d2137f8feadfa53a10a59946c0a7d1d6d 100644 (file)
@@ -20,12 +20,11 @@ u8_t busnr;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_rescan_bus: can't talk to PCI", r);
+               panic("pci_rescan_bus: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
        {
-               panic("syslib/" __FILE__, "pci_rescan_bus: got bad reply from PCI",
-                       m.m_type);
+               panic("pci_rescan_bus: got bad reply from PCI: %d", m.m_type);
        }
 }
 
index b00d6d8269378e99892cc0f88f11cb1dbd0618b8..60e5702974cd3a07b749eff8a632b251bd9457dc 100644 (file)
@@ -20,10 +20,10 @@ int devind;
 
        r= sendrec(pci_procnr, &m);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_reserve: can't talk to PCI", r);
+               panic("pci_reserve: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_reserve: got bad reply from PCI", m.m_type);
+               panic("pci_reserve: got bad reply from PCI: %d", m.m_type);
 }
 
 /*===========================================================================*
index 12cafbca075c23f695fbd1ab59797bda1bc4588c..d81e4e4a6a34553b6505060ef26d121c1d9dc583 100644 (file)
@@ -25,9 +25,7 @@ struct rs_pci *rs_pci;
                r= ds_retrieve_label_num("pci", &u32);
                if (r != 0)
                {
-                       panic("syslib/" __FILE__,
-                               "pci_set_acl: ds_retrieve_label_num failed for 'pci'",
-                               r);
+                       panic("pci_set_acl: ds_retrieve_label_num failed for 'pci': %d", r);
                }
                pci_procnr = u32;
        }
@@ -48,7 +46,7 @@ struct rs_pci *rs_pci;
        r= sendrec(pci_procnr, &m);
        cpf_revoke(gid);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_set_acl: can't talk to PCI", r);
+               panic("pci_set_acl: can't talk to PCI: %d", r);
 
        return m.m_type;
 }
index ad2d84092297dea771654e32e5e4ce71ec7313f3..e9ff0f8a259310659795e30864743613a85f9dc6 100644 (file)
@@ -35,10 +35,10 @@ int devind;
        r= sendrec(pci_procnr, &m);
        cpf_revoke(gid);
        if (r != 0)
-               panic("syslib/" __FILE__, "pci_slot_name: can't talk to PCI", r);
+               panic("pci_slot_name: can't talk to PCI: %d", r);
 
        if (m.m_type != 0)
-               panic("syslib/" __FILE__, "pci_slot_name: got bad reply from PCI", m.m_type);
+               panic("pci_slot_name: got bad reply from PCI: %d", m.m_type);
 
        name[sizeof(name)-1]= '\0';     /* Make sure that the string is NUL
                                         * terminated.
diff --git a/lib/libsys/report.c b/lib/libsys/report.c
deleted file mode 100644 (file)
index e4f9d5e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "sysutil.h" 
-
-/*===========================================================================*
- *                                 report                                           *
- *===========================================================================*/
-PUBLIC void report(who, mess, num)
-char *who;                             /* server identification */
-char *mess;                            /* message format to print */
-int num;                               /* number to go with the message */
-{
-/* Display a message for a server. */ 
-
-  if (num != NO_NUM) {
-      printf("%s: %s %d\n", who, mess, num);
-  } else {
-      printf("%s: %s\n", who, mess);
-  }
-}
-
-
index a2536d8d740f434b7de7a7b43eaab6eda4e13b0d..65303c9784290058d2a9f3a371fb314dcacc6c45 100644 (file)
@@ -48,22 +48,22 @@ PUBLIC void sef_startup()
   /* Intercept SEF Init requests. */
   if(sef_self_endpoint == RS_PROC_NR) {
       if((r = do_sef_rs_init()) != OK) {
-          panic("SEF", "unable to complete init", r);
+          panic("unable to complete init: %d", r);
       }
   }
   else {
       message m;
 
       if((r = receive(RS_PROC_NR, &m)) != OK) {
-          panic("SEF", "unable to receive from RS", r);
+          panic("unable to receive from RS: %d", r);
       }
       if(IS_SEF_INIT_REQUEST(&m)) {
           if((r = do_sef_init_request(&m)) != OK) {
-              panic("SEF", "unable to process init request", r);
+              panic("unable to process init request: %d", r);
           }
       }
       else {
-          panic("SEF", "unable to receive init request", NO_NUM);
+          panic("unable to receive init request");
       }
   }
 #endif
index 862f113ce4a3edad7fc014ae969488e8c059a7b6..8da36e59024d83bef092ffcd9bde2f9686c817f0 100644 (file)
@@ -122,7 +122,7 @@ PUBLIC void sef_lu_ready(int result)
       m.RS_LU_RESULT = result;
       r = sendrec(RS_PROC_NR, &m);
       if ( r != OK) {
-          panic("SEF", "sendrec failed", r);
+          panic("sendrec failed: %d", r);
       }
   }
 
index 4842dc08769e956848cfce5c498558ef4742a6ae..4cf7b27a60773b12c190c80172e1fc443d46b0e3 100644 (file)
@@ -22,7 +22,7 @@ void util_timer_start(util_timingdata_t *timingdata, char *name)
        }
 
        if (timingdata->starttimes[HIGHCOUNT]) {
-               panic(__FILE__, "restart timer?", NO_NUM);
+               panic("restart timer?");
                return;
        }
 
@@ -37,7 +37,7 @@ void util_timer_end(util_timingdata_t *timingdata)
 
        read_tsc(&h, &l);
        if (!timingdata->starttimes[HIGHCOUNT]) {
-               panic(__FILE__, "timer stopped but not started", NO_NUM);
+               panic("timer stopped but not started");
                return;
        }
        if (timingdata->starttimes[HIGHCOUNT] == h) {
@@ -73,7 +73,7 @@ void util_timer_end(util_timingdata_t *timingdata)
                timingdata->binsize;
        if (bin < 0 || bin >= TIMING_POINTS) {
                /* not serious, but can't happen, so shouldn't */
-               panic(__FILE__, "bin out of range", bin);
+               panic("bin out of range: %d", bin);
        } else {
                timingdata->lock_timings[bin]++;
                timingdata->measurements++;
index 6a5060f07bc277523516630c19550adff1339909..dfb1218e065e2ce2faf23133210629e2618395d4 100644 (file)
@@ -17,7 +17,7 @@
        if(!calibrated) {                                       \
                int r;                                          \
                if((r=tsc_calibrate()) != OK)                   \
-                       panic(__FILE__, "calibrate failed\n", r); \
+                       panic("calibrate failed: %d", r); \
        }
 
 static u32_t calib_tsc, Hz = 0;
@@ -48,9 +48,7 @@ tsc_calibrate(void)
 
        diff = sub64(end, start);
        if(ex64hi(diff) != 0)
-         panic(__FILE__,
-               "tsc_calibrate: CALIBRATE_TICKS too high "
-                       "for TSC frequency\n", NO_NUM);
+         panic("tsc_calibrate: CALIBRATE_TICKS too high for TSC frequency");
        calib_tsc = ex64lo(diff);
 #if 0
        printf("tsc_calibrate: "
diff --git a/lib/libsys/vprintf.c b/lib/libsys/vprintf.c
new file mode 100644 (file)
index 0000000..4a97efe
--- /dev/null
@@ -0,0 +1,175 @@
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <limits.h>
+
+/* vprintf() uses kputc() to print characters. */
+void kputc(int c);
+
+#define count_kputc(c) do { charcount++; kputc(c); } while(0)
+
+int vprintf(const char *fmt, va_list argp)
+{
+       int c, charcount = 0;
+       enum { LEFT, RIGHT } adjust;
+       enum { LONG, INT } intsize;
+       int fill;
+       int width, max, len, base;
+       static char X2C_tab[]= "0123456789ABCDEF";
+       static char x2c_tab[]= "0123456789abcdef";
+       char *x2c;
+       char *p;
+       long i;
+       unsigned long u;
+       char temp[8 * sizeof(long) / 3 + 2];
+
+       while ((c= *fmt++) != 0) {
+               if (c != '%') {
+                       /* Ordinary character. */
+                       count_kputc(c);
+                       continue;
+               }
+
+               /* Format specifier of the form:
+                *      %[adjust][fill][width][.max]keys
+                */
+               c= *fmt++;
+
+               adjust= RIGHT;
+               if (c == '-') {
+                       adjust= LEFT;
+                       c= *fmt++;
+               }
+
+               fill= ' ';
+               if (c == '0') {
+                       fill= '0';
+                       c= *fmt++;
+               }
+
+               width= 0;
+               if (c == '*') {
+                       /* Width is specified as an argument, e.g. %*d. */
+                       width= va_arg(argp, int);
+                       c= *fmt++;
+               } else
+               if (isdigit(c)) {
+                       /* A number tells the width, e.g. %10d. */
+                       do {
+                               width= width * 10 + (c - '0');
+                       } while (isdigit(c= *fmt++));
+               }
+
+               max= INT_MAX;
+               if (c == '.') {
+                       /* Max field length coming up. */
+                       if ((c= *fmt++) == '*') {
+                               max= va_arg(argp, int);
+                               c= *fmt++;
+                       } else
+                       if (isdigit(c)) {
+                               max= 0;
+                               do {
+                                       max= max * 10 + (c - '0');
+                               } while (isdigit(c= *fmt++));
+                       }
+               }
+
+               /* Set a few flags to the default. */
+               x2c= x2c_tab;
+               i= 0;
+               base= 10;
+               intsize= INT;
+               if (c == 'l' || c == 'L') {
+                       /* "Long" key, e.g. %ld. */
+                       intsize= LONG;
+                       c= *fmt++;
+               }
+               if (c == 0) break;
+
+               switch (c) {
+                       /* Decimal. */
+               case 'd':
+                       i= intsize == LONG ? va_arg(argp, long)
+                                               : va_arg(argp, int);
+                       u= i < 0 ? -i : i;
+                       goto int2ascii;
+
+                       /* Octal. */
+               case 'o':
+                       base= 010;
+                       goto getint;
+
+                       /* Pointer, interpret as %X or %lX. */
+               case 'p':
+                       if (sizeof(char *) > sizeof(int)) intsize= LONG;
+
+                       /* Hexadecimal.  %X prints upper case A-F, not %lx. */
+               case 'X':
+                       x2c= X2C_tab;
+               case 'x':
+                       base= 0x10;
+                       goto getint;
+
+                       /* Unsigned decimal. */
+               case 'u':
+               getint:
+                       u= intsize == LONG ? va_arg(argp, unsigned long)
+                                               : va_arg(argp, unsigned int);
+               int2ascii:
+                       p= temp + sizeof(temp)-1;
+                       *p= 0;
+                       do {
+                               *--p= x2c[(ptrdiff_t) (u % base)];
+                       } while ((u /= base) > 0);
+                       goto string_length;
+
+                       /* A character. */
+               case 'c':
+                       p= temp;
+                       *p= va_arg(argp, int);
+                       len= 1;
+                       goto string_print;
+
+                       /* Simply a percent. */
+               case '%':
+                       p= temp;
+                       *p= '%';
+                       len= 1;
+                       goto string_print;
+
+                       /* A string.  The other cases will join in here. */
+               case 's':
+                       p= va_arg(argp, char *);
+
+               string_length:
+                       for (len= 0; p[len] != 0 && len < max; len++) {}
+
+               string_print:
+                       width -= len;
+                       if (i < 0) width--;
+                       if (fill == '0' && i < 0) count_kputc('-');
+                       if (adjust == RIGHT) {
+                               while (width > 0) { count_kputc(fill); width--; }
+                       }
+                       if (fill == ' ' && i < 0) count_kputc('-');
+                       while (len > 0) { count_kputc((unsigned char) *p++); len--; }
+                       while (width > 0) { count_kputc(fill); width--; }
+                       break;
+
+                       /* Unrecognized format key, echo it back. */
+               default:
+                       count_kputc('%');
+                       count_kputc(c);
+               }
+       }
+
+       /* Mark the end with a null (should be something else, like -1). */
+       kputc(0);
+       return charcount;
+}
+
+/*
+ * $PchId: kprintf.c,v 1.5 1996/04/11 06:59:05 philip Exp $
+ */
index d1195ad5d3ac4773d7c83c36bb8e0d4ed309602b..64f7c521b449c616f618adb56464906976193cf0 100644 (file)
@@ -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 */
 }
index 17e893d5c2a504db8721c3da33e08230156b3226..2adf376fe5bd87b2c636b88104b49181f0cd620f 100644 (file)
@@ -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);
                        }
                }
        }
index 5f545da7e22131914901796f13b73cf3fc70c04b..0aa688a87cdeb77e3171fd798dbdaa8c737b2702 100644 (file)
@@ -120,7 +120,7 @@ struct inode *ino;
   ino->i_ref++;
 
   if (ino->i_ref == 0)
-       panic("HGFS", "inode reference count wrapped", NO_NUM);
+       panic("inode reference count wrapped");
 }
 
 /*===========================================================================*
index 9f0924a641f096441fc61e6fed05d8eab5ff103d..89e1e3c64dcb0ffd76162f74510ba6d21cf9165d 100644 (file)
@@ -176,7 +176,7 @@ endpoint_t *who_e;
   int r;
 
   if ((r = sef_receive(ANY, &m_in)) != OK)
-       panic("HGFS", "receive failed", r);
+       panic("receive failed: %d", r);
 
   *who_e = m_in.m_source;
 
index 0e43e7f514d26081eab275a163ff6d8bcbf8130b..4ee2cec230c02ab2381d3c21cbdebe3224476c9e 100644 (file)
@@ -329,7 +329,7 @@ PUBLIC void inet_panic()
 {
        printf("\ninet stacktrace: ");
        util_stacktrace();
-       (panic)("INET","aborted due to a panic",NO_NUM);
+       (panic)("aborted due to a panic");
        for(;;);
 }
 
index f5d9c782be40ab72573ba51babf7b6ed755a60f3..dfe123d3b6b8c4067acb0c011ab0160a52e3f265 100644 (file)
@@ -63,7 +63,7 @@ int map;
   else s = fkey_unmap(&fkeys, &sfkeys);
 
   if (s != OK)
-       report("IS", "warning, fkey_ctl failed:", s);
+       printf("IS: warning, fkey_ctl failed: %d\n", s);
 }
 
 /*===========================================================================*
@@ -82,7 +82,7 @@ message *m;                                   /* notification message */
   m->m_type = FKEY_CONTROL;
   m->FKEY_REQUEST = FKEY_EVENTS;
   if (OK != (s=sendrec(TTY_PROC_NR, m)))
-      report("IS", "warning, sendrec to TTY failed", s);
+      printf("IS: warning, sendrec to TTY failed: %d\n", s);
 
   /* Now check which keys were pressed: F1-F12, SF1-SF12. */
   for(h=0; h < NHOOKS; h++)
index 8c0ea2b53d3e0462aa72f79c41cbbb458f03f9f1..cf1fae81edd844d2e36f43138fd0a07cd6eb83c4 100644 (file)
@@ -65,7 +65,7 @@ PUBLIC void timing_dmp()
   static int offsetlines = 0;
 
   if ((r = sys_getlocktimings(&timingdata[0])) != OK) {
-      report("IS","warning: couldn't get copy of lock timings", r);
+      printf("IS: warning: couldn't get copy of lock timings: %d\n", r);
       return;
   } 
 
@@ -103,7 +103,7 @@ PUBLIC void kmessages_dmp()
 
   /* Try to get a copy of the kernel messages. */
   if ((r = sys_getkmessages(&kmess)) != OK) {
-      report("IS","warning: couldn't get copy of kmessages", r);
+      printf("IS: warning: couldn't get copy of kmessages: %d\n", r);
       return;
   }
 
@@ -134,7 +134,7 @@ PUBLIC void monparams_dmp()
 
   /* Try to get a copy of the boot monitor parameters. */
   if ((r = sys_getmonparams(val, sizeof(val))) != OK) {
-      report("IS","warning: couldn't get copy of monitor params", r);
+      printf("IS: warning: couldn't get copy of monitor params: %d\n", r);
       return;
   }
 
@@ -161,11 +161,11 @@ PUBLIC void irqtab_dmp()
   struct irq_hook *e;  /* irq tab entry */
 
   if ((r = sys_getirqhooks(irq_hooks)) != OK) {
-      report("IS","warning: couldn't get copy of irq hooks", r);
+      printf("IS: warning: couldn't get copy of irq hooks: %d\n", r);
       return;
   }
   if ((r = sys_getirqactids(irq_actids)) != OK) {
-      report("IS","warning: couldn't get copy of irq mask", r);
+      printf("IS: warning: couldn't get copy of irq mask: %d\n", r);
       return;
   }
 
@@ -217,7 +217,7 @@ PUBLIC void image_dmp()
   struct boot_image *ip;
        
   if ((r = sys_getimage(image)) != OK) {
-      report("IS","warning: couldn't get copy of image table", r);
+      printf("IS: warning: couldn't get copy of image table: %d\n", r);
       return;
   }
   printf("Image table dump showing all processes included in system image.\n");
@@ -241,11 +241,11 @@ PUBLIC void kenv_dmp()
     struct machine machine;
     int r;
     if ((r = sys_getkinfo(&kinfo)) != OK) {
-       report("IS","warning: couldn't get copy of kernel info struct", r);
+       printf("IS: warning: couldn't get copy of kernel info struct: %d\n", r);
        return;
     }
     if ((r = sys_getmachine(&machine)) != OK) {
-       report("IS","warning: couldn't get copy of kernel machine struct", r);
+       printf("IS: warning: couldn't get copy of kernel machine struct: %d\n", r);
        return;
     }
 
@@ -319,11 +319,11 @@ PUBLIC void privileges_dmp()
 
   /* First obtain a fresh copy of the current process and system table. */
   if ((r = sys_getprivtab(priv)) != OK) {
-      report("IS","warning: couldn't get copy of system privileges table", r);
+      printf("IS: warning: couldn't get copy of system privileges table: %d\n", r);
       return;
   }
   if ((r = sys_getproctab(proc)) != OK) {
-      report("IS","warning: couldn't get copy of process table", r);
+      printf("IS: warning: couldn't get copy of process table: %d\n", r);
       return;
   }
 
@@ -386,7 +386,7 @@ PUBLIC void proctab_dmp()
 
   /* First obtain a fresh copy of the current process table. */
   if ((r = sys_getproctab(proc)) != OK) {
-      report("IS","warning: couldn't get copy of process table", r);
+      printf("IS: warning: couldn't get copy of process table: %d\n", r);
       return;
   }
 
@@ -422,7 +422,7 @@ PUBLIC void procstack_dmp()
 
   /* First obtain a fresh copy of the current process table. */
   if ((r = sys_getproctab(proc)) != OK) {
-      report("IS","warning: couldn't get copy of process table", r);
+      printf("IS: warning: couldn't get copy of process table: %d\n", r);
       return;
   }
 
@@ -446,7 +446,7 @@ PUBLIC void memmap_dmp()
 
   /* First obtain a fresh copy of the current process table. */
   if ((r = sys_getproctab(proc)) != OK) {
-      report("IS","warning: couldn't get copy of process table", r);
+      printf("IS: warning: couldn't get copy of process table: %d\n", r);
       return;
   }
 
index 3201a1fdd8ebb9da872fb544a99b1ea9843a30ca..47c742ff3228f1350f35fe11533671c7c607aa47 100644 (file)
@@ -39,7 +39,7 @@ PUBLIC void vm_dmp()
 
   if (prev_i == -1) {
        if ((r = vm_info_stats(&vsi)) != OK) {
-               report("IS", "warning: couldn't talk to VM", r);
+               printf("IS: warning: couldn't talk to VM: %d\n", r);
                return;
        }
 
@@ -55,7 +55,7 @@ PUBLIC void vm_dmp()
   }
 
   if ((r = sys_getproctab(proc)) != OK) {
-       report("IS", "warning: couldn't get copy of process table", r);
+       printf("IS: warning: couldn't get copy of process table: %d\n", r);
        return;
   }
 
index 8e0d71b07b79c35d66944e5e61eb01d5308d508f..773798004e8ab6d096423195902f6f216c47bcdc 100644 (file)
@@ -115,7 +115,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
   sigact.sa_mask = ~0;                 /* block all other signals */
   sigact.sa_flags = 0;                 /* default behaviour */
   if (sigaction(SIGTERM, &sigact, NULL) < 0) 
-      report("IS","warning, sigaction() failed", errno);
+      printf("IS: warning, sigaction() failed: %d\n", errno);
 
   /* Set key mappings. */
   map_unmap_fkeys(TRUE /*map*/);
@@ -150,7 +150,7 @@ PRIVATE void get_work()
     int status = 0;
     status = sef_receive(ANY, &m_in);   /* this blocks until message arrives */
     if (OK != status)
-        panic("IS","sef_receive failed!", status);
+        panic("sef_receive failed!: %d", status);
     who_e = m_in.m_source;        /* message arrived! set sender */
     callnr = m_in.m_type;       /* set function call number */
 }
@@ -166,7 +166,7 @@ int result;                                 /* report result to replyee */
     m_out.m_type = result;             /* build reply message */
     send_status = send(who, &m_out);    /* send the message */
     if (OK != send_status)
-        panic("IS", "unable to send reply!", send_status);
+        panic("unable to send reply!: %d", send_status);
 }
 
 
index 1c867a8cc9249b741025732da85ed9dee4f6324f..623eda53090ea2dd920c212b953c705f35faab1a 100644 (file)
@@ -62,8 +62,7 @@ vir_bytes bytes;
                        if((*gid=cpf_grant_direct(driver, (vir_bytes) *buf, 
                                bytes, *op == DEV_READ_S ? CPF_WRITE : 
                                CPF_READ)) < 0) {
-                               panic(__FILE__,
-                                "cpf_grant_magic of buffer failed\n", NO_NUM);
+                                       panic("cpf_grant_magic of buffer failed");
                        }
 
                        break;
@@ -77,21 +76,19 @@ vir_bytes bytes;
                        if((*gid = cpf_grant_direct(driver,
                          (vir_bytes) new_iovec, bytes * sizeof(iovec_t),
                          CPF_READ | CPF_WRITE)) < 0) {
-                               panic(__FILE__,
-                               "cpf_grant_direct of vector failed", NO_NUM);
+                               panic("cpf_grant_direct of vector failed");
                        }
                        v = (iovec_t *) *buf;
                        /* Grant access to i/o buffers. */
                        for(j = 0; j < bytes; j++) {
                           if(j >= NR_IOREQS) 
-                               panic(__FILE__, "vec too big", bytes);
+                               panic("vec too big: %d", bytes);
                           new_iovec[j].iov_addr = gids[j] =
                             cpf_grant_direct(driver, (vir_bytes)
                             v[j].iov_addr, v[j].iov_size,
                             *op == DEV_GATHER_S ? CPF_WRITE : CPF_READ);
                           if(!GRANT_VALID(gids[j])) {
-                               panic(__FILE__, "mfs: grant to iovec buf failed",
-                                NO_NUM);
+                               panic("mfs: grant to iovec buf failed");
                           }
                           new_iovec[j].iov_size = v[j].iov_size;
                           (*vec_grants)++;
@@ -155,7 +152,7 @@ int flags;                  /* mode bits and flags */
   major = (dev >> MAJOR) & BYTE;
   if (major >= NR_DEVICES) major = 0;
   r = gen_opcl(driver_e, DEV_OPEN, dev, proc, flags);
-  if (r == SUSPEND) panic(__FILE__,"suspend on open from", NO_NUM);
+  if (r == SUSPEND) panic("suspend on open from");
   return(r);
 }
 
@@ -193,7 +190,7 @@ int flags;                  /* special flags, like O_NONBLOCK */
   /* The io vector copying relies on this I/O being for FS itself. */
   if(proc_e != SELF_E) {
       printf("ISOFS(%d) doing block_dev_io for non-self %d\n", SELF_E, proc_e);
-      panic(__FILE__, "doing block_dev_io for non-self", proc_e);
+      panic("doing block_dev_io for non-self: %d", proc_e);
   }
   
   /* By default, these are right. */
@@ -238,7 +235,7 @@ int flags;                  /* special flags, like O_NONBLOCK */
           return(r);
       }
       else 
-          panic(__FILE__,"call_task: can't send/receive", r);
+          panic("call_task: can't send/receive: %d", r);
   } else {
       /* Did the process we did the sendrec() for get a result? */
       if (m.REP_ENDPT != proc_e) {
@@ -249,7 +246,7 @@ int flags;                  /* special flags, like O_NONBLOCK */
 
   /* Task has completed.  See if call completed. */
   if (m.REP_STATUS == SUSPEND) {
-      panic(__FILE__, "ISOFS block_dev_io: driver returned SUSPEND", NO_NUM);
+      panic("ISOFS block_dev_io: driver returned SUSPEND");
   }
 
   if(buf != buf_used && r == OK) {
@@ -304,8 +301,7 @@ message *mess_ptr;          /* pointer to message for task */
        if (r != OK) {
                if (r == EDEADSRCDST) {
                        printf("fs: dead driver %d\n", task_nr);
-                       panic(__FILE__, "should handle crashed drivers",
-                               NO_NUM);
+                       panic("should handle crashed drivers");
                        /* dmap_unmap_by_endpt(task_nr); */
                        return r;
                }
@@ -313,7 +309,7 @@ message *mess_ptr;          /* pointer to message for task */
                        printf("fs: ELOCKED talking to %d\n", task_nr);
                        return r;
                }
-               panic(__FILE__,"call_task: can't send/receive", r);
+               panic("call_task: can't send/receive: %d", r);
        }
 
        /* Did the process we did the sendrec() for get a result? */
index a2e84f8b51dbb5ffa691bc273b7ecce1d31df937..c948445aaad73b854a6f5ba2c761b09b6c1dbebe 100644 (file)
@@ -95,7 +95,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
    fs_m_in.m_type = FS_READY;
 
    if ((r = send(FS_PROC_NR, &fs_m_in)) != OK) {
-       panic("ISOFS", "Error sending login to VFS", r);
+       panic("Error sending login to VFS: %d", r);
    }
 
    return(OK);
@@ -109,7 +109,7 @@ message *m_in;                              /* pointer to message */
 {
   int s;                                       /* receive status */
   if (OK != (s = sef_receive(ANY, m_in)))      /* wait for message */
-    panic("ISOFS","sef_receive failed", s);
+    panic("sef_receive failed: %d", s);
 }
 
 /*===========================================================================*
index 40cd7b2e4a82f10f933bdd11a3f027d9316b6d98..d5c339121f394fc4d5705ca968f959931d6f478c 100644 (file)
@@ -72,5 +72,4 @@ _PROTOTYPE(int create_v_pri, (struct iso9660_vd_pri *v_pri, char *buffer,
 
 /* utility.c */
 _PROTOTYPE(int no_sys, (void));
-_PROTOTYPE(void panic, (char *who, char *mess, int num));
 
index ed2158d8d51abe0317d4305c69040c7bc7fad7ac..789eade94a0e0952f5f9281f2a27b13c693820c1 100644 (file)
@@ -229,9 +229,7 @@ PUBLIC int fs_getdents(void) {
                                    (vir_bytes)getdents_buf, tmpbuf_offset, D);
 
                                if (r != OK)
-                                   panic(__FILE__,
-                                     "fs_getdents: sys_safecopyto failed\n",r);
-         
+                                       panic("fs_getdents: sys_safecopyto failed: %d", r);
                                userbuf_off += tmpbuf_offset;
                                tmpbuf_offset= 0;
                        }
@@ -264,7 +262,7 @@ PUBLIC int fs_getdents(void) {
        r = sys_safecopyto(FS_PROC_NR, gid, userbuf_off,
                           (vir_bytes) getdents_buf, tmpbuf_offset, D);
        if (r != OK)
-               panic(__FILE__, "fs_getdents: sys_safecopyto failed\n", r);
+               panic("fs_getdents: sys_safecopyto failed: %d", r);
  
        userbuf_off += tmpbuf_offset;
   }
@@ -324,7 +322,7 @@ int *completed;                     /* number of bytes copied */
 
   /* In all cases, bp now points to a valid buffer. */
   if (bp == NIL_BUF) {
-    panic(__FILE__,"bp not valid in rw_chunk, this can't happen", NO_NUM);
+    panic("bp not valid in rw_chunk; this can't happen");
   }
   
   r = sys_safecopyto(FS_PROC_NR, gid, buf_off,
index 85da41e9e985d69e664d28313ea305270456cb29..65f140081108135ffef2e4e04b0d64b1e0c2b04d 100644 (file)
@@ -5,8 +5,6 @@
 #include <minix/callnr.h>
 #include <minix/vfsif.h>
 
-static int panicking;
-
 /*===========================================================================*
  *                             no_sys                                       *
  *===========================================================================*/
@@ -16,22 +14,3 @@ PUBLIC int no_sys()
   return(EINVAL);
 }
 
-/*===========================================================================*
- *                             panic                                        *
- *===========================================================================*/
-PUBLIC void panic(who, mess, num)
-char *who;                     /* who caused the panic */
-char *mess;                    /* panic message string */
-int num;                       /* number to go with it */
-{
-/* Something awful has happened.  Panics are caused when an internal
- * inconsistency is detected, e.g., a programming error or illegal value of a
- * defined constant.
- */
-  if (panicking) return;       /* do not panic during a sync */
-  panicking = TRUE;            /* prevent another panic during the sync */
-
-  printf("FS panic (%s): %s ", who, mess);
-  if (num != NO_NUM) printf("%d",num);
-  exit(1);
-}
index 2b53c0e0234a6e267e9f4be2eb8c8c59cc76a2cf..3dbb4d0bfb951e899ee7c23ccff4a243d2020549 100644 (file)
@@ -79,7 +79,7 @@ int only_search;              /* if NO_READ, don't read, else act normal */
   }
 
   /* Desired block is not on available chain.  Take oldest block ('front'). */
-  if ((bp = front) == NIL_BUF) panic(__FILE__,"all buffers in use", NR_BUFS);
+  if ((bp = front) == NIL_BUF) panic("all buffers in use: %d", NR_BUFS);
 
   if(bp->b_bytes < fs_block_size) {
        ASSERT(!bp->bp);
@@ -90,7 +90,7 @@ int only_search;              /* if NO_READ, don't read, else act normal */
                        bp && bp->b_bytes < fs_block_size; bp = bp->b_next)
                        ;
                if(!bp) {
-                       panic("MFS", "no buffer available", NO_NUM);
+                       panic("no buffer available");
                }
        } else {
                bp->b_bytes = fs_block_size;
@@ -475,13 +475,11 @@ PUBLIC void set_blocksize(int blocksize)
 
         for (bp = &buf[0]; bp < &buf[NR_BUFS]; bp++)
                if(bp->b_count != 0)
-                       panic("MFS", "change blocksize with buffer in use",
-                               NO_NUM);
+                       panic("change blocksize with buffer in use");
 
        for (rip = &inode[0]; rip < &inode[NR_INODES]; rip++)
                if (rip->i_count > 0)
-                       panic("MFS", "change blocksize with inode in use",
-                               NO_NUM);
+                       panic("change blocksize with inode in use");
 
        fs_sync();
 
index 668e18639a8c699904e92cd5b50bdec7f4ca7cd6..4d547c0261bf0c5e92e2b82ab3ede6fcecb21cef 100644 (file)
@@ -76,7 +76,7 @@ vir_bytes bytes;
          
          if((*gid=cpf_grant_direct(driver, (vir_bytes) *buf, bytes,
                                    *op == DEV_READ_S?CPF_WRITE:CPF_READ))<0) {
-               panic(__FILE__,"cpf_grant_magic of buffer failed\n", NO_NUM);
+               panic("cpf_grant_magic of buffer failed");
          }
 
          break;
@@ -89,20 +89,19 @@ vir_bytes bytes;
          if((*gid = cpf_grant_direct(driver, (vir_bytes) new_iovec,
                                      bytes * sizeof(iovec_t),
                                      CPF_READ | CPF_WRITE)) < 0) {
-               panic(__FILE__, "cpf_grant_direct of vector failed", NO_NUM);
+               panic("cpf_grant_direct of vector failed");
          }
          v = (iovec_t *) *buf;
          /* Grant access to i/o buffers. */
          for(j = 0; j < bytes; j++) {
                if(j >= NR_IOREQS) 
-                       panic(__FILE__, "vec too big", bytes);
+                       panic("vec too big: %d", bytes);
                new_iovec[j].iov_addr = gids[j] =
                  cpf_grant_direct(driver, (vir_bytes) v[j].iov_addr,
                                   v[j].iov_size,
                                   *op == DEV_GATHER_S ? CPF_WRITE : CPF_READ);
                if(!GRANT_VALID(gids[j])) {
-                       panic(__FILE__, "mfs: grant to iovec buf failed",
-                             NO_NUM);
+                       panic("mfs: grant to iovec buf failed");
                }
                new_iovec[j].iov_size = v[j].iov_size;
                (*vec_grants)++;
@@ -184,7 +183,7 @@ int flags;                  /* special flags, like O_NONBLOCK */
   /* The io vector copying relies on this I/O being for FS itself. */
   if(proc_e != SELF_E) {
       printf("MFS(%d) doing block_dev_io for non-self %d\n", SELF_E, proc_e);
-      panic(__FILE__, "doing block_dev_io for non-self", proc_e);
+      panic("doing block_dev_io for non-self: %d", proc_e);
   }
   
   /* By default, these are right. */
@@ -231,7 +230,7 @@ int flags;                  /* special flags, like O_NONBLOCK */
           return r;
       }
       else 
-          panic(__FILE__,"call_task: can't send/receive", r);
+          panic("call_task: can't send/receive: %d", r);
   } 
   else {
       /* Did the process we did the sendrec() for get a result? */
@@ -243,7 +242,7 @@ int flags;                  /* special flags, like O_NONBLOCK */
 
   /* Task has completed.  See if call completed. */
   if (m.REP_STATUS == SUSPEND) {
-      panic(__FILE__, "MFS block_dev_io: driver returned SUSPEND", NO_NUM);
+      panic("MFS block_dev_io: driver returned SUSPEND");
   }
 
   if(buf != buf_used && r == OK) {
@@ -271,7 +270,7 @@ int flags;                  /* mode bits and flags */
   major = (dev >> MAJOR) & BYTE;
   if (major >= NR_DEVICES) major = 0;
   r = gen_opcl(driver_e, DEV_OPEN, dev, proc, flags);
-  if (r == SUSPEND) panic(__FILE__,"suspend on open from", NO_NUM);
+  if (r == SUSPEND) panic("suspend on open from");
   return(r);
 }
 
@@ -331,8 +330,7 @@ message *mess_ptr;          /* pointer to message for task */
        if (r != OK) {
                if (r == EDEADSRCDST) {
                        printf("fs: dead driver %d\n", task_nr);
-                       panic(__FILE__, "should handle crashed drivers",
-                               NO_NUM);
+                       panic("should handle crashed drivers");
                        /* dmap_unmap_by_endpt(task_nr); */
                        return r;
                }
@@ -340,7 +338,7 @@ message *mess_ptr;          /* pointer to message for task */
                        printf("fs: ELOCKED talking to %d\n", task_nr);
                        return r;
                }
-               panic(__FILE__,"call_task: can't send/receive", r);
+               panic("call_task: can't send/receive: %d", r);
        }
 
        /* Did the process we did the sendrec() for get a result? */
index 214d8b057025dfdb5d06f7ea763c1a68a85341b6..7c314e4e042a600154ef4001ab462303796f6c43 100644 (file)
@@ -45,18 +45,18 @@ PUBLIC int fs_putnode()
   if(!rip) {
          printf("%s:%d put_inode: inode #%d dev: %d not found\n", __FILE__,
                 __LINE__, fs_m_in.REQ_INODE_NR, fs_dev);
-         panic(__FILE__, "fs_putnode failed", NO_NUM);
+         panic("fs_putnode failed");
   }
 
   count = fs_m_in.REQ_COUNT;
   if (count <= 0) {
        printf("%s:%d put_inode: bad value for count: %d\n", __FILE__,
               __LINE__, count);
-       panic(__FILE__, "fs_putnode failed", NO_NUM);
+       panic("fs_putnode failed");
   } else if(count > rip->i_count) {
        printf("%s:%d put_inode: count too high: %d > %d\n", __FILE__,
               __LINE__, count, rip->i_count);
-       panic(__FILE__, "fs_putnode failed", NO_NUM);
+       panic("fs_putnode failed");
   }
 
   /* Decrease reference counter, but keep one reference; it will be consumed by
@@ -217,7 +217,7 @@ register struct inode *rip; /* pointer to inode to be released */
   if (rip == NIL_INODE) return;        /* checking here is easier than in caller */
 
   if (rip->i_count < 1)
-       panic(__FILE__, "put_inode: i_count already below 1", rip->i_count);
+       panic("put_inode: i_count already below 1: %d", rip->i_count);
 
   if (--rip->i_count == 0) {   /* i_count == 0 means no one is using it now */
        if (rip->i_nlinks == 0) {
index 8a0e2c6658dcaa838d370a4ce3c74430d9ebb411..28939ddadc208eefbb6733bb69a131feb5f3feb9 100644 (file)
@@ -657,7 +657,7 @@ off_t len;
   if( (b = read_map(rip, pos)) == NO_BLOCK) return;
   while (len > 0) {
        if( (bp = get_block(rip->i_dev, b, NORMAL)) == NIL_BUF)
-               panic(__FILE__, "zerozone_range: no block", NO_NUM);
+               panic("zerozone_range: no block");
        offset = pos % block_size;
        bytes = block_size - offset;
        if (bytes > len)
index a4bee343a0db838e7a4eafc98649e2fc3a2e4c85..426114e099a94831d0f0f94e42f1471b38590677 100644 (file)
@@ -122,7 +122,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
   fs_m_in.m_type = FS_READY;
 
   if ((r = send(FS_PROC_NR, &fs_m_in)) != OK) {
-       panic("MFS", "Error sending login to VFS", r);
+       panic("Error sending login to VFS: %d", r);
   }
 
   return(OK);
@@ -140,7 +140,7 @@ message *m_in;                              /* pointer to message */
 
   do {
        if ((r = sef_receive(ANY, m_in)) != OK)         /* wait for message */
-               panic("MFS","sef_receive failed", r);
+               panic("sef_receive failed: %d", r);
        src = fs_m_in.m_source;
 
        if (src != FS_PROC_NR) {
index 64e12900317d3e16d4a50e2929007a6f7bef199e..24a4ab6f8d8b7735156cfad4b2c2dc6c3b7e4c6f 100644 (file)
@@ -166,7 +166,7 @@ PUBLIC int fs_unmount()
 
   if ((root_ip = find_inode(fs_dev, ROOT_INODE)) == NIL_INODE) {
        printf("MFS: couldn't find root inode. Unmount failed.\n");
-       panic(__FILE__, "MFS: couldn't find root inode", EINVAL);
+       panic("MFS: couldn't find root inode: %d", EINVAL);
        return(EINVAL);
   }
    
index 72ea55c75079cc9d0988593731ca67535c722229..270cf1368487adbd19600f003e6b0b2cac4629ee 100644 (file)
@@ -160,7 +160,7 @@ PUBLIC int fs_mkdir()
          /* It was not possible to enter . or .. probably disk was full -
           * links counts haven't been touched. */
          if(search_dir(ldirp, lastc, (ino_t *) 0, DELETE, IGN_PERM) != OK)
-                 panic(__FILE__, "Dir disappeared ", rip->i_num);
+                 panic("Dir disappeared: %d", rip->i_num);
          rip->i_nlinks--;      /* undo the increment done in new_node() */
   }
   rip->i_dirt = DIRTY;         /* either way, i_nlinks has changed */
@@ -232,7 +232,7 @@ PUBLIC int fs_slink()
                  if(search_dir(ldirp, string, (ino_t *) 0, DELETE, 
                                                        IGN_PERM) != OK)
                                        
-                         panic(__FILE__, "Symbolic link vanished", NO_NUM);
+                         panic("Symbolic link vanished");
          } 
   }
 
index c9bb8514eddf50d3aea5a00fc0b8a7e6ddcfca7b..d5268b281a3a95d05381966b5181def7d5e0a7cc 100644 (file)
@@ -337,9 +337,7 @@ char *suffix;                       /* current remaining path. Has to point in the
   if (slen > 0) { /* Do we have path after the link? */
        /* For simplicity we require that suffix starts with a slash */
        if (suffix[0] != '/') {
-               panic(__FILE__,
-                       "ltraverse: suffix does not start with a slash",
-                       NO_NUM);
+               panic("ltraverse: suffix does not start with a slash");
        }
 
        /* To be able to expand the <link>, we have to move the 'suffix'
@@ -540,7 +538,7 @@ int check_permissions;               /* check permissions when flag is !IS_EMPTY */
        bp = get_block(ldir_ptr->i_dev, b, NORMAL);     /* get a dir block */
 
        if (bp == NO_BLOCK)
-               panic(__FILE__,"get_block returned NO_BLOCK", NO_NUM);
+               panic("get_block returned NO_BLOCK");
 
        /* Search a directory block. */
        for (dp = &bp->b_dir[0];
index 99aefdd318e421cb029b1098b1732b2b70d3d95c..e7f794287cf868d4e2d06f13bbd3e4f917200eee 100644 (file)
@@ -228,7 +228,7 @@ int *completed;                     /* number of bytes copied */
        dev = (dev_t) rip->i_zone[0];
   } else {
        if (ex64hi(position) != 0)
-               panic(__FILE__, "rw_chunk: position too high", NO_NUM);
+               panic("rw_chunk: position too high");
        b = read_map(rip, ex64lo(position));
        dev = rip->i_dev;
   }
@@ -259,7 +259,7 @@ int *completed;                     /* number of bytes copied */
 
   /* In all cases, bp now points to a valid buffer. */
   if (bp == NIL_BUF) 
-       panic(__FILE__,"bp not valid in rw_chunk, this can't happen", NO_NUM);
+       panic("bp not valid in rw_chunk; this can't happen");
   
   if (rw_flag == WRITING && chunk != block_size && !block_spec &&
                                ex64lo(position) >= rip->i_size && off == 0) {
@@ -367,7 +367,7 @@ int index;                  /* index into *bp */
   zone_t zone;                 /* V2 zones are longs (shorts in V1) */
 
   if(bp == NIL_BUF)
-       panic(__FILE__, "rd_indir() on NIL_BUF", NO_NUM);
+       panic("rd_indir() on NIL_BUF");
 
   sp = get_super(bp->b_dev);   /* need super block to find file sys type */
 
@@ -381,7 +381,7 @@ int index;                  /* index into *bp */
                (zone < (zone_t) sp->s_firstdatazone || zone >= sp->s_zones)) {
        printf("Illegal zone number %ld in indirect block, index %d\n",
               (long) zone, index);
-       panic(__FILE__,"check file system", NO_NUM);
+       panic("check file system");
   }
   
   return(zone);
@@ -576,7 +576,7 @@ PUBLIC int fs_getdents(void)
          bp = get_block(rip->i_dev, b, NORMAL);        /* get a dir block */
 
          if(bp == NO_BLOCK)
-                 panic(__FILE__,"get_block returned NO_BLOCK", NO_NUM);
+                 panic("get_block returned NO_BLOCK");
 
          /* Search a directory block. */
          if (block_pos < pos)
@@ -608,9 +608,7 @@ PUBLIC int fs_getdents(void)
                                             (vir_bytes)getdents_buf,
                                             tmpbuf_off, D);
                          if (r != OK)
-                                 panic(__FILE__,
-                                       "fs_getdents: sys_safecopyto failed\n",
-                                       r);
+                               panic("fs_getdents: sys_safecopyto failed: %d", r);
 
                          userbuf_off += tmpbuf_off;
                          tmpbuf_off = 0;
@@ -646,7 +644,7 @@ PUBLIC int fs_getdents(void)
          r = sys_safecopyto(FS_PROC_NR, gid, userbuf_off, 
                (vir_bytes) getdents_buf, tmpbuf_off, D);
          if (r != OK)
-                 panic(__FILE__, "fs_getdents: sys_safecopyto failed\n", r);
+                 panic("fs_getdents: sys_safecopyto failed: %d", r);
 
          userbuf_off += tmpbuf_off;
   }
index 52ea86a961a0caf2e3a496ca791ff509e4ac6804..207d0597dfb25a0a3728a2b62652ef93b92b5162 100644 (file)
@@ -40,7 +40,7 @@ bit_t origin;                 /* number of bit to start searching at */
   bit_t i, b;
 
   if (sp->s_rd_only)
-       panic(__FILE__,"can't allocate bit on read-only filesys.", NO_NUM);
+       panic("can't allocate bit on read-only filesys");
 
   if (map == IMAP) {
        start_block = START_BLOCK;
@@ -113,7 +113,7 @@ bit_t bit_returned;         /* number of bit to insert into the map */
   block_t start_block;
 
   if (sp->s_rd_only)
-       panic(__FILE__,"can't free bit on read-only filesys.", NO_NUM);
+       panic("can't free bit on read-only filesys");
 
   if (map == IMAP) {
        start_block = START_BLOCK;
@@ -131,8 +131,7 @@ bit_t bit_returned;         /* number of bit to insert into the map */
 
   k = conv2(sp->s_native, (int) bp->b_bitmap[word]);
   if (!(k & mask)) {
-       panic(__FILE__,map == IMAP ? "tried to free unused inode" :
-             "tried to free unused block", bit_returned);
+       panic(map == IMAP ? "tried to free unused inode" : "tried to free unused block: %d", bit_returned);
   }
 
   k &= ~mask;
@@ -150,10 +149,10 @@ PUBLIC struct super_block *get_super(dev)
 dev_t dev;                     /* device number whose super_block is sought */
 {
   if (dev == NO_DEV)
-       panic(__FILE__,"request for super_block of NO_DEV", NO_NUM);
+       panic("request for super_block of NO_DEV");
 
   if(superblock.s_dev != dev)
-       panic(__FILE__,"wrong superblock", (int) dev);
+       panic("wrong superblock: %d", (int) dev);
 
   return(&superblock);
 }
@@ -165,7 +164,7 @@ dev_t dev;                  /* device number whose super_block is sought */
 PUBLIC int get_block_size(dev_t dev)
 {
   if (dev == NO_DEV)
-       panic(__FILE__,"request for block size of NO_DEV", NO_NUM);
+       panic("request for block size of NO_DEV");
 
   return(fs_block_size);
 
@@ -189,7 +188,7 @@ register struct super_block *sp; /* pointer to a superblock */
 
   dev = sp->s_dev;             /* save device (will be overwritten by copy) */
   if (dev == NO_DEV)
-       panic(__FILE__,"request for super_block of NO_DEV", NO_NUM);
+       panic("request for super_block of NO_DEV");
   
   r = block_dev_io(MFS_DEV_READ, dev, SELF_E,
        sbbuf, cvu64(SUPER_BLOCK_BYTES), _MIN_BLOCK_SIZE, 0);
index d8a75c5f9cb07d8c1a260d578838c44d72d877d3..e4b99379c53cbb184a4969bbfcfcb8ba2552c659 100644 (file)
@@ -68,10 +68,10 @@ PUBLIC time_t clock_time()
 
   if (use_getuptime2) {
        if ( (k=getuptime2(&uptime,&boottime)) != OK)
-               panic(__FILE__,"clock_time: getuptme2 failed", k);
+               panic("clock_time: getuptme2 failed: %d", k);
   } else {
        if ( (k=getuptime(&uptime)) != OK)
-               panic(__FILE__,"clock_time err", k);
+               panic("clock_time err: %d", k);
   }
   
   return( (time_t) (boottime + (uptime/sys_hz())));
@@ -86,7 +86,7 @@ PUBLIC int mfs_min_f(char *file, int line, int v1, int v2)
        if(v1 < 0 || v2 < 0) {
                printf("mfs:%s:%d: strange string lengths: %d, %d\n",
                        file, line, v1, v2);
-               panic(file, "strange string lengths", NO_NUM);
+               panic("strange string lengths");
        }
        if(v2 >= v1) return v1;
 
@@ -101,7 +101,7 @@ PUBLIC void mfs_nul_f(char *file, int line, char *str, int len, int maxlen)
 {
        if(len < 1) {
                printf("mfs:%s:%d: %d-length string?!\n", file, line, len);
-               panic(file, "strange string length", NO_NUM);
+               panic("strange string length");
        }
        if(len < maxlen && str[len-1] != '\0') {
                printf("mfs:%s:%d: string (length %d, maxlen %d) "
@@ -111,7 +111,7 @@ PUBLIC void mfs_nul_f(char *file, int line, char *str, int len, int maxlen)
 }
 
 #define MYASSERT(c) if(!(c)) { printf("MFS:%s:%d: sanity check: %s failed\n", \
-  file, line, #c); panic("MFS", "sanity check " #c " failed", __LINE__); }
+  file, line, #c); panic("sanity check " #c " failed: %d", __LINE__); }
 
 
 /*===========================================================================*
index b2e90b2a135bc056f6950a8cd98f549fe2d20bb5..a19e5b91bdb8b204aab288765799797c9248da60 100644 (file)
@@ -196,7 +196,7 @@ zone_t zone;                        /* zone to write */
   struct super_block *sp;
 
   if(bp == NIL_BUF)
-       panic(__FILE__, "wr_indir() on NIL_BUF", NO_NUM);
+       panic("wr_indir() on NIL_BUF");
 
   sp = get_super(bp->b_dev);   /* need super block to find file sys type */
 
index 324844198e919e13798887596c89a2977c308f1f..31ed005d16f9d77b8d8afad1992cdb6a93ba99ef 100644 (file)
@@ -41,18 +41,18 @@ PUBLIC int fs_putnode()
   if(!rip) {
          printf("%s:%d put_inode: inode #%d dev: %d not found\n", __FILE__,
                 __LINE__, fs_m_in.REQ_INODE_NR, fs_m_in.REQ_DEV);
-         panic(__FILE__, "fs_putnode failed", NO_NUM);
+         panic("fs_putnode failed");
   }
 
   count = fs_m_in.REQ_COUNT;
   if (count <= 0) {
        printf("%s:%d put_inode: bad value for count: %d\n", __FILE__,
               __LINE__, count);
-       panic(__FILE__, "fs_putnode failed", NO_NUM);
+       panic("fs_putnode failed");
   } else if(count > rip->i_count) {
        printf("%s:%d put_inode: count too high: %d > %d\n", __FILE__,
               __LINE__, count, rip->i_count);
-       panic(__FILE__, "fs_putnode failed", NO_NUM);
+       panic("fs_putnode failed");
   }
 
   /* Decrease reference counter, but keep one reference; it will be consumed by
@@ -210,7 +210,7 @@ register struct inode *rip; /* pointer to inode to be released */
   if (rip == NIL_INODE) return;        /* checking here is easier than in caller */
 
   if (rip->i_count < 1)
-       panic(__FILE__, "put_inode: i_count already below 1", rip->i_count);
+       panic("put_inode: i_count already below 1: %d", rip->i_count);
 
   if (--rip->i_count == 0) {   /* i_count == 0 means no one is using it now */
        if (rip->i_nlinks == 0) {
index d52a506fad29ff0ce5a1453125004b0467698e2b..aa36d28c1099e9bf09872bf5c151b1ec219e6610 100644 (file)
@@ -121,7 +121,7 @@ message *m_in;                              /* pointer to message */
 
   do {
        if ((r = sef_receive(ANY, m_in)) != OK)         /* wait for message */
-               panic("PFS","sef_receive failed", r);
+               panic("sef_receive failed: %d", r);
        src = fs_m_in.m_source;
 
        if (src != VFS_PROC_NR) {
index 2956a0cd94fe901d535090cf99bc840151351b8e..e18a882552ef737ed77d0d63f0d841b9af09a8b9 100644 (file)
@@ -26,7 +26,7 @@ PUBLIC time_t clock_time()
   clock_t uptime, boottime;
 
   if ((r = getuptime2(&uptime,&boottime)) != OK)
-               panic(__FILE__,"clock_time: getuptme2 failed", r);
+               panic("clock_time: getuptme2 failed: %d", r);
   
   return( (time_t) (boottime + (uptime/sys_hz())));
 }
index 8033eebb38d71b7aad5407effff2b2e5afb4d650..4c29103e4d5d551855c00ffa82ecbfaa0a78bc8f 100644 (file)
@@ -145,7 +145,7 @@ PUBLIC int do_itimer()
                break;
 
        default:
-               panic(__FILE__, "invalid timer type", m_in.which_timer);
+               panic("invalid timer type: %d", m_in.which_timer);
   }
 
   /* If requested, copy the old interval timer to user space. */
@@ -227,14 +227,14 @@ struct itimerval *ovalue;
   switch (which) {
   case ITIMER_VIRTUAL: num = VT_VIRTUAL; break;
   case ITIMER_PROF:    num = VT_PROF;    break;
-  default:             panic(__FILE__, "invalid vtimer type", which);
+  default:             panic("invalid vtimer type: %d", which);
   }
 
   /* Make the kernel call. If requested, also retrieve and store
    * the old timer value.
    */
   if ((r = sys_vtimer(rmp->mp_endpoint, num, nptr, optr)) != OK)
-       panic(__FILE__, "sys_vtimer failed", r);
+       panic("sys_vtimer failed: %d", r);
 
   if (ovalue != NULL) {
        /* If the alarm expired already, we should take into account the
@@ -262,7 +262,7 @@ int sig;
   switch (sig) {
   case SIGVTALRM: which = ITIMER_VIRTUAL; num = VT_VIRTUAL; break;
   case SIGPROF:   which = ITIMER_PROF;    num = VT_PROF;    break;
-  default: panic(__FILE__, "invalid vtimer signal", sig);
+  default: panic("invalid vtimer signal: %d", sig);
   }
 
   /* If a repetition interval was set for this virtual timer, tell the
@@ -287,7 +287,7 @@ struct itimerval *value;
   /* First determine remaining time, in ticks, of previous alarm, if set. */
   if (rmp->mp_flags & ALARM_ON) {
        if ( (s = getuptime(&uptime)) != OK)
-               panic(__FILE__, "get_realtimer couldn't get uptime", s);
+               panic("get_realtimer couldn't get uptime: %d", s);
        exptime = *tmr_exp_time(&rmp->mp_timer);
 
        remaining = exptime - uptime;
index e1c8e7f75c657cca2b3277fd43fb26ce8c405371..d464ad21cdbcf886f543a80acb0f7868a60b913b 100644 (file)
@@ -73,17 +73,15 @@ PUBLIC int do_exec_newmem()
                return EPERM;
 
        proc_e= m_in.EXC_NM_PROC;
-       if (pm_isokendpt(proc_e, &proc_n) != OK)
-       {
-               panic(__FILE__, "do_exec_newmem: got bad endpoint",
-                       proc_e);
+       if (pm_isokendpt(proc_e, &proc_n) != OK) {
+               panic("do_exec_newmem: got bad endpoint: %d", proc_e);
        }
        rmp= &mproc[proc_n];
        ptr= m_in.EXC_NM_PTR;
        r= sys_datacopy(who_e, (vir_bytes)ptr,
                SELF, (vir_bytes)&args, sizeof(args));
        if (r != OK)
-               panic(__FILE__, "do_exec_newmem: sys_datacopy failed", r);
+               panic("do_exec_newmem: sys_datacopy failed: %d", r);
 
        if((r=vm_exec_newmem(proc_e, &args, sizeof(args), &stack_top, &flags)) == OK) {
                allow_setuid= 0;                /* Do not allow setuid execution */  
@@ -127,10 +125,8 @@ PUBLIC int do_execrestart()
                return EPERM;
 
        proc_e= m_in.EXC_RS_PROC;
-       if (pm_isokendpt(proc_e, &proc_n) != OK)
-       {
-               panic(__FILE__, "do_execrestart: got bad endpoint",
-                       proc_e);
+       if (pm_isokendpt(proc_e, &proc_n) != OK) {
+               panic("do_execrestart: got bad endpoint: %d", proc_e);
        }
        rmp= &mproc[proc_n];
        result= m_in.EXC_RS_RESULT;
@@ -191,6 +187,6 @@ int result;
        new_sp= (char *)rmp->mp_procargs;
        pc= 0;  /* for now */
        r= sys_exec(rmp->mp_endpoint, new_sp, rmp->mp_name, pc);
-       if (r != OK) panic(__FILE__, "sys_exec failed", r);
+       if (r != OK) panic("sys_exec failed: %d", r);
 }
 
index f2796f2c97352054f3b927a7a4400271b8d0051c..cb87baaf15f36faeb70e8183c51509757269bd76 100644 (file)
@@ -68,10 +68,10 @@ PUBLIC int do_fork()
        n++;
   } while((mproc[next_child].mp_flags & IN_USE) && n <= NR_PROCS);
   if(n > NR_PROCS)
-       panic(__FILE__,"do_fork can't find child slot", NO_NUM);
+       panic("do_fork can't find child slot");
   if(next_child < 0 || next_child >= NR_PROCS
  || (mproc[next_child].mp_flags & IN_USE))
-       panic(__FILE__,"do_fork finds wrong child slot", next_child);
+       panic("do_fork finds wrong child slot: %d", next_child);
 
   /* Memory part of the forking. */
   if((s=vm_fork(rmp->mp_endpoint, next_child, &child_ep)) != OK) {
@@ -158,10 +158,10 @@ PUBLIC int do_fork_nb()
        n++;
   } while((mproc[next_child].mp_flags & IN_USE) && n <= NR_PROCS);
   if(n > NR_PROCS)
-       panic(__FILE__,"do_fork can't find child slot", NO_NUM);
+       panic("do_fork can't find child slot");
   if(next_child < 0 || next_child >= NR_PROCS
  || (mproc[next_child].mp_flags & IN_USE))
-       panic(__FILE__,"do_fork finds wrong child slot", next_child);
+       panic("do_fork finds wrong child slot: %d", next_child);
 
   if((s=vm_fork(rmp->mp_endpoint, next_child, &child_ep)) != OK) {
        printf("PM: vm_fork failed: %d\n", s);
@@ -261,7 +261,7 @@ int dump_core;                      /* flag indicating whether to dump core */
 
   /* Do accounting: fetch usage times and accumulate at parent. */
   if((r=sys_times(proc_nr_e, &user_time, &sys_time, NULL, NULL)) != OK)
-       panic(__FILE__,"exit_proc: sys_times failed", r);
+       panic("exit_proc: sys_times failed: %d", r);
 
   p_mp = &mproc[rmp->mp_parent];                       /* process' parent */
   p_mp->mp_child_utime += user_time + rmp->mp_child_utime; /* add user time */
@@ -274,10 +274,10 @@ int dump_core;                    /* flag indicating whether to dump core */
    * such as copying to/ from the exiting process, before it is gone.
    */
   if ((r = sys_stop(proc_nr_e)) != OK)         /* stop the process */
-       panic(__FILE__, "sys_stop failed", r);
+       panic("sys_stop failed: %d", r);
 
   if((r=vm_willexit(proc_nr_e)) != OK) {
-       panic(__FILE__, "exit_proc: vm_willexit failed", r);
+       panic("exit_proc: vm_willexit failed: %d", r);
   }
   vm_notify_sig_wrapper(rmp->mp_endpoint);
 
@@ -288,7 +288,7 @@ int dump_core;                      /* flag indicating whether to dump core */
   }
   if (proc_nr_e == FS_PROC_NR)
   {
-       panic(__FILE__, "exit_proc: FS died", r);
+       panic("exit_proc: FS died: %d", r);
   }
 
   /* Tell FS about the exiting process. */
@@ -304,7 +304,7 @@ int dump_core;                      /* flag indicating whether to dump core */
         * driver that FS is blocked waiting on.
         */
        if((r= sys_exit(rmp->mp_endpoint)) != OK)
-               panic(__FILE__, "exit_proc: sys_exit failed", r);
+               panic("exit_proc: sys_exit failed: %d", r);
   }
 
   /* Clean up most of the flags describing the process's state before the exit,
@@ -364,12 +364,12 @@ int dump_core;                    /* flag indicating whether to dump core */
   {
        /* destroy the (user) process */
        if((r=sys_exit(rmp->mp_endpoint)) != OK)
-               panic(__FILE__, "exit_restart: sys_exit failed", r);
+               panic("exit_restart: sys_exit failed: %d", r);
   }
 
   /* Release the memory occupied by the child. */
   if((r=vm_exit(rmp->mp_endpoint)) != OK) {
-       panic(__FILE__, "exit_restart: vm_exit failed", r);
+       panic("exit_restart: vm_exit failed: %d", r);
   }
 
   if (rmp->mp_flags & TRACE_EXIT)
@@ -508,7 +508,7 @@ struct mproc *rmp;
   struct mproc *t_mp;
 
   if (rmp->mp_flags & (TRACE_ZOMBIE | ZOMBIE))
-       panic(__FILE__, "zombify: process was already a zombie", NO_NUM);
+       panic("zombify: process was already a zombie");
 
   /* See if we have to notify a tracer process first. */
   if (rmp->mp_tracer != NO_TRACER && rmp->mp_tracer != rmp->mp_parent) {
@@ -579,11 +579,11 @@ register struct mproc *child;     /* tells which process is exiting */
 
   mp_parent= child->mp_parent;
   if (mp_parent <= 0)
-       panic(__FILE__, "tell_parent: bad value in mp_parent", mp_parent);
+       panic("tell_parent: bad value in mp_parent: %d", mp_parent);
   if(!(child->mp_flags & ZOMBIE))
-       panic(__FILE__, "tell_parent: child not a zombie", NO_NUM);
+       panic("tell_parent: child not a zombie");
   if(child->mp_flags & TOLD_PARENT)
-       panic(__FILE__, "tell_parent: telling parent again", NO_NUM);
+       panic("tell_parent: telling parent again");
   parent = &mproc[mp_parent];
 
   /* Wake up the parent by sending the reply message. */
@@ -606,9 +606,9 @@ struct mproc *child;                        /* tells which process is exiting */
 
   mp_tracer = child->mp_tracer;
   if (mp_tracer <= 0)
-       panic(__FILE__, "tell_tracer: bad value in mp_tracer", mp_tracer);
+       panic("tell_tracer: bad value in mp_tracer: %d", mp_tracer);
   if(!(child->mp_flags & TRACE_ZOMBIE))
-       panic(__FILE__, "tell_tracer: child not a zombie", NO_NUM);
+       panic("tell_tracer: child not a zombie");
   tracer = &mproc[mp_tracer];
 
   exitstatus = (child->mp_exitstatus << 8) | (child->mp_sigstatus & 0377);
index 3a59900b016045b9a7156de249e69bbcf14fd47c..a4fb748e6b86392f0b96cd5762040d6661cd5dfe 100644 (file)
@@ -229,15 +229,15 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
    * reported, but it must be corrected for the kernel and system processes.
    */
   if ((s=sys_getmonparams(monitor_params, sizeof(monitor_params))) != OK)
-      panic(__FILE__,"get monitor params failed",s);
+      panic("get monitor params failed: %d", s);
   if ((s=sys_getkinfo(&kinfo)) != OK)
-      panic(__FILE__,"get kernel info failed",s);
+      panic("get kernel info failed: %d", s);
 
   /* Initialize PM's process table. Request a copy of the system image table 
    * that is defined at the kernel level to see which slots to fill in.
    */
   if (OK != (s=sys_getimage(image))) 
-       panic(__FILE__,"couldn't get image table: %d\n", s);
+       panic("couldn't get image table: %d", s);
   procs_in_use = 0;                            /* start populating table */
   for (ip = &image[0]; ip < &image[NR_BOOT_PROCS]; ip++) {
        if (ip->proc_nr >= 0) {                 /* task have negative nrs */
@@ -285,7 +285,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
                mess.PM_PID = rmp->mp_pid;
                mess.PM_PROC = rmp->mp_endpoint;
                if (OK != (s=send(FS_PROC_NR, &mess)))
-                       panic(__FILE__,"can't sync up with FS", s);
+                       panic("can't sync up with FS: %d", s);
        }
   }
 
@@ -295,7 +295,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
   /* Tell FS that no more system processes follow and synchronize. */
   mess.PR_ENDPT = NONE;
   if (sendrec(FS_PROC_NR, &mess) != OK || mess.m_type != OK)
-       panic(__FILE__,"can't sync up with FS", NO_NUM);
+       panic("can't sync up with FS");
 
 #if (CHIP == INTEL)
         uts_val.machine[0] = 'i';
@@ -325,10 +325,10 @@ PRIVATE void get_work()
 {
 /* Wait for the next message and extract useful information from it. */
   if (sef_receive(ANY, &m_in) != OK)
-       panic(__FILE__,"PM sef_receive error", NO_NUM);
+       panic("PM sef_receive error");
   who_e = m_in.m_source;       /* who sent the message */
   if(pm_isokendpt(who_e, &who_p) != OK)
-       panic(__FILE__, "PM got message from invalid endpoint", who_e);
+       panic("PM got message from invalid endpoint: %d", who_e);
   call_nr = m_in.m_type;       /* system call number */
 
   /* Process slot of caller. Misuse PM's own process slot if the kernel is
@@ -337,8 +337,7 @@ PRIVATE void get_work()
    */
   mp = &mproc[who_p < 0 ? PM_PROC_NR : who_p];
   if(who_p >= 0 && mp->mp_endpoint != who_e) {
-       panic(__FILE__, "PM endpoint number out of sync with source",
-               mp->mp_endpoint);
+       panic("PM endpoint number out of sync with source: %d", mp->mp_endpoint);
   }
 }
 
@@ -356,7 +355,7 @@ int result;                 /* result of call (usually OK or error #) */
   register struct mproc *rmp = &mproc[proc_nr];
 
   if(proc_nr < 0 || proc_nr >= NR_PROCS)
-      panic(__FILE__,"setreply arg out of range", proc_nr);
+      panic("setreply arg out of range: %d", proc_nr);
 
   rmp->mp_reply.reply_res = result;
   rmp->mp_flags |= REPLY;      /* reply pending */
@@ -395,7 +394,7 @@ void checkme(char *str, int line)
                           boned=1;
                        }
                }
-               if(boned) panic(__FILE__, "corrupt mp_endpoint?", NO_NUM);
+               if(boned) panic("corrupt mp_endpoint?");
        }
 }
 
@@ -430,19 +429,19 @@ PRIVATE void handle_fs_reply()
   proc_e = m_in.PM_PROC;
 
   if (pm_isokendpt(proc_e, &proc_n) != OK) {
-       panic(__FILE__, "handle_fs_reply: got bad endpoint from FS", proc_e);
+       panic("handle_fs_reply: got bad endpoint from FS: %d", proc_e);
   }
 
   rmp = &mproc[proc_n];
 
   /* Now that FS replied, mark the process as FS-idle again */
   if (!(rmp->mp_flags & FS_CALL))
-       panic(__FILE__, "handle_fs_reply: reply without request", call_nr);
+       panic("handle_fs_reply: reply without request: %d", call_nr);
 
   rmp->mp_flags &= ~FS_CALL;
 
   if (rmp->mp_flags & UNPAUSED)
-       panic(__FILE__, "handle_fs_reply: UNPAUSED set on entry", call_nr);
+       panic("handle_fs_reply: UNPAUSED set on entry: %d", call_nr);
 
   /* Call-specific handler code */
   switch (call_nr) {
@@ -499,7 +498,7 @@ PRIVATE void handle_fs_reply()
        break;
 
   default:
-       panic(__FILE__, "handle_fs_reply: unknown reply code", call_nr);
+       panic("handle_fs_reply: unknown reply code: %d", call_nr);
   }
 
   /* Now that the process is idle again, look at pending signals */
index 7394bb1c74cc58617051efe410e8ad64d0cdaaa3..f4d3c6ca0e2a3ba263d959f196dfa936b953ce26 100644 (file)
@@ -221,13 +221,13 @@ PUBLIC int ksig_pending()
    int r;
    /* get an arbitrary pending signal */
    if((r=sys_getksig(&proc_nr_e, &sig_map)) != OK)
-       panic(__FILE__,"sys_getksig failed", r);
+       panic("sys_getksig failed: %d", r);
    if (NONE == proc_nr_e) {            /* stop if no more pending signals */
        break;
    } else {
        int proc_nr_p;
        if(pm_isokendpt(proc_nr_e, &proc_nr_p) != OK)
-               panic(__FILE__,"sys_getksig strange process", proc_nr_e);
+               panic("sys_getksig strange process: %d", proc_nr_e);
        handle_ksig(proc_nr_e, sig_map);        /* handle the received signal */
        /* If the process still exists to the kernel after the signal
         * has been handled ...
@@ -235,7 +235,7 @@ PUBLIC int ksig_pending()
         if ((mproc[proc_nr_p].mp_flags & (IN_USE | EXITING)) == IN_USE)
        {
           if((r=sys_endksig(proc_nr_e)) != OK) /* ... tell kernel it's done */
-               panic(__FILE__,"sys_endksig failed", r);
+               panic("sys_endksig failed: %d", r);
        }
    }
  } 
@@ -309,13 +309,13 @@ sigset_t sig_map;
        rmp->mp_flags &= ~DELAY_CALL;
 
        if (rmp->mp_flags & (FS_CALL | PM_SIG_PENDING))
-               panic(__FILE__, "handle_ksig: bad process state", NO_NUM);
+               panic("handle_ksig: bad process state");
 
        /* Process as many normal signals as possible. */
        check_pending(rmp);
 
        if (rmp->mp_flags & DELAY_CALL)
-               panic(__FILE__, "handle_ksig: multiple delay calls?", NO_NUM);
+               panic("handle_ksig: multiple delay calls?");
   }
 }
 
@@ -357,7 +357,7 @@ int ksig;                   /* non-zero means signal comes from kernel  */
   slot = (int) (rmp - mproc);
   if ((rmp->mp_flags & (IN_USE | EXITING)) != IN_USE) {
        printf("PM: signal %d sent to exiting process %d\n", signo, slot);
-       panic(__FILE__,"", NO_NUM);
+       panic("");
   }
 
   if (trace == TRUE && rmp->mp_tracer != NO_TRACER && signo != SIGKILL) {
@@ -380,7 +380,7 @@ int ksig;                   /* non-zero means signal comes from kernel  */
        if (!(rmp->mp_flags & PM_SIG_PENDING)) {
                /* No delay calls: FS_CALL implies the process called us. */
                if ((r = sys_stop(rmp->mp_endpoint)) != OK)
-                       panic(__FILE__, "sys_stop failed", r);
+                       panic("sys_stop failed: %d", r);
 
                rmp->mp_flags |= PM_SIG_PENDING;
        }
@@ -585,7 +585,7 @@ struct mproc *rmp;
                rmp->mp_flags &= ~(PM_SIG_PENDING | UNPAUSED);
 
                if ((r = sys_resume(rmp->mp_endpoint)) != OK)
-                       panic(__FILE__, "sys_resume failed", r);
+                       panic("sys_resume failed: %d", r);
        }
   }
 }
@@ -613,7 +613,7 @@ struct mproc *rmp;          /* which process */
   if (rmp->mp_flags & (PAUSED | WAITING | SIGSUSPENDED)) {
        /* Stop process from running. No delay calls: it called us. */
        if ((r = sys_stop(rmp->mp_endpoint)) != OK)
-               panic(__FILE__, "sys_stop failed", r);
+               panic("sys_stop failed: %d", r);
 
        rmp->mp_flags |= UNPAUSED;
 
@@ -635,7 +635,7 @@ struct mproc *rmp;          /* which process */
 
                return;
        }
-       else if (r != OK) panic(__FILE__, "sys_stop failed", r);
+       else if (r != OK) panic("sys_stop failed: %d", r);
 
        rmp->mp_flags |= PM_SIG_PENDING;
   }
@@ -664,7 +664,7 @@ int signo;                  /* signal to send to process (1 to _NSIG-1) */
   int r, sigflags, slot;
 
   if (!(rmp->mp_flags & UNPAUSED))
-       panic(__FILE__, "sig_send: process not unpaused", NO_NUM);
+       panic("sig_send: process not unpaused");
 
   sigflags = rmp->mp_sigact[signo].sa_flags;
   slot = (int) (rmp - mproc);
@@ -698,7 +698,7 @@ int signo;                  /* signal to send to process (1 to _NSIG-1) */
   /* Ask the kernel to deliver the signal */
   r = sys_sigsend(rmp->mp_endpoint, &sigmsg);
   if (r != OK)
-       panic(__FILE__, "sys_sigsend failed", r);
+       panic("sys_sigsend failed: %d", r);
 
   /* Was the process suspended in PM? Then interrupt the blocking call. */
   if (rmp->mp_flags & (PAUSED | WAITING | SIGSUSPENDED)) {
@@ -712,7 +712,7 @@ int signo;                  /* signal to send to process (1 to _NSIG-1) */
        rmp->mp_flags &= ~UNPAUSED;
 
        if ((r = sys_resume(rmp->mp_endpoint)) != OK)
-               panic(__FILE__, "sys_resume failed", r);
+               panic("sys_resume failed: %d", r);
   }
 
   return(TRUE);
index ffbceb5ac74eef94bfd6ea1f24b6331ec3086ee1..63a66289d9998e8905a6358346d2c7eb398e27c9 100644 (file)
@@ -27,7 +27,7 @@ PUBLIC int do_time()
   int s;
 
   if ( (s=getuptime2(&uptime, &boottime)) != OK) 
-       panic(__FILE__,"do_time couldn't get uptime", s);
+       panic("do_time couldn't get uptime: %d", s);
 
   mp->mp_reply.reply_time = (time_t) (boottime + (uptime/system_hz));
   mp->mp_reply.reply_utime = (uptime%system_hz)*1000000/system_hz;
@@ -49,12 +49,12 @@ PUBLIC int do_stime()
       return(EPERM);
   }
   if ( (s=getuptime(&uptime)) != OK) 
-      panic(__FILE__,"do_stime couldn't get uptime", s);
+      panic("do_stime couldn't get uptime: %d", s);
   boottime = (long) m_in.stime - (uptime/system_hz);
 
   s= sys_stime(boottime);              /* Tell kernel about boottime */
   if (s != OK)
-       panic(__FILE__, "pm: sys_stime failed", s);
+       panic("pm: sys_stime failed: %d", s);
 
   return(OK);
 }
@@ -70,7 +70,7 @@ PUBLIC int do_times()
   int s;
 
   if (OK != (s=sys_times(who_e, &user_time, &sys_time, &uptime, NULL)))
-      panic(__FILE__,"do_times couldn't get times", s);
+      panic("do_times couldn't get times: %d", s);
   rmp->mp_reply.reply_t1 = user_time;          /* user time */
   rmp->mp_reply.reply_t2 = sys_time;           /* system time */
   rmp->mp_reply.reply_t3 = rmp->mp_child_utime;        /* child user time */
index 7cc20b3495ad5b73e388b154339e3d7902968e5b..df6d4addbc8b5ef1032d4eeaf06b571743904082 100644 (file)
@@ -31,7 +31,7 @@ PUBLIC void pm_set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
        clock_t now, prev_time = 0, next_time;
 
        if ((r = getuptime(&now)) != OK)
-               panic(__FILE__, "PM couldn't get uptime", NO_NUM);
+               panic("PM couldn't get uptime");
 
        /* Set timer argument and add timer to the list. */
        tmr_arg(tp)->ta_int = arg;
@@ -40,7 +40,7 @@ PUBLIC void pm_set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
        /* Reschedule our synchronous alarm if necessary. */
        if (pm_expiring == 0 && (! prev_time || prev_time > next_time)) {
                if (sys_setalarm(next_time, 1) != OK)
-                       panic(__FILE__, "PM set timer couldn't set alarm.", NO_NUM);
+                       panic("PM set timer couldn't set alarm");
        }
 
        return;
@@ -64,7 +64,7 @@ PUBLIC void pm_expire_timers(clock_t now)
        /* Reschedule an alarm if necessary. */
        if (next_time > 0) {
                if (sys_setalarm(next_time, 1) != OK)
-                       panic(__FILE__, "PM expire timer couldn't set alarm.", NO_NUM);
+                       panic("PM expire timer couldn't set alarm");
        }
 }
 
@@ -82,6 +82,6 @@ PUBLIC void pm_cancel_timer(timer_t *tp)
         */
        if (pm_expiring == 0 && (prev_time < next_time || ! next_time)) {
                if (sys_setalarm(next_time, 1) != OK)
-                       panic(__FILE__, "PM expire timer couldn't set alarm.", NO_NUM);
+                       panic("PM expire timer couldn't set alarm");
        }
 }
index 2d916daffee7ae6d9d33bb525e0096bceef58334..fd1b91139a18e5bc9b67067cb731f839a4201e88 100644 (file)
@@ -255,7 +255,7 @@ int signo;
   int r;
 
   r = sys_trace(T_STOP, rmp->mp_endpoint, 0L, (long *) 0);
-  if (r != OK) panic("pm", "sys_trace failed", r);
+  if (r != OK) panic("sys_trace failed: %d", r);
  
   rmp->mp_flags |= STOPPED;
   if (wait_test(rpmp, rmp)) {
index c75bc0fa465abe61c944e225e79c0277f4f537f5..f3058b3f62e3d01b6c551028f1ed78b709782297 100644 (file)
@@ -130,11 +130,11 @@ message *m_ptr;
   int r;
 
   if (rmp->mp_flags & FS_CALL)
-       panic(__FILE__, "tell_fs: not idle", m_ptr->m_type);
+       panic("tell_fs: not idle: %d", m_ptr->m_type);
 
   r = asynsend3(FS_PROC_NR, m_ptr, AMF_NOREPLY);
   if (r != OK)
-       panic(__FILE__, "unable to send to FS", r);
+       panic("unable to send to FS: %d", r);
 
   rmp->mp_flags |= FS_CALL;
 }
index b61a03f20d53c5f387475d5ed6bc5aab76956fb2..d300f49b2933750cd8e6c954d7213b01a01b5629 100644 (file)
@@ -65,7 +65,7 @@ PUBLIC int main(void)
       who_e = m.m_source;
       who_p = _ENDPOINT_P(who_e);
       if(who_p < -NR_TASKS || who_p >= NR_PROCS)
-       panic("RS","message from bogus source", who_e);
+       panic("message from bogus source: %d", who_e);
 
       call_nr = m.m_type;
 
@@ -176,7 +176,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
   rinit.rproctab_gid = cpf_grant_direct(ANY, (vir_bytes) rprocpub,
       sizeof(rprocpub), CPF_READ);
   if(!GRANT_VALID(rinit.rproctab_gid)) {
-      panic("RS", "unable to create rprocpub table grant", rinit.rproctab_gid);
+      panic("unable to create rprocpub table grant: %d", rinit.rproctab_gid);
   }
 
   /* Initialize the global update descriptor. */
@@ -184,7 +184,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
   /* Get a copy of the boot image table. */
   if ((s = sys_getimage(image)) != OK) {
-      panic("RS", "unable to get copy of boot image table", s);
+      panic("unable to get copy of boot image table: %d", s);
   }
 
   /* Determine the number of system services in the boot image table and
@@ -210,7 +210,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
        */
       if(boot_image_sys->flags & SF_USE_COPY) {
           if((s = sys_getaoutheader(&header, i)) != OK) {
-              panic("RS", "unable to get copy of a.out header", s);
+              panic("unable to get copy of a.out header: %d", s);
           }
           boot_image_buffer_size += header.a_hdrlen
               + header.a_text + header.a_data;
@@ -231,15 +231,14 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
       nr_image_priv_srvs++;
   }
   if(nr_image_srvs != nr_image_priv_srvs) {
-      panic("RS", "boot image table and boot image priv table mismatch",
-          NO_NUM);
+       panic("boot image table and boot image priv table mismatch");
   }
 
   /* Allocate boot image buffer. */
   if(boot_image_buffer_size > 0) {
       boot_image_buffer = rs_startup_sbrk(boot_image_buffer_size);
       if(boot_image_buffer == (char *) -1) {
-          panic("RS", "unable to allocate boot image buffer", NO_NUM);
+          panic("unable to allocate boot image buffer");
       }
   }
 
@@ -304,13 +303,13 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
           /* Set the privilege structure. */
           if ((s = sys_privctl(ip->endpoint, SYS_PRIV_SET_SYS, &(rp->r_priv)))
               != OK) {
-              panic("RS", "unable to set privilege structure", s);
+              panic("unable to set privilege structure: %d", s);
           }
       }
 
       /* Synch the privilege structure with the kernel. */
       if ((s = sys_getpriv(&(rp->r_priv), ip->endpoint)) != OK) {
-          panic("RS", "unable to synch privilege structure", s);
+          panic("unable to synch privilege structure: %d", s);
       }
 
       /*
@@ -379,7 +378,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
       /* Allow the service to run. */
       if ((s = sys_privctl(rpub->endpoint, SYS_PRIV_ALLOW, NULL)) != OK) {
-          panic("RS", "unable to initialize privileges", s);
+          panic("unable to initialize privileges: %d", s);
       }
 
       /* Initialize service. We assume every service will always get
@@ -387,7 +386,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
        */
       if(boot_image_priv->flags & SYS_PROC) {
           if ((s = init_service(rp, SEF_INIT_FRESH)) != OK) {
-              panic("RS", "unable to initialize service", s);
+              panic("unable to initialize service: %d", s);
           }
           if(rpub->sys_flags & SF_SYNCH_BOOT) {
               /* Catch init ready message now to synchronize. */
@@ -413,7 +412,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
    * with other system processes.
    */
   if ((s = getsysinfo(PM_PROC_NR, SI_PROC_TAB, mproc)) != OK) {
-      panic("RS", "unable to get copy of PM process table", s);
+      panic("unable to get copy of PM process table: %d", s);
   }
   for (i=0; boot_image_priv_table[i].endpoint != NULL_BOOT_NR; i++) {
       boot_image_priv = &boot_image_priv_table[i];
@@ -436,7 +435,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
           }
       }
       if(j == NR_PROCS) {
-          panic("RS", "unable to get pid", NO_NUM);
+          panic("unable to get pid");
       }
   }
 
@@ -448,38 +447,38 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
   if(boot_image_buffer_size > 0) {
       boot_image_buffer = rs_startup_sbrk_synch(boot_image_buffer_size);
       if(boot_image_buffer == (char *) -1) {
-          panic("RS", "unable to synch boot image buffer", NO_NUM);
+          panic("unable to synch boot image buffer");
       }
   }
 
   /* Set alarm to periodically check service status. */
   if (OK != (s=sys_setalarm(RS_DELTA_T, 0)))
-      panic("RS", "couldn't set alarm", s);
+      panic("couldn't set alarm: %d", s);
 
   /* Install signal handlers. Ask PM to transform signal into message. */
   sa.sa_handler = SIG_MESS;
   sigemptyset(&sa.sa_mask);
   sa.sa_flags = 0;
-  if (sigaction(SIGCHLD,&sa,NULL)<0) panic("RS","sigaction failed", errno);
-  if (sigaction(SIGTERM,&sa,NULL)<0) panic("RS","sigaction failed", errno);
+  if (sigaction(SIGCHLD,&sa,NULL)<0) panic("sigaction failed: %d", errno);
+  if (sigaction(SIGTERM,&sa,NULL)<0) panic("sigaction failed: %d", errno);
 
   /* Initialize the exec pipe. */
   if (pipe(exec_pipe) == -1)
-       panic("RS", "pipe failed", errno);
+       panic("pipe failed: %d", errno);
   if (fcntl(exec_pipe[0], F_SETFD,
        fcntl(exec_pipe[0], F_GETFD) | FD_CLOEXEC) == -1)
   {
-       panic("RS", "fcntl set FD_CLOEXEC on pipe input failed", errno);
+       panic("fcntl set FD_CLOEXEC on pipe input failed: %d", errno);
   }
   if (fcntl(exec_pipe[1], F_SETFD,
        fcntl(exec_pipe[1], F_GETFD) | FD_CLOEXEC) == -1)
   {
-       panic("RS", "fcntl set FD_CLOEXEC on pipe output failed", errno);
+       panic("fcntl set FD_CLOEXEC on pipe output failed: %d", errno);
   }
   if (fcntl(exec_pipe[0], F_SETFL,
        fcntl(exec_pipe[0], F_GETFL) | O_NONBLOCK) == -1)
   {
-       panic("RS", "fcntl set O_NONBLOCK on pipe input failed", errno);
+       panic("fcntl set O_NONBLOCK on pipe input failed: %d", errno);
   }
 
  /* Map out our own text and data. This is normally done in crtso.o
@@ -512,12 +511,11 @@ struct rproc *rp;
   if(boot_image_ptr == NULL) {
       boot_image_ptr = boot_image_buffer;
   }
-  s = NO_NUM;
 
   /* Get a.out header. */
   if(boot_image_buffer+boot_image_buffer_size - boot_image_ptr < sizeof(header)
       || (s = sys_getaoutheader(&header, boot_proc_idx)) != OK) {
-      panic("RS", "unable to get copy of a.out header", s);
+      panic("unable to get copy of a.out header: %d", s);
   }
   memcpy(boot_image_ptr, &header, header.a_hdrlen);
   boot_image_ptr += header.a_hdrlen;
@@ -526,7 +524,7 @@ struct rproc *rp;
   if(boot_image_buffer+boot_image_buffer_size - boot_image_ptr < header.a_text
       || (s = rs_startup_segcopy(ip->endpoint, T, D, (vir_bytes) boot_image_ptr,
       header.a_text)) != OK) {
-      panic("RS", "unable to get copy of text segment", s);
+      panic("unable to get copy of text segment: %d", s);
   }
   boot_image_ptr += header.a_text;
 
@@ -534,7 +532,7 @@ struct rproc *rp;
   if(boot_image_buffer+boot_image_buffer_size - boot_image_ptr < header.a_data
       || (s = rs_startup_segcopy(ip->endpoint, D, D, (vir_bytes) boot_image_ptr,
       header.a_data)) != OK) {
-      panic("RS", "unable to get copy of data segment", s);
+      panic("unable to get copy of data segment: %d", s);
   }
   boot_image_ptr += header.a_data;
 
@@ -568,7 +566,7 @@ struct boot_image_dev **dp;
           }
       }
       if(i == NR_BOOT_PROCS) {
-          panic("RS", "boot image table lookup failed", NO_NUM);
+          panic("boot image table lookup failed");
       }
   }
 
@@ -583,7 +581,7 @@ struct boot_image_dev **dp;
           }
       }
       if(i == NULL_BOOT_NR) {
-          panic("RS", "boot image priv table lookup failed", NO_NUM);
+          panic("boot image priv table lookup failed");
       }
   }
 
@@ -632,17 +630,17 @@ endpoint_t endpoint;
 
   /* Receive init ready message. */
   if ((r = receive(endpoint, &m)) != OK) {
-      panic("RS", "unable to receive init reply", r);
+      panic("unable to receive init reply: %d", r);
   }
   if(m.m_type != RS_INIT) {
-      panic("RS", "unexpected reply from service", m.m_source);
+      panic("unexpected reply from service: %d", m.m_source);
   }
   result = m.RS_INIT_RESULT;
   rp = rproc_ptr[_ENDPOINT_P(m.m_source)];
 
   /* Check result. */
   if(result != OK) {
-      panic("RS", "unable to complete init for service", m.m_source);
+      panic("unable to complete init for service: %d", m.m_source);
   }
 
   /* Mark the slot as no longer initializing. */
@@ -675,7 +673,7 @@ message *m_in;                              /* pointer to message */
 {
     int s;                             /* receive status */
     if (OK != (s=sef_receive(ANY, m_in)))      /* wait for message */
-        panic("RS", "sef_receive failed", s);
+        panic("sef_receive failed: %d", s);
 }
 
 /*===========================================================================*
index 6a318157f2c9d04daeeba48bce55bda6d1fc635d..01a4f256c5ce0cadff8e6dc1b120ea0c661f8ca7 100644 (file)
@@ -914,14 +914,12 @@ PUBLIC void do_exit(message *m_ptr)
                }
                if (r != sizeof(slot_nr))
                {
-                       panic("RS", "do_exit: unaligned read from exec pipe",
-                               r);
+                       panic("do_exit: unaligned read from exec pipe: %d", r);
                }
                printf("do_exit: got slot %d\n", slot_nr);
                if (slot_nr < 0 || slot_nr >= NR_SYS_PROCS)
                {
-                       panic("RS", "do_exit: bad slot number from exec pipe",
-                               slot_nr);
+                       panic("do_exit: bad slot number from exec pipe: %d", slot_nr);
                }
                rp= &rproc[slot_nr];
                rp->r_flags |= RS_EXITING;
@@ -1112,7 +1110,7 @@ message *m_ptr;
 
   /* Reschedule a synchronous alarm for the next period. */
   if (OK != (s=sys_setalarm(RS_DELTA_T, 0)))
-      panic("RS", "couldn't set alarm", s);
+      panic("couldn't set alarm: %d", s);
 }
 
 
@@ -1159,7 +1157,7 @@ endpoint_t *endpoint;
 
   switch(child_pid) {                                  /* see fork(2) */
   case -1:                                             /* fork failed */
-      report("RS", "warning, fork() failed", errno);   /* shouldn't happen */
+      printf("RS: warning, fork() failed: %d\n", errno); /* shouldn't happen */
       return(errno);                                   /* return error */
 
   case 0:                                              /* child process */
@@ -1228,7 +1226,7 @@ endpoint_t *endpoint;
        s = dev_execve(child_proc_nr_e, rp->r_exec, rp->r_exec_len, rp->r_argv,
                environ);
        if (s != OK) {
-               report("RS", "dev_execve call failed", s);
+               printf("RS: dev_execve call failed: %d\n", s);
                kill(child_pid, SIGKILL);
                rp->r_flags |= RS_EXITING;      /* don't try again */
                return(s);
@@ -1244,7 +1242,7 @@ endpoint_t *endpoint;
        /* Tell VM about allowed calls. */
        vm_mask = &rpub->vm_call_mask[0];
        if ((s = vm_set_priv(child_proc_nr_e, vm_mask)) < 0) {
-           report("RS", "vm_set_priv call failed", s);
+           printf("RS: vm_set_priv call failed: %d\n", s);
            kill(child_pid, SIGKILL);
            rp->r_flags |= RS_EXITING;
            return (s);
@@ -1254,7 +1252,7 @@ endpoint_t *endpoint;
   /* Set and synch the privilege structure for the new service. */
   if ((s = sys_privctl(child_proc_nr_e, SYS_PRIV_SET_SYS, &rp->r_priv)) != OK
       || (s = sys_getpriv(&rp->r_priv, child_proc_nr_e)) != OK) {
-      report("RS","unable to set privileges", s);
+      printf("RS: unable to set privileges: %d\n", s);
       kill(child_pid, SIGKILL);                                /* kill the service */
       rp->r_flags |= RS_EXITING;                       /* expect exit */
       return(s);                                       /* return error */
@@ -1279,7 +1277,7 @@ endpoint_t *endpoint;
    * publishing is made fully asynchronous in RS.
    */
   if ((s = sys_privctl(child_proc_nr_e, SYS_PRIV_ALLOW, NULL)) != OK) {
-      report("RS","unable to allow the service to run", s);
+      printf("RS: unable to allow the service to run: %d\n", s);
       kill(child_pid, SIGKILL);                                /* kill the service */
       rp->r_flags |= RS_EXITING;                       /* expect exit */
       return(s);                                       /* return error */
@@ -1288,7 +1286,7 @@ endpoint_t *endpoint;
   /* Initialize service. */
   init_type = rp->r_restarts > 0 ? SEF_INIT_RESTART : SEF_INIT_FRESH;
   if((s = init_service(rp, init_type)) != OK) {
-      panic("RS", "unable to initialize service", s);
+      panic("unable to initialize service: %d", s);
   }
 
   /* The purpose of non-blocking forks is to avoid involving VFS in the forking
@@ -1308,7 +1306,7 @@ endpoint_t *endpoint;
   if (rpub->dev_nr > 0) {                              /* set driver map */
       if ((s=mapdriver(rpub->label,
              rpub->dev_nr, rpub->dev_style, !!use_copy /* force */)) < 0) {
-          report("RS", "couldn't map driver (continuing)", errno);
+          printf("RS: couldn't map driver (continuing): %d\n", errno);
       }
   }
 
index ddf980e965925bce606fb0bff4643bfd2862a895..93ecb27ffa9ff5877bdfcdc453e326e18da3f8cf 100644 (file)
@@ -90,7 +90,7 @@ int flags;                    /* mode bits and flags */
   dp = &dmap[major];
   if (dp->dmap_driver == NONE) return(ENXIO);
   r = (*dp->dmap_opcl)(DEV_REOPEN, dev, filp_no, flags);
-  if (r == OK) panic(__FILE__,"OK on reopen from", dp->dmap_driver);
+  if (r == OK) panic("OK on reopen from: %d", dp->dmap_driver);
   if (r == SUSPEND) r = OK;
   return(r);
 }
@@ -158,7 +158,7 @@ PUBLIC void dev_status(message *m)
                if ((r = sendrec(m->m_source, &st)) != OK) {
                        printf("DEV_STATUS failed to %d: %d\n", m->m_source, r);
                        if (r == EDEADSRCDST) return;
-                       panic(__FILE__,"couldn't sendrec for DEV_STATUS", r);
+                       panic("couldn't sendrec for DEV_STATUS: %d", r);
                }
 
                switch(st.m_type) {
@@ -229,7 +229,7 @@ u32_t *pos_lo;
           *gid = cpf_grant_magic(driver, *io_ept, (vir_bytes) *buf, bytes,
                                  *op == DEV_READ_S ? CPF_WRITE : CPF_READ);
           if (*gid < 0)
-               panic(__FILE__, "cpf_grant_magic of buffer failed\n", NO_NUM);
+               panic("cpf_grant_magic of buffer failed");
           break;
        case VFS_DEV_GATHER:
        case VFS_DEV_SCATTER:
@@ -240,12 +240,12 @@ u32_t *pos_lo;
           *gid = cpf_grant_direct(driver, (vir_bytes) new_iovec,
                                  bytes * sizeof(iovec_t), CPF_READ|CPF_WRITE);
           if (*gid < 0) 
-               panic(__FILE__, "cpf_grant_direct of vector failed", NO_NUM);
+               panic("cpf_grant_direct of vector failed");
                        
           v = (iovec_t *) *buf;
           /* Grant access to i/o buffers. */
           for(j = 0; j < bytes; j++) {
-               if(j >= NR_IOREQS) panic(__FILE__, "vec too big", bytes);
+               if(j >= NR_IOREQS) panic("vec too big: %d", bytes);
 
                new_iovec[j].iov_addr = 
                gids[j] = 
@@ -253,7 +253,7 @@ u32_t *pos_lo;
                                 *op == DEV_GATHER_S ? CPF_WRITE : CPF_READ);
 
                if(!GRANT_VALID(gids[j])) 
-                       panic(__FILE__, "grant to iovec buf failed", NO_NUM);
+                       panic("grant to iovec buf failed");
                           
                new_iovec[j].iov_size = v[j].iov_size;
                (*vec_grants)++;
@@ -279,14 +279,14 @@ u32_t *pos_lo;
           *gid = cpf_grant_magic(driver, *io_ept, (vir_bytes) *buf, size,
                                  access);
           if (*gid < 0) 
-               panic(__FILE__, "cpf_grant_magic failed (ioctl)\n", NO_NUM);
+               panic("cpf_grant_magic failed (ioctl)");
                        
           break;
        case VFS_DEV_SELECT:
           *op = DEV_SELECT;
           break;
        default:
-          panic(__FILE__,"safe_io_conversion: unknown operation", *op);
+          panic("safe_io_conversion: unknown operation: %d", *op);
   }
 
   /* If we have converted to a safe operation, I/O
@@ -380,7 +380,7 @@ int suspend_reopen;         /* Just suspend the process */
                            &vec_grants, bytes, &pos_lo);
 
   if(buf != buf_used)
-       panic(__FILE__,"dev_io: safe_io_conversion changed buffer", NO_NUM);
+       panic("dev_io: safe_io_conversion changed buffer");
 
   /* If the safe conversion was done, set the ADDRESS to
    * the grant id.
@@ -409,10 +409,10 @@ int suspend_reopen;               /* Just suspend the process */
 
   /* Task has completed.  See if call completed. */
   if (dev_mess.REP_STATUS == SUSPEND) {
-       if(vec_grants > 0) panic(__FILE__,"SUSPEND on vectored i/o", NO_NUM);
+       if(vec_grants > 0) panic("SUSPEND on vectored i/o");
        
        /* fp is uninitialized at init time. */
-       if(!fp) panic(__FILE__,"SUSPEND on NULL fp", NO_NUM);
+       if(!fp) panic("SUSPEND on NULL fp");
 
        if ((flags & O_NONBLOCK) && !dp->dmap_async_driver) {
                /* Not supposed to block. */
@@ -626,7 +626,7 @@ message *mess_ptr;          /* pointer to message for task */
                printf("fs: ELOCKED talking to %d\n", task_nr);
                return(r);
        }
-       panic(__FILE__,"call_task: can't send/receive", r);
+       panic("call_task: can't send/receive: %d", r);
   }
 
   /* Did the process we did the sendrec() for get a result? */
@@ -655,7 +655,7 @@ message *mess_ptr;          /* pointer to message for task */
   int r;
 
   r = asynsend(task_nr, mess_ptr);
-  if (r != OK) panic(__FILE__, "asyn_io: asynsend failed", r);
+  if (r != OK) panic("asyn_io: asynsend failed: %d", r);
 
   /* Fake a SUSPEND */
   mess_ptr->REP_STATUS = SUSPEND;
@@ -868,7 +868,7 @@ PUBLIC void dev_up(int maj)
        fd_nr = (rfp->fp_fd >> 8);
        fp = rfp->fp_filp[fd_nr];
        vp = fp->filp_vno;
-       if (!vp) panic(__FILE__, "restart_reopen: no vp", NO_NUM);
+       if (!vp) panic("restart_reopen: no vp");
        if ((vp->v_mode &  I_TYPE) != I_CHAR_SPECIAL) continue;
        if (((vp->v_sdev >> MAJOR) & BYTE) != maj) continue;
 
@@ -971,7 +971,7 @@ int maj;
        }
 
        vp = fp->filp_vno;
-       if (!vp) panic(__FILE__, "restart_reopen: no vp", NO_NUM);
+       if (!vp) panic("restart_reopen: no vp");
        if ((vp->v_mode &  I_TYPE) != I_CHAR_SPECIAL) continue;
        if (((vp->v_sdev >> MAJOR) & BYTE) != maj) continue;
 
@@ -1089,7 +1089,7 @@ message *mp;
                /* Tell the kernel to stop processing */
                r= senda(NULL, 0);
                if (r != OK)
-                       panic(__FILE__, "asynsend: senda failed", r);
+                       panic("asynsend: senda failed: %d", r);
 
                dst_ind= 0;
                for (src_ind= first_slot; src_ind<next_slot; src_ind++)
@@ -1120,7 +1120,7 @@ message *mp;
                first_slot= 0;
                next_slot= dst_ind;
                if (next_slot >= ASYN_NR)
-                       panic(__FILE__, "asynsend: msgtable full", NO_NUM);
+                       panic("asynsend: msgtable full");
        }
 
        msgtable[next_slot].dst= dst;
index 645f8197ed768fa584091e02f6575efe1e7e2fba..120e624c30705365face23f28e6b12d8cb36498a 100644 (file)
@@ -180,7 +180,7 @@ int force;
   if (label != NULL) {
        len= strlen(label);
        if (len+1 > sizeof(dp->dmap_label))
-               panic(__FILE__, "map_driver: label too long", len);
+               panic("map_driver: label too long: %d", len);
        strcpy(dp->dmap_label, label);
   }
 
index 9bd2058ace4751c704422d47e4aefeceaa74f97b..13695de2d45c02df82689080e789a74987299799 100644 (file)
@@ -12,7 +12,7 @@
        if(!check_vrefs() || !check_pipe()) {                           \
           printf("VFS:%s:%d: call_nr %d who_e %d\n", \
                        __FILE__, __LINE__, call_nr, who_e);    \
-          panic(__FILE__, "sanity check failed", NO_NUM);      \
+          panic("sanity check failed");        \
        }                                                       \
 } while(0)
 #else
index 9550585a7e1dcc41ccef9b08372bd1e4229b974f..9ba3fe7eccf1c23ef672991966948472d7a61643 100644 (file)
@@ -76,7 +76,7 @@ PRIVATE void pop_globals()
  */
 
   if (depth == 0)
-       panic("VFS", "Popping from empty globals stack!", NO_NUM);
+       panic("Popping from empty globals stack!");
 
   depth--;
 
index 56da0b00438f002d4b6b098e139bcec7755cd5f8..1ce265863c72368259333a60c336d9d26620ecf9 100644 (file)
@@ -52,7 +52,7 @@ int req;                      /* either F_SETLK or F_SETLKW */
        case SEEK_SET:  first = 0; break;
        case SEEK_CUR:
           if (ex64hi(f->filp_pos) != 0) 
-               panic(__FILE__, "lock_op: position in file too high", NO_NUM);
+               panic("lock_op: position in file too high");
           first = ex64lo(f->filp_pos);
           break;
        case SEEK_END:  first = f->filp_vno->v_size; break;
index c984c2c4ab3e02315b522cae02a5d7a16e2365fd..0a47eb88a03ee4c9c57b982f3f2bebe8ff9cd611 100644 (file)
@@ -141,7 +141,7 @@ PUBLIC int main(void)
        if(fp_is_blocked(fp)) {
                printf("VFS: requester %d call %d: suspended\n",
                        who_e, call_nr);
-               panic(__FILE__, "requester suspended", NO_NUM);
+               panic("requester suspended");
        }
 #endif
 
@@ -229,10 +229,10 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
    */
   do {
        if (OK != (s=sef_receive(PM_PROC_NR, &mess)))
-               panic(__FILE__,"FS couldn't receive from PM", s);
+               panic("FS couldn't receive from PM: %d", s);
 
        if (mess.m_type != PM_INIT)
-               panic(__FILE__, "unexpected message from PM", mess.m_type);
+               panic("unexpected message from PM: %d", mess.m_type);
 
        if (NONE == mess.PM_PROC) break; 
 
@@ -256,7 +256,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
    * Certain relations must hold for the file system to work at all. Some 
    * extra block_size requirements are checked at super-block-read-in time.
    */
-  if (OPEN_MAX > 127) panic(__FILE__,"OPEN_MAX > 127", NO_NUM);
+  if (OPEN_MAX > 127) panic("OPEN_MAX > 127");
   
   /* The following initializations are needed to let dev_opcl succeed .*/
   fp = (struct fproc *) NULL;
@@ -269,7 +269,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
   vmp = &vmnt[0];              /* Should be the root filesystem */
   if (vmp->m_dev == NO_DEV)
-       panic(__FILE__, "vfs: no root filesystem", NO_NUM);
+       panic("vfs: no root filesystem");
   root_vp= vmp->m_root_node;
 
   /* The root device can now be accessed; set process directories. */
@@ -349,14 +349,14 @@ PRIVATE void get_work()
                        return;
                }
        if (!found_one)
-               panic(__FILE__,"get_work couldn't revive anyone", NO_NUM);
+               panic("get_work couldn't revive anyone");
   }
 
   for(;;) {
     int r;
     /* Normal case.  No one to revive. */
     if ((r=sef_receive(ANY, &m_in)) != OK)
-       panic(__FILE__,"fs sef_receive error", r);
+       panic("fs sef_receive error: %d", r);
     who_e = m_in.m_source;
     who_p = _ENDPOINT_P(who_e);
 
@@ -365,7 +365,7 @@ PRIVATE void get_work()
      * (kernel tasks) are treated in a special way
      */
     if(who_p >= (int)(sizeof(fproc) / sizeof(struct fproc)))
-       panic(__FILE__,"receive process out of range", who_p);
+       panic("receive process out of range: %d", who_p);
     if(who_p >= 0 && fproc[who_p].fp_endpoint == NONE) {
        printf("FS: ignoring request from %d, endpointless slot %d (%d)\n",
                m_in.m_source, who_p, m_in.m_type);
@@ -378,7 +378,7 @@ PRIVATE void get_work()
        printf("FS: receive endpoint inconsistent (source %d, who_p %d, stored ep %d, who_e %d).\n",
                m_in.m_source, who_p, fproc[who_p].fp_endpoint, who_e);
 #if 0
-       panic(__FILE__, "FS: inconsistent endpoint ", NO_NUM);
+       panic("FS: inconsistent endpoint ");
 #endif
        continue;
     }
@@ -432,12 +432,12 @@ PRIVATE void init_root()
          if (sef_receive(ROOT_FS_E, &m) != OK) {
                  printf("VFS: Error receiving login request from FS_e %d\n", 
                                  ROOT_FS_E);
-                 panic(__FILE__, "Error receiving login request from root filesystem\n", ROOT_FS_E);
+                 panic("Error receiving login request from root filesystem: %d", ROOT_FS_E);
          }
          if (m.m_type != FS_READY) {
                  printf("VFS: Invalid login request from FS_e %d\n", 
                                  ROOT_FS_E);
-                 panic(__FILE__, "Error receiving login request from root filesystem\n", ROOT_FS_E);
+                 panic("Error receiving login request from root filesystem: %d", ROOT_FS_E);
          }
   }
   last_login_fs_e = NONE;
@@ -450,26 +450,26 @@ PRIVATE void init_root()
  
   /* We'll need a vnode for the root inode, check whether there is one */
   if ((root_node = get_free_vnode()) == NIL_VNODE) 
-       panic(__FILE__,"Cannot get free vnode", r);
+       panic("Cannot get free vnode: %d", r);
 
   
   /* Get driver process' endpoint */  
   dp = &dmap[(root_dev >> MAJOR) & BYTE];
   if (dp->dmap_driver == NONE) {
-       panic(__FILE__,"No driver for root device", r);
+       panic("No driver for root device: %d", r);
   }
 
   label= dp->dmap_label;
   if (strlen(label) == 0)
   {
-       panic(__FILE__, "vfs:init_root: no label for major", root_dev >> MAJOR);
+       panic("vfs:init_root: no label for major: %d", root_dev >> MAJOR);
   }
 
   /* Issue request */
   r = req_readsuper(ROOT_FS_E, label, root_dev, 0 /*!readonly*/,
        1 /*isroot*/, &res);
   if (r != OK) {
-      panic(__FILE__,"Cannot read superblock from root", r);
+      panic("Cannot read superblock from root: %d", r);
   }
   
   /* Fill in root node's fields */
@@ -599,7 +599,7 @@ PRIVATE void service_pm()
 
   r = send(PM_PROC_NR, &m_out);
   if (r != OK)
-       panic(__FILE__, "service_pm: send failed", r);
+       panic("service_pm: send failed: %d", r);
 
 }
 
index 529610ae4cb4af35a4c3cc799653c0ff5ff40bda..2e33d7baf2989b68a31494db4a63cd9e8ea784a7 100644 (file)
@@ -223,9 +223,7 @@ PUBLIC int do_fcntl()
           case SEEK_SET: start = 0; break;
           case SEEK_CUR:
              if (ex64hi(f->filp_pos) != 0) 
-                       panic(__FILE__, "do_fcntl: position in file too high",
-                                       NO_NUM);
-               
+                       panic("do_fcntl: position in file too high");
              start = ex64lo(f->filp_pos);
              break;
           case SEEK_END: start = f->filp_vno->v_size; break;
@@ -366,9 +364,9 @@ int cpid;   /* Child process id */
    */
   childno = _ENDPOINT_P(cproc);
   if(childno < 0 || childno >= NR_PROCS)
-       panic(__FILE__, "FS: bogus child for forking", m_in.child_endpt);
+       panic("FS: bogus child for forking: %d", m_in.child_endpt);
   if(fproc[childno].fp_pid != PID_FREE)
-       panic(__FILE__, "FS: forking on top of in-use child", childno);
+       panic("FS: forking on top of in-use child: %d", childno);
 
   /* Copy the parent's fproc struct to the child. */
   fproc[childno] = fproc[parentno];
@@ -389,11 +387,11 @@ int cpid; /* Child process id */
    */
   if(GRANT_VALID(fp->fp_grant)) {
        printf("vfs: fork: fp (endpoint %d) has grant %d\n", fp->fp_endpoint, fp->fp_grant);
-       panic(__FILE__, "fp contains valid grant", NO_NUM);
+       panic("fp contains valid grant");
   }
   if(GRANT_VALID(cp->fp_grant)) {
        printf("vfs: fork: cp (endpoint %d) has grant %d\n", cp->fp_endpoint, cp->fp_grant);
-       panic(__FILE__, "cp contains valid grant", NO_NUM);
+       panic("cp contains valid grant");
   }
 
   /* A child is not a process leader. */
@@ -423,7 +421,7 @@ PRIVATE void free_proc(struct fproc *exiter, int flags)
   fp = exiter;         /* get_filp() needs 'fp' */
 
   if(fp->fp_endpoint == NONE) {
-       panic(__FILE__, "free_proc: already free", NO_NUM);
+       panic("free_proc: already free");
   }
 
   if (fp_is_blocked(fp)) {
@@ -540,12 +538,12 @@ gid_t *groups;
   okendpt(proc_e, &slot);
   rfp = &fproc[slot];
   if (ngroups * sizeof(gid_t) > sizeof(rfp->fp_sgroups))
-       panic(__FILE__, "VFS: pm_setgroups: too much data to copy\n", NO_NUM);
+       panic("VFS: pm_setgroups: too much data to copy");
   if(sys_datacopy(who_e, (vir_bytes) groups, SELF, (vir_bytes) rfp->fp_sgroups,
                   ngroups * sizeof(gid_t)) == OK) {
        rfp->fp_ngroups = ngroups;
   } else
-       panic(__FILE__, "VFS: pm_setgroups: datacopy failed\n", NO_NUM);
+       panic("VFS: pm_setgroups: datacopy failed");
 }
 
 
index da8627899cf27974662594fc0391ac13bd9ef7b5..eb2434c1b6026125a5be90510d837a054ebe8d58 100644 (file)
@@ -279,8 +279,7 @@ PRIVATE int mount_fs(endpoint_t fs_e)
 
        label = dp->dmap_label;
        if (strlen(label) == 0)
-               panic(__FILE__, "VFS mount_fs: no label for major",
-                       dev >> MAJOR);
+               panic("VFS mount_fs: no label for major: 0x%x", dev >> MAJOR);
   }
 
   /* Tell FS which device to mount */
@@ -415,7 +414,7 @@ char *label;                                /* buffer to retrieve label, or NULL */
   /* Find vmnt that is to be unmounted */
   for(vmp_i = &vmnt[0]; vmp_i < &vmnt[NR_MNTS]; ++vmp_i) {
          if (vmp_i->m_dev == dev) {
-                 if(vmp) panic(__FILE__,"device mounted more than once", dev);
+                 if(vmp) panic("device mounted more than once: %d", dev);
                  vmp = vmp_i;
          }
   }
@@ -441,7 +440,7 @@ char *label;                                /* buffer to retrieve label, or NULL */
 
   /* Tell FS to unmount */
   if(vmp->m_fs_e <= 0 || vmp->m_fs_e == NONE)
-       panic(__FILE__, "unmount: strange fs endpoint", vmp->m_fs_e);
+       panic("unmount: strange fs endpoint: %d", vmp->m_fs_e);
 
   if ((r = req_unmount(vmp->m_fs_e)) != OK)              /* Not recoverable. */
        printf("VFS: ignoring failed umount attempt (%d)\n", r);
index 3c36ad1e89761b330857f4d4d71509faa52c8df7..d6a1f5580ffde812a3023da3ed3c1324a370e0eb 100644 (file)
@@ -69,7 +69,7 @@ int flags;
   new_vp->v_sdev = res.dev;
   
   if( (vmp = find_vmnt(new_vp->v_fs_e)) == NIL_VMNT)
-         panic(__FILE__, "VFS advance: vmnt not found", NO_NUM);
+         panic("VFS advance: vmnt not found");
 
   new_vp->v_vmnt = vmp; 
   new_vp->v_dev = vmp->m_dev;
@@ -248,17 +248,14 @@ node_details_t *node;
                }
 
                if (!dir_vp) {
-                       panic(__FILE__,
-                             "VFS lookup: can't find mounted partition",
-                             NO_NUM);
+                       panic("VFS lookup: can't find mounted partition");
                }
        } else {
                /* Climbing up mount */
                /* Find the vmnt that represents the partition on
                 * which we "climb up". */
                if ((vmp = find_vmnt(res.fs_e)) == NIL_VMNT) {
-                       panic(__FILE__,
-                             "VFS lookup: can't find parent vmnt",NO_NUM);
+                       panic("VFS lookup: can't find parent vmnt");
                }         
 
                /* Make sure that the child FS does not feed a bogus path
index fc52a90e23dbbbda25cf7fb9d403dcd9c56bdf23..1a152197684a74374a341b791d118df5f35897e6 100644 (file)
@@ -157,7 +157,7 @@ int notouch;                        /* check only */
   int r = OK;
 
   if (ex64hi(position) != 0)
-       panic(__FILE__, "pipe_check: position too large in pipe", NO_NUM);
+       panic("pipe_check: position too large in pipe");
   pos = ex64lo(position);
 
   /* If reading, check for empty pipe. */
@@ -252,13 +252,13 @@ PUBLIC void suspend(int why)
 
 #if DO_SANITYCHECKS
   if (why == FP_BLOCKED_ON_PIPE)
-       panic(__FILE__, "suspend: called for FP_BLOCKED_ON_PIPE", NO_NUM);
+       panic("suspend: called for FP_BLOCKED_ON_PIPE");
 
   if(fp_is_blocked(fp))
-       panic(__FILE__, "suspend: called for suspended process", NO_NUM);
+       panic("suspend: called for suspended process");
   
   if(why == FP_BLOCKED_ON_NONE)
-       panic(__FILE__, "suspend: called for FP_BLOCKED_ON_NONE", NO_NUM);
+       panic("suspend: called for FP_BLOCKED_ON_NONE");
 #endif
 
   if (why == FP_BLOCKED_ON_POPEN)
@@ -287,7 +287,7 @@ PUBLIC void suspend(int why)
 PUBLIC void wait_for(endpoint_t who)
 {
   if(who == NONE || who == ANY)
-       panic(__FILE__,"suspend on NONE or ANY",NO_NUM);
+       panic("suspend on NONE or ANY");
   suspend(FP_BLOCKED_ON_OTHER);
   fp->fp_task = who;
 }
@@ -310,7 +310,7 @@ size_t size;
  */
 #if DO_SANITYCHECKS
   if(fp_is_blocked(fp))
-       panic(__FILE__, "pipe_suspend: called for suspended process", NO_NUM);
+       panic("pipe_suspend: called for suspended process");
 #endif
 
   susp_count++;                                        /* #procs susp'ed on pipe*/
@@ -389,7 +389,7 @@ int count;                  /* max number of processes to release */
                revive(rp->fp_endpoint, 0);
                susp_count--;   /* keep track of who is suspended */
                if(susp_count < 0)
-                       panic("vfs", "susp_count now negative", susp_count);
+                       panic("susp_count now negative: %d", susp_count);
                if (--count == 0) return;
        }
   }
@@ -434,7 +434,7 @@ int returned;                       /* if hanging on task, how many bytes read */
                rfp->fp_filp[fd_nr] = NIL_FILP;
                FD_CLR(fd_nr, &rfp->fp_filp_inuse);
                if (fil_ptr->filp_count != 1) {
-                       panic(__FILE__, "revive: bad count in filp",
+                       panic("revive: bad count in filp: %d",
                                fil_ptr->filp_count);
                }
                fil_ptr->filp_count = 0;
@@ -460,7 +460,7 @@ int returned;                       /* if hanging on task, how many bytes read */
                 */
                if(GRANT_VALID(rfp->fp_grant)) {
                        if(cpf_revoke(rfp->fp_grant)) {
-                               panic(__FILE__,"FS: revoke failed for grant",
+                               panic("FS: revoke failed for grant: %d",
                                        rfp->fp_grant);
                        } 
                        rfp->fp_grant = GRANT_INVALID;
@@ -533,7 +533,7 @@ int proc_nr_e;
                
                fild = (rfp->fp_fd >> 8) & BYTE;/* extract file descriptor */
                if (fild < 0 || fild >= OPEN_MAX)
-                       panic(__FILE__,"unpause err 2",NO_NUM);
+                       panic("unpause err 2");
                f = rfp->fp_filp[fild];
                dev = (dev_t) f->filp_vno->v_sdev;      /* device hung on */
                mess.TTY_LINE = (dev >> MINOR) & BYTE;
@@ -554,14 +554,14 @@ int proc_nr_e;
                if(status == EAGAIN) status = EINTR;
                if(GRANT_VALID(rfp->fp_grant)) {
                        if(cpf_revoke(rfp->fp_grant)) {
-                               panic(__FILE__,"FS: revoke failed for grant (cancel)",
+                               panic("FS: revoke failed for grant (cancel): %d",
                                        rfp->fp_grant);
                        } 
                        rfp->fp_grant = GRANT_INVALID;
                }
                break;
        default :
-               panic(__FILE__,"FS: unknown value", blocked_on);
+               panic("FS: unknown value: %d", blocked_on);
   }
 
   rfp->fp_blocked_on = FP_BLOCKED_ON_NONE;
index 2145379b06f4e2e4597e42bf47575be1d007f923..9983ba149a4c5fe33aaa9f3d2fb031454b9f2026 100644 (file)
@@ -230,7 +230,6 @@ _PROTOTYPE( long conv4, (int norm, long x)                          );
 _PROTOTYPE( int fetch_name, (char *path, int len, int flag)            );
 _PROTOTYPE( int no_sys, (void)                                         );
 _PROTOTYPE( int isokendpt_f, (char *f, int l, int e, int *p, int ft));
-_PROTOTYPE( void panic, (char *who, char *mess, int num)               );
 
 #define okendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 1)
 #define isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
index 8ced3201cd771473d1dd9794672a26389e461e93..fb82dcd62d5fc904fe4ec5041fc4bd0ad6571d4a 100644 (file)
@@ -69,8 +69,7 @@ int rw_flag;                  /* READING or WRITING */
 
   if (vp->v_pipe == I_PIPE) {
        if (fp->fp_cum_io_partial != 0) {
-               panic(__FILE__, "read_write: fp_cum_io_partial not clear",
-                     NO_NUM);
+               panic("read_write: fp_cum_io_partial not clear");
        }
        return rw_pipe(rw_flag, who_e, m_in.fd, f, m_in.buffer, m_in.nbytes);
   }
@@ -81,15 +80,12 @@ int rw_flag;                        /* READING or WRITING */
 
   if ((char_spec = (mode_word == I_CHAR_SPECIAL ? 1 : 0))) {
        if (vp->v_sdev == NO_DEV)
-               panic(__FILE__, "read_write tries to read from "
-                               "character device NO_DEV", NO_NUM);
-
+               panic("read_write tries to read from character device NO_DEV");
   }
 
   if ((block_spec = (mode_word == I_BLOCK_SPECIAL ? 1 : 0))) {
        if (vp->v_sdev == NO_DEV)
-               panic(__FILE__, "read_write tries to read from "
-                               " block device NO_DEV", NO_NUM);
+               panic("read_write tries to read from block device NO_DEV");
   }
 
   if (char_spec) {                     /* Character special files. */
@@ -123,7 +119,7 @@ int rw_flag;                        /* READING or WRITING */
 
        if (r >= 0) {
                if (ex64hi(new_pos))
-                       panic(__FILE__, "read_write: bad new pos", NO_NUM);
+                       panic("read_write: bad new pos");
 
                position = new_pos;
                cum_io += cum_io_incr;
@@ -135,8 +131,7 @@ int rw_flag;                        /* READING or WRITING */
        if (regular || mode_word == I_DIRECTORY) {
                if (cmp64ul(position, vp->v_size) > 0) {
                        if (ex64hi(position) != 0) {
-                               panic(__FILE__,
-                                     "read_write: file size too big ", NO_NUM);
+                               panic("read_write: file size too big ");
                        }
                        vp->v_size = ex64lo(position);
                }
@@ -172,7 +167,7 @@ PUBLIC int do_getdents()
        return(EBADF);
 
   if (ex64hi(rfilp->filp_pos) != 0)
-       panic(__FILE__, "do_getdents: should handle large offsets", NO_NUM);
+       panic("do_getdents: should handle large offsets");
        
   r = req_getdents(rfilp->filp_vno->v_fs_e, rfilp->filp_vno->v_inode_nr, 
                   rfilp->filp_pos, m_in.buffer, m_in.nbytes, &new_pos);
@@ -229,14 +224,14 @@ size_t req_size;
   }
 
   if (vp->v_mapfs_e == 0) 
-       panic(__FILE__, "unmapped pipe", NO_NUM);
+       panic("unmapped pipe");
 
   r = req_readwrite(vp->v_mapfs_e, vp->v_mapinode_nr, position, rw_flag, usr_e,
                    buf, size, &new_pos, &cum_io_incr);
 
   if (r >= 0) {
        if (ex64hi(new_pos))
-               panic(__FILE__, "rw_pipe: bad new pos", NO_NUM);
+               panic("rw_pipe: bad new pos");
 
        position = new_pos;
        cum_io += cum_io_incr;
@@ -248,9 +243,7 @@ size_t req_size;
   if (rw_flag == WRITING) {
        if (cmp64ul(position, vp->v_size) > 0) {
                if (ex64hi(position) != 0) {
-                       panic(__FILE__,
-                             "read_write: file size too big for v_size",
-                             NO_NUM);
+                       panic("read_write: file size too big for v_size");
                }
                vp->v_size = ex64lo(position);
        }
index 88a01954f091236d70111e1a3a78822174f04ca9..ef5f4aeabbb2d48424794fc1b1708baa6e69d493 100644 (file)
@@ -53,7 +53,7 @@ unsigned int *cum_iop;
   grant_id = cpf_grant_magic(fs_e, user_e, (vir_bytes) user_addr, num_of_bytes,
                        (rw_flag == READING ? CPF_WRITE : CPF_READ));
   if(grant_id == -1)
-         panic(__FILE__, "req_breadwrite: cpf_grant_magic failed", NO_NUM);
+         panic("req_breadwrite: cpf_grant_magic failed");
 
   /* Fill in request message */
   m.m_type = rw_flag == READING ? REQ_BREAD : REQ_BWRITE;
@@ -150,12 +150,12 @@ node_details_t *res;
   message m;
 
   if (path[0] == '/')
-       panic(__FILE__, "req_create: filename starts with '/'", NO_NUM);
+       panic("req_create: filename starts with '/'");
 
   len = strlen(path) + 1;
   grant_id = cpf_grant_direct(fs_e, (vir_bytes) path, len, CPF_READ);
   if (grant_id == -1)
-       panic(__FILE__, "req_create: cpf_grant_direct failed", NO_NUM);
+       panic("req_create: cpf_grant_direct failed");
 
   /* Fill in request message */
   m.m_type     = REQ_CREATE;
@@ -217,7 +217,7 @@ char *buf;
   grant_id = cpf_grant_magic(fs_e, who_e, (vir_bytes) buf, sizeof(struct statfs),
                        CPF_WRITE);
   if(grant_id == -1) 
-         panic(__FILE__, "req_fstatfs: cpf_grant_magic failed", NO_NUM);
+         panic("req_fstatfs: cpf_grant_magic failed");
 
   /* Fill in request message */
   m.m_type = REQ_FSTATFS;
@@ -272,7 +272,7 @@ u64_t *new_pos;
   
   grant_id = cpf_grant_magic(fs_e, who_e, (vir_bytes) buf, size, CPF_WRITE);
   if (grant_id < 0)
-       panic(__FILE__, "req_getdents: cpf_grant_magic failed", grant_id);
+       panic("req_getdents: cpf_grant_magic failed: %d", grant_id);
 
   m.m_type = REQ_GETDENTS;
   m.REQ_INODE_NR = inode_nr;
@@ -328,7 +328,7 @@ ino_t linked_file;
   len = strlen(lastc) + 1;
   grant_id = cpf_grant_direct(fs_e, (vir_bytes)lastc, len, CPF_READ);
   if(grant_id == -1)
-         panic(__FILE__, "req_link: cpf_grant_direct failed", NO_NUM);
+         panic("req_link: cpf_grant_direct failed");
 
   /* Fill in request message */
   m.m_type = REQ_LINK;
@@ -366,7 +366,7 @@ lookup_res_t *res;
   grant_id = cpf_grant_direct(fs_e, (vir_bytes) user_fullpath,
                              sizeof(user_fullpath), CPF_READ | CPF_WRITE);
   if(grant_id == -1)
-         panic(__FILE__, "req_lookup: cpf_grant_direct failed", NO_NUM);
+         panic("req_lookup: cpf_grant_direct failed");
 
   len = strlen(user_fullpath) + 1;
 
@@ -391,7 +391,7 @@ lookup_res_t *res;
        grant_id2 = cpf_grant_direct(fs_e, (vir_bytes) &credentials,
                                     sizeof(credentials), CPF_READ);
        if(grant_id2 == -1)
-               panic(__FILE__, "req_lookup: cpf_grant_direct failed", NO_NUM);
+               panic("req_lookup: cpf_grant_direct failed");
 
        m.REQ_GRANT2    = grant_id2;
        m.REQ_UCRED_SIZE= sizeof(credentials);
@@ -462,7 +462,7 @@ mode_t dmode;
   len = strlen(lastc) + 1;
   grant_id = cpf_grant_direct(fs_e, (vir_bytes)lastc, len, CPF_READ);
   if(grant_id == -1)
-         panic(__FILE__, "req_mkdir: cpf_grant_direct failed", NO_NUM);
+         panic("req_mkdir: cpf_grant_direct failed");
 
   /* Fill in request message */
   m.m_type = REQ_MKDIR;
@@ -501,7 +501,7 @@ dev_t dev;
   len = strlen(lastc) + 1;
   grant_id = cpf_grant_direct(fs_e, (vir_bytes)lastc, len, CPF_READ);
   if(grant_id == -1)
-         panic(__FILE__, "req_mknod: cpf_grant_direct failed", NO_NUM);
+         panic("req_mknod: cpf_grant_direct failed");
 
   /* Fill in request message */
   m.m_type = REQ_MKNOD;
@@ -646,7 +646,7 @@ size_t len;
 
   grant_id = cpf_grant_magic(fs_e, who_e, (vir_bytes) buf, len, CPF_WRITE);
   if(grant_id == -1)
-         panic(__FILE__, "req_rdlink: cpf_grant_magic failed", NO_NUM);
+         panic("req_rdlink: cpf_grant_magic failed");
 
   /* Fill in request message */
   m.m_type = REQ_RDLINK;
@@ -683,7 +683,7 @@ struct node_details *res_nodep;
   len = strlen(label)+1;
   grant_id = cpf_grant_direct(fs_e, (vir_bytes) label, len, CPF_READ);
   if (grant_id == -1)
-         panic(__FILE__, "req_readsuper: cpf_grant_direct failed", NO_NUM);
+         panic("req_readsuper: cpf_grant_direct failed");
 
   /* Fill in request message */
   m.m_type = REQ_READSUPER;
@@ -732,12 +732,12 @@ unsigned int *cum_iop;
   message m;
 
   if (ex64hi(pos) != 0)
-         panic(__FILE__, "req_readwrite: pos too large", NO_NUM);
+         panic("req_readwrite: pos too large");
 
   grant_id = cpf_grant_magic(fs_e, user_e, (vir_bytes) user_addr, num_of_bytes,
                             (rw_flag==READING ? CPF_WRITE:CPF_READ));
   if (grant_id == -1)
-         panic(__FILE__, "req_readwrite: cpf_grant_magic failed", NO_NUM);
+         panic("req_readwrite: cpf_grant_magic failed");
 
   /* Fill in request message */
   m.m_type = rw_flag == READING ? REQ_READ : REQ_WRITE;
@@ -779,12 +779,12 @@ char *new_name;
   len_old = strlen(old_name) + 1;
   gid_old = cpf_grant_direct(fs_e, (vir_bytes) old_name, len_old, CPF_READ);
   if(gid_old == -1)
-         panic(__FILE__, "req_rename: cpf_grant_direct failed", NO_NUM);
+         panic("req_rename: cpf_grant_direct failed");
 
   len_new = strlen(new_name) + 1;
   gid_new = cpf_grant_direct(fs_e, (vir_bytes) new_name, len_new, CPF_READ);
   if(gid_new == -1)
-         panic(__FILE__, "req_rename: cpf_grant_direct failed", NO_NUM);
+         panic("req_rename: cpf_grant_direct failed");
 
   /* Fill in request message */
   m.m_type = REQ_RENAME;
@@ -820,7 +820,7 @@ char *lastc;
   len = strlen(lastc) + 1;
   grant_id = cpf_grant_direct(fs_e, (vir_bytes) lastc, len, CPF_READ);
   if(grant_id == -1)
-         panic(__FILE__, "req_rmdir: cpf_grant_direct failed", NO_NUM);
+         panic("req_rmdir: cpf_grant_direct failed");
 
   /* Fill in request message */
   m.m_type = REQ_RMDIR;
@@ -858,13 +858,13 @@ gid_t gid;
   len = strlen(lastc) + 1;
   gid_name = cpf_grant_direct(fs_e, (vir_bytes) lastc, len, CPF_READ);
   if(gid_name == -1)
-         panic(__FILE__, "req_slink: cpf_grant_direct failed", NO_NUM);
+         panic("req_slink: cpf_grant_direct failed");
 
   gid_buf = cpf_grant_magic(fs_e, who_e, (vir_bytes) path_addr, path_length,
                            CPF_READ);
   if(gid_buf == -1) {
          cpf_revoke(gid_name);
-         panic(__FILE__, "req_slink: cpf_grant_magic failed", NO_NUM);
+         panic("req_slink: cpf_grant_magic failed");
   }
 
   /* Fill in request message */
@@ -909,7 +909,7 @@ int pos;
                                sizeof(struct stat), CPF_WRITE);
 
   if (grant_id < 0)
-       panic(__FILE__, "req_stat: cpf_grant_* failed", NO_NUM);
+       panic("req_stat: cpf_grant_* failed");
 
   /* Fill in request message */
   m.m_type = REQ_STAT;
@@ -962,7 +962,7 @@ char *lastc;
   len = strlen(lastc) + 1;
   grant_id = cpf_grant_direct(fs_e, (vir_bytes) lastc, len, CPF_READ);
   if(grant_id == -1)
-         panic(__FILE__, "req_unlink: cpf_grant_direct failed", NO_NUM);
+         panic("req_unlink: cpf_grant_direct failed");
 
   /* Fill in request message */
   m.m_type = REQ_UNLINK;
@@ -1030,7 +1030,7 @@ PRIVATE int fs_sendrec_f(char *file, int line, endpoint_t fs_e, message *reqm)
   struct vmnt *vmp;
 
   if(fs_e <= 0 || fs_e == NONE)
-       panic(__FILE__, "talking to bogus endpoint", fs_e);
+       panic("talking to bogus endpoint: %d", fs_e);
 
   /* Make a copy of the request so that we can load it back in
    * case of a dead driver */
@@ -1094,7 +1094,7 @@ PRIVATE int fs_sendrec_f(char *file, int line, endpoint_t fs_e, message *reqm)
          
           /* No FS ?? */
           if (old_driver_e == NONE)
-              panic(__FILE__, "VFSdead_driver: couldn't find FS\n", fs_e);
+              panic("VFSdead_driver: couldn't find FS: %d", fs_e);
 
           /* Wait for a new driver. */
           for (;;) {
@@ -1102,8 +1102,7 @@ PRIVATE int fs_sendrec_f(char *file, int line, endpoint_t fs_e, message *reqm)
               printf("VFSdead_driver: waiting for new driver\n");
               r = sef_receive(RS_PROC_NR, &m);
               if (r != OK) {
-                  panic(__FILE__, "VFSdead_driver: unable to receive from RS", 
-                                 r);
+                       panic("VFSdead_driver: unable to receive from RS: %d",  r);
               }
               if (m.m_type == DEVCTL) {
                   /* Map new driver */
@@ -1116,13 +1115,11 @@ PRIVATE int fs_sendrec_f(char *file, int line, endpoint_t fs_e, message *reqm)
                   }
               }
               else {
-                  panic(__FILE__, "VFSdead_driver: got message from RS, type", 
-                          m.m_type);
+                       panic("VFSdead_driver: got message from RS type: %d", m.m_type);
               }
               m.m_type = r;
               if ((r = send(RS_PROC_NR, &m)) != OK) {
-                  panic(__FILE__, "VFSdead_driver: unable to send to RS",
-                          r);
+                       panic("VFSdead_driver: unable to send to RS: %d", r);
               }
               /* New driver is ready */
               if (new_driver_e) break;
@@ -1134,7 +1131,7 @@ PRIVATE int fs_sendrec_f(char *file, int line, endpoint_t fs_e, message *reqm)
       }
 
        printf("fs_sendrec: unhandled error %d sending to %d\n", r, fs_e);
-       panic(__FILE__, "fs_sendrec: unhandled error", NO_NUM);
+       panic("fs_sendrec: unhandled error");
   }
 #endif
 
index 61854f405646c218eeb3dc764f76deac83b273ba..550acc40dc70d207f4235326b3454ae407b48a59 100644 (file)
@@ -311,7 +311,7 @@ PRIVATE int select_request_asynch(struct filp *f, int *ops, int block)
        return(SEL_ERR);
 
   if (r != SUSPEND) 
-       panic(__FILE__, "select_request_asynch: expected SUSPEND got", r);
+       panic("select_request_asynch: expected SUSPEND got: %d", r);
 
   f->filp_count++;
   dp->dmap_sel_filp = f;
@@ -385,7 +385,7 @@ PRIVATE int copy_fdsets(struct selectentry *se, int nfds, int direction)
   fd_set *src_fds, *dst_fds;
 
   if(nfds < 0 || nfds > OPEN_MAX)
-       panic(__FILE__, "select copy_fdsets: nfds wrong", nfds);
+       panic("select copy_fdsets: nfds wrong: %d", nfds);
 
   /* Only copy back as many bits as the user expects. */
   fd_setsize = _FDSETWORDS(nfds) * _FDSETBITSPERWORD/8;
@@ -747,16 +747,14 @@ PUBLIC void select_reply1()
        }
 
        if (!(fp->filp_select_flags & FSF_BUSY))
-               panic(__FILE__, "select_reply1: strange, not FSF_BUSY", NO_NUM);
+               panic("select_reply1: strange; not FSF_BUSY");
 
        vp= fp->filp_vno;
        if (!vp)
-               panic(__FILE__, "select_reply1: FSF_BUSY but no vp", NO_NUM);
+               panic("select_reply1: FSF_BUSY but no vp");
 
-       if ((vp->v_mode & I_TYPE) != I_CHAR_SPECIAL)
-       {
-               panic(__FILE__, "select_reply1: FSF_BUSY but not char special",
-                       NO_NUM);
+       if ((vp->v_mode & I_TYPE) != I_CHAR_SPECIAL) {
+               panic("select_reply1: FSF_BUSY but not char special");
        }
 
        if (vp->v_sdev != dev)
@@ -785,10 +783,8 @@ PUBLIC void select_reply1()
                fp->filp_count--;
        else
        {
-               if (fp->filp_count != 1)
-               {
-                       panic(__FILE__, "select_reply1: bad filp_count",
-                               fp->filp_count);
+               if (fp->filp_count != 1) {
+                       panic("select_reply1: bad filp_count: %d", fp->filp_count);
                }
                close_filp(fp);
        }
@@ -893,17 +889,11 @@ PRIVATE void sel_restart_dev()
                                continue;
 
                        vp= fp->filp_vno;
-                       if (!vp)
-                       {
-                               panic(__FILE__,
-                                       "sel_restart_dev: FSF_UPDATE but no vp",
-                                       NO_NUM);
+                       if (!vp) {
+                               panic("sel_restart_dev: FSF_UPDATE but no vp");
                        }
-                       if ((vp->v_mode & I_TYPE) != I_CHAR_SPECIAL)
-                       {
-                               panic(__FILE__,
-                       "sel_restart_dev: FSF_UPDATE but not char special",
-                                       NO_NUM);
+                       if ((vp->v_mode & I_TYPE) != I_CHAR_SPECIAL) {
+                               panic("sel_restart_dev: FSF_UPDATE but not char special");
                        }
 
                        dp = &dmap[((vp->v_sdev) >> MAJOR) & BYTE];
index bb400a27277372a0870a51d839eef9fd7ae3da24..7beffde92b4b319cd828508a5a5e96e2efbf2714 100644 (file)
@@ -146,8 +146,7 @@ PUBLIC int do_fstat()
   if (rfilp->filp_vno->v_pipe == I_PIPE) {
        if (rfilp->filp_mode & R_BIT) 
                if (ex64hi(rfilp->filp_pos) != 0) {
-                       panic(__FILE__, "do_fstat: bad position in pipe",
-                               NO_NUM);
+                       panic("do_fstat: bad position in pipe");
                }
        pipe_pos = ex64lo(rfilp->filp_pos);
   }
index d1f94f0c00eb9fafec60c8638c8f2c1d529cc50d..c191a790aa9d08f9aeb497de1a620da7e8cd305a 100644 (file)
@@ -14,7 +14,7 @@ PUBLIC void fs_set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
        clock_t now, old_head = 0, new_head;
 
        if ((r = getuptime(&now)) != OK)
-               panic(__FILE__, "FS couldn't get uptime from system task.", NO_NUM);
+               panic("FS couldn't get uptime from system task");
 
        tmr_arg(tp)->ta_int = arg;
 
@@ -23,8 +23,7 @@ PUBLIC void fs_set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
        /* reschedule our synchronous alarm if necessary */
        if (!old_head || old_head > new_head) {
                if (sys_setalarm(new_head, 1) != OK)
-                       panic(__FILE__, "FS set timer "
-                       "couldn't set synchronous alarm.", NO_NUM);
+                       panic("FS set timer couldn't set synchronous alarm");
        }
 
        return;
@@ -36,8 +35,7 @@ PUBLIC void fs_expire_timers(clock_t now)
        tmrs_exptimers(&fs_timers, now, &new_head);
        if (new_head > 0) {
                if (sys_setalarm(new_head, 1) != OK)
-                       panic(__FILE__, "FS expire timer couldn't set "
-                               "synchronous alarm.", NO_NUM);
+                       panic("FS expire timer couldn't set synchronous alarm");
        }
 }
 
@@ -58,8 +56,6 @@ PUBLIC void fs_cancel_timer(timer_t *tp)
         */
        if (old_head < new_head || !new_head) {
                if (sys_setalarm(new_head, 1) != OK)
-                       panic(__FILE__,
-                       "FS expire timer couldn't set synchronous alarm.",
-                                NO_NUM);
+                       panic("FS expire timer couldn't set synchronous alarm");
        }
 }
index 1e23caf7f3c33289903c52c7120548faac901fe7..0a97a729f0874656a5e64a5ea59b8de8186bb0bb 100644 (file)
@@ -42,7 +42,7 @@ int flag;                     /* M3 means path may be in message */
   }
 
   if(len >= sizeof(user_fullpath)) 
-       panic(__FILE__, "fetch_name: len too much for user_fullpath", len);
+       panic("fetch_name: len too much for user_fullpath: %d", len);
 
   /* Check name length for validity. */
   if (len <= 0) {
@@ -113,7 +113,7 @@ PUBLIC int isokendpt_f(char *file, int line, int endpoint, int *proc, int fatal)
   }
 
   if(failed && fatal)
-       panic(__FILE__, "isokendpt_f failed", NO_NUM);
+       panic("isokendpt_f failed");
 
   return(failed ? EDEADSRCDST : OK);
 }
@@ -135,7 +135,7 @@ PUBLIC time_t clock_time()
 
   r = getuptime2(&uptime, &boottime);
   if (r != OK)
-       panic(__FILE__,"clock_time err", r);
+       panic("clock_time err: %d", r);
 
   return( (time_t) (boottime + (uptime/system_hz)));
 }
index 8a8278e42101ff4d407d673b0c5ae7189b8b67db..04b6a2869fe287d314855cadaf1d7ee001780fc2 100644 (file)
@@ -28,7 +28,7 @@
 
 /* vp check that panics */
 #define ASSERTVP(v) if(!SANEVP(v)) { \
-       BADVP(v, __FILE__, __LINE__); panic("vfs", "bad vp", NO_NUM); }
+       BADVP(v, __FILE__, __LINE__); panic("bad vp"); }
 
 /*===========================================================================*
  *                             get_free_vnode                               *
@@ -112,13 +112,13 @@ PUBLIC void put_vnode(struct vnode *vp)
   /* A vnode that's not in use can't be put. */
   if (vp->v_ref_count <= 0) {
        printf("put_vnode: bad v_ref_count %d\n", vp->v_ref_count);
-       panic(__FILE__, "put_vnode failed", NO_NUM);
+       panic("put_vnode failed");
   }
 
   /* fs_count should indicate that the file is in use. */
   if (vp->v_fs_count <= 0) {
        printf("put_vnode: bad v_fs_count %d\n", vp->v_fs_count);
-       panic(__FILE__, "put_vnode failed", NO_NUM);
+       panic("put_vnode failed");
   }
 
   /* Tell FS we don't need this inode to be open anymore. */
index 5ce525927078b6cde1ddaa8ccaccc67a20b3d13e..9c259a0003903135f74a60739075174db906ccc3 100644 (file)
@@ -127,7 +127,7 @@ int line;
   if(!(c)) { \
        printf("holes_sanity_f:%s:%d: %s failed\n", file, line, #c); \
        util_stacktrace();      \
-       vm_panic("assert failed.", NO_NUM); } \
+       panic("assert failed"); } \
   }    
 
        int h, c = 0, n = 0;
@@ -227,7 +227,7 @@ CHECKHOLES;
                        if(memflags & PAF_CLEAR) {
                          if ((s= sys_memset(0, CLICK_SIZE*old_base,
                                CLICK_SIZE*clicks)) != OK)   {
-                               vm_panic("alloc_mem: sys_memset failed", s);
+                               panic("alloc_mem: sys_memset failed: %d", s);
                          }
                        }
 
@@ -284,7 +284,7 @@ CHECKHOLES;
   }
 
   if ( (new_ptr = free_slots) == NIL_HOLE) 
-       vm_panic("hole table full", NO_NUM);
+       panic("hole table full");
   new_ptr->h_base = base;
   new_ptr->h_len = clicks;
   free_slots = new_ptr->h_next;
@@ -520,7 +520,7 @@ PRIVATE PUBLIC phys_bytes alloc_pages(int pages, int memflags)
                printmemstats();
 #if SANITYCHECKS
                if(largest >= pages) {
-                       vm_panic("no memory but largest was enough", NO_NUM);
+                       panic("no memory but largest was enough");
                }
 #endif
                return NO_MEM;
@@ -549,7 +549,7 @@ PRIVATE PUBLIC phys_bytes alloc_pages(int pages, int memflags)
                int s;
                if ((s= sys_memset(0, CLICK_SIZE*mem,
                        VM_PAGE_SIZE*pages)) != OK) 
-                       vm_panic("alloc_mem: sys_memset failed", s);
+                       panic("alloc_mem: sys_memset failed: %d", s);
        }
 
 #if SANITYCHECKS
@@ -589,7 +589,7 @@ PRIVATE void free_pages(phys_bytes pageno, int npages)
                        pr->size += npages;);
        } else {
                if(!SLABALLOC(pr))
-                       vm_panic("alloc_pages: can't alloc", NO_NUM);
+                       panic("alloc_pages: can't alloc");
 #if SANITYCHECKS
                memstats(&firstnodes, &firstpages, &largest);
 
@@ -683,7 +683,7 @@ PUBLIC int do_adddma(message *msg)
                                dmatab[i].dt_base,
                                dmatab[i].dt_size);
                }
-               vm_panic("adddma: table full", NO_NUM);
+               panic("adddma: table full");
                return ENOSPC;
        }
 
@@ -805,7 +805,7 @@ PUBLIC void release_dma(struct vmproc *vmp)
 {
        int i, found_one;
 
-       vm_panic("release_dma not done", NO_NUM);
+       panic("release_dma not done");
 #if 0
 
        found_one= FALSE;
index b6022f848603b7ffeea3090a75e4faed4f73c7b3..da9e2c7aee89a814814ca2b9ce85b1f120264ab2 100644 (file)
@@ -173,7 +173,7 @@ vir_bytes v;
        }
        new_clicks -= vmp->vm_arch.vm_seg[D].mem_vir;
        if ((r=get_stack_ptr(vmp->vm_endpoint, &new_sp)) != OK)
-               vm_panic("couldn't get stack pointer", r);
+               panic("couldn't get stack pointer: %d", r);
        r = adjust(vmp, new_clicks, new_sp);
        return r;
 }
index 3c92acd7ccabc21405da8ca35dc2997323fb5525..7b8535742b71069234babfccb8f92e127f4973db 100644 (file)
@@ -100,7 +100,7 @@ SANITYCHECK(SCL_DETAIL);
        r= sys_datacopy(msg->m_source, (vir_bytes)ptr,
                SELF, (vir_bytes)&args, sizeof(args));
        if (r != OK)
-               vm_panic("exec_newmem: sys_datacopy failed", r);
+               panic("exec_newmem: sys_datacopy failed: %d", r);
 
        /* Minimum stack region (not preallocated)
         * Stopgap for better rlimit-based stack size system
@@ -281,7 +281,7 @@ SANITYCHECK(SCL_DETAIL);
                        /* We secretly know that making a new pagetable
                         * in the same slot if one was there will never fail.
                         */
-                               vm_panic("new_mem: pt_new failed", ENOMEM);
+                               panic("new_mem: pt_new failed: %d", ENOMEM);
                        }
                        rmp->vm_flags |= VMF_HASPT;
                        SANITYCHECK(SCL_DETAIL);
@@ -325,7 +325,7 @@ SANITYCHECK(SCL_DETAIL);
                         */
                        base = (phys_bytes)(new_base+text_clicks-1) << CLICK_SHIFT;
                        if ((s= sys_memset(0, base, CLICK_SIZE)) != OK)
-                               vm_panic("new_mem: sys_memset failed", s);
+                               panic("new_mem: sys_memset failed: %d", s);
                }
        }
 
@@ -351,7 +351,7 @@ SANITYCHECK(SCL_DETAIL);
 
          if((r2=sys_newmap(rmp->vm_endpoint, rmp->vm_arch.vm_seg)) != OK) {
                /* report new map to the kernel */
-               vm_panic("sys_newmap failed", r2);
+               panic("sys_newmap failed: %d", r2);
          }
 
          /* Zero the bss, gap, and stack segment. */
@@ -362,12 +362,12 @@ SANITYCHECK(SCL_DETAIL);
          bytes -= bss_offset;
 
          if ((s=sys_memset(0, base, bytes)) != OK) {
-               vm_panic("new_mem can't zero", s);
+               panic("new_mem can't zero: %d", s);
          }
 
          /* Tell kernel this thing has no page table. */
          if((s=pt_bind(NULL, rmp)) != OK)
-               vm_panic("exec_newmem: pt_bind failed", s);
+               panic("exec_newmem: pt_bind failed: %d", s);
        *stack_top= ((vir_bytes)rmp->vm_arch.vm_seg[S].mem_vir << CLICK_SHIFT) +
                ((vir_bytes)rmp->vm_arch.vm_seg[S].mem_len << CLICK_SHIFT);
   }
@@ -474,7 +474,7 @@ PUBLIC int proc_new(struct vmproc *vmp,
        if(!map_page_region(vmp, vstart + text_bytes + data_bytes + hole_bytes,
          0, stack_bytes + gap_bytes, MAP_NONE,
          VR_ANON | VR_WRITABLE, 0) != OK) {
-               vm_panic("map_page_region failed for stack", NO_NUM);
+               panic("map_page_region failed for stack");
        }
 
        vmp->vm_arch.vm_seg[D].mem_phys = ABS2CLICK(vstart + text_bytes);
@@ -506,10 +506,10 @@ PUBLIC int proc_new(struct vmproc *vmp,
        vmp->vm_flags |= VMF_HASPT;
 
        if((s=sys_newmap(vmp->vm_endpoint, vmp->vm_arch.vm_seg)) != OK)
-               vm_panic("sys_newmap (vm) failed", s);
+               panic("sys_newmap (vm) failed: %d", s);
 
        if((s=pt_bind(&vmp->vm_pt, vmp)) != OK)
-               vm_panic("exec_newmem: pt_bind failed", s);
+               panic("exec_newmem: pt_bind failed: %d", s);
 
        return OK;
 }
index 091c5a3241e339b5190e5629b3287f770b62a322..c4db1f7eef565fddfed15667f1d323f7b55c0b98 100644 (file)
@@ -123,7 +123,7 @@ PUBLIC int do_fork(message *msg)
        child_abs = (phys_bytes) child_base << CLICK_SHIFT;
        parent_abs = (phys_bytes) vmp->vm_arch.vm_seg[D].mem_phys << CLICK_SHIFT;
        s = sys_abscopy(parent_abs, child_abs, prog_bytes);
-       if (s < 0) vm_panic("do_fork can't copy", s);
+       if (s < 0) panic("do_fork can't copy: %d", s);
 
        /* A separate I&D child keeps the parents text segment.  The data and stack
        * segments must refer to the new copy.
@@ -150,7 +150,7 @@ PUBLIC int do_fork(message *msg)
   if((r=sys_fork(vmp->vm_endpoint, childproc,
        &vmc->vm_endpoint, vmc->vm_arch.vm_seg,
        PFF_VMINHIBIT, &msgaddr)) != OK) {
-        vm_panic("do_fork can't sys_fork", r);
+        panic("do_fork can't sys_fork: %d", r);
   }
 
   NOTRUNNABLE(vmp->vm_endpoint);
@@ -168,7 +168,7 @@ PUBLIC int do_fork(message *msg)
   }
 
   if((r=pt_bind(&vmc->vm_pt, vmc)) != OK)
-       vm_panic("fork can't pt_bind", r);
+       panic("fork can't pt_bind: %d", r);
 
   /* Inform caller of new child endpoint. */
   msg->VMF_CHILD_ENDPOINT = vmc->vm_endpoint;
index c1a4fcc8ab936cef29864a8b957220909cb8474f..5aeab26b091f871c47b54e464c9fdfe5039861fd 100644 (file)
@@ -107,7 +107,7 @@ PUBLIC void pt_sanitycheck(pt_t *pt, char *file, int line)
        }
 
        if(slot >= ELEMENTS(vmproc)) {
-               vm_panic("pt_sanitycheck: passed pt not in any proc", NO_NUM);
+               panic("pt_sanitycheck: passed pt not in any proc");
        }
 
        MYASSERT(usedpages_add(pt->pt_dir_phys, I386_PAGE_SIZE) == OK);
@@ -137,7 +137,7 @@ PRIVATE void *aalloc(size_t bytes)
        u32_t b;
 
        b = (u32_t) malloc(I386_PAGE_SIZE + bytes);
-       if(!b) vm_panic("aalloc: out of memory", bytes);
+       if(!b) panic("aalloc: out of memory: %d", bytes);
        b += I386_PAGE_SIZE - (b % I386_PAGE_SIZE);
 
        return (void *) b;
@@ -214,8 +214,7 @@ PRIVATE void vm_freepages(vir_bytes vir, vir_bytes phys, int pages, int reason)
                FREE_MEM(ABS2CLICK(phys), pages);
                if(pt_writemap(&vmp->vm_pt, arch_vir2map(vmp, vir),
                        MAP_NONE, pages*I386_PAGE_SIZE, 0, WMF_OVERWRITE) != OK)
-                               vm_panic("vm_freepages: pt_writemap failed",
-                                       NO_NUM);
+                       panic("vm_freepages: pt_writemap failed");
        } else {
                printf("VM: vm_freepages not freeing VM heap pages (%d)\n",
                        pages);
@@ -334,7 +333,7 @@ PUBLIC void *vm_allocpage(phys_bytes *phys, int reason)
        }
 
        if((r=sys_vmctl(SELF, VMCTL_FLUSHTLB, 0)) != OK) {
-               vm_panic("VMCTL_FLUSHTLB failed", r);
+               panic("VMCTL_FLUSHTLB failed: %d", r);
        }
 
        level--;
@@ -367,11 +366,11 @@ PUBLIC void vm_pagelock(void *vir, int lockflag)
        /* Update flags. */
        if((r=pt_writemap(pt, m, 0, I386_PAGE_SIZE,
                flags, WMF_OVERWRITE | WMF_WRITEFLAGSONLY)) != OK) {
-               vm_panic("vm_lockpage: pt_writemap failed\n", NO_NUM);
+               panic("vm_lockpage: pt_writemap failed");
        }
 
        if((r=sys_vmctl(SELF, VMCTL_FLUSHTLB, 0)) != OK) {
-               vm_panic("VMCTL_FLUSHTLB failed", r);
+               panic("VMCTL_FLUSHTLB failed: %d", r);
        }
 
        return;
@@ -439,10 +438,10 @@ PUBLIC int pt_writemap(pt_t *pt, vir_bytes v, phys_bytes physaddr,
         */
 #if SANITYCHECKS
        if(physaddr != MAP_NONE && !(flags & I386_VM_PRESENT)) {
-               vm_panic("pt_writemap: writing dir with !P\n", NO_NUM);
+               panic("pt_writemap: writing dir with !P");
        }
        if(physaddr == MAP_NONE && flags) {
-               vm_panic("pt_writemap: writing 0 with flags\n", NO_NUM);
+               panic("pt_writemap: writing 0 with flags");
        }
 #endif
 
@@ -458,7 +457,7 @@ PUBLIC int pt_writemap(pt_t *pt, vir_bytes v, phys_bytes physaddr,
                if(pt->pt_dir[pdecheck] & I386_VM_BIGPAGE) {
                        printf("pt_writemap: trying to write 0x%lx into 0x%lx\n",
                                physaddr, v);
-                        vm_panic("pt_writemap: BIGPAGE found", NO_NUM);
+                        panic("pt_writemap: BIGPAGE found");
                }
                if(!(pt->pt_dir[pdecheck] & I386_VM_PRESENT)) {
                        int r;
@@ -615,7 +614,7 @@ PUBLIC int pt_new(pt_t *pt)
 
         /* Map in kernel. */
         if(pt_mapkernel(pt) != OK)
-                vm_panic("pt_new: pt_mapkernel failed", NO_NUM);
+                panic("pt_new: pt_mapkernel failed");
 
        return OK;
 }
@@ -680,10 +679,10 @@ PUBLIC void pt_init(phys_bytes usedlimit)
 
         /* Get ourselves spare pages. */
         if(!(sparepages_mem = (vir_bytes) aalloc(I386_PAGE_SIZE*SPAREPAGES)))
-               vm_panic("pt_init: aalloc for spare failed", NO_NUM);
+               panic("pt_init: aalloc for spare failed");
         if((r=sys_umap(SELF, VM_D, (vir_bytes) sparepages_mem,
                 I386_PAGE_SIZE*SPAREPAGES, &sparepages_ph)) != OK)
-                vm_panic("pt_init: sys_umap failed", r);
+                panic("pt_init: sys_umap failed: %d", r);
 
         for(s = 0; s < SPAREPAGES; s++) {
                sparepages[s].page = (void *) (sparepages_mem + s*I386_PAGE_SIZE);
@@ -728,7 +727,7 @@ PUBLIC void pt_init(phys_bytes usedlimit)
          * from the current one.
          */     
         if(pt_new(newpt) != OK)
-                vm_panic("pt_init: pt_new failed", NO_NUM); 
+                panic("pt_init: pt_new failed"); 
 
         /* Set up mappings for VM process. */
         for(v = lo; v < hi; v += I386_PAGE_SIZE)  {
@@ -740,7 +739,7 @@ PUBLIC void pt_init(phys_bytes usedlimit)
                  */ 
                 if(pt_writemap(newpt, v+moveup, v, I386_PAGE_SIZE,
                         I386_VM_PRESENT|I386_VM_WRITE|I386_VM_USER, 0) != OK)
-                        vm_panic("pt_init: pt_writemap failed", NO_NUM);
+                        panic("pt_init: pt_writemap failed");
         }
        
         /* Move segments up too. */
@@ -753,7 +752,7 @@ PUBLIC void pt_init(phys_bytes usedlimit)
         */
        if(!(page_directories = vm_allocpage(&page_directories_phys,
                VMP_PAGETABLE)))
-                vm_panic("no virt addr for vm mappings", NO_NUM);
+                panic("no virt addr for vm mappings");
 
        memset(page_directories, 0, I386_PAGE_SIZE);
        
@@ -793,7 +792,7 @@ PUBLIC void pt_init(phys_bytes usedlimit)
                        &flags) == OK)  {
                        vir_bytes vir;
                        if(index >= MAX_KERNMAPPINGS)
-                               vm_panic("VM: too many kernel mappings", index);
+                               panic("VM: too many kernel mappings: %d", index);
                        kern_mappings[index].phys_addr = addr;
                        kern_mappings[index].len = len;
                        kern_mappings[index].flags = flags;
@@ -805,12 +804,12 @@ PUBLIC void pt_init(phys_bytes usedlimit)
                                kern_mappings[index].flags |=
                                        I386_VM_PWT | I386_VM_PCD;
                        if(addr % I386_PAGE_SIZE)
-                               vm_panic("VM: addr unaligned", addr);
+                               panic("VM: addr unaligned: %d", addr);
                        if(len % I386_PAGE_SIZE)
-                               vm_panic("VM: len unaligned", len);
+                               panic("VM: len unaligned: %d", len);
                        vir = arch_map2vir(&vmproc[VMP_SYSTEM], offset);
                        if(sys_vmctl_reply_mapping(index, vir) != OK)
-                               vm_panic("VM: reply failed", NO_NUM);
+                               panic("VM: reply failed");
                        offset += len;
                        index++;
                        kernmappings++;
@@ -827,7 +826,7 @@ PUBLIC void pt_init(phys_bytes usedlimit)
        /* Tell kernel about free pde's. */
        while(free_pde*I386_BIG_PAGE_SIZE < VM_PROCSTART) {
                if((r=sys_vmctl(SELF, VMCTL_I386_FREEPDE, free_pde++)) != OK) {
-                       vm_panic("VMCTL_I386_FREEPDE failed", r);
+                       panic("VMCTL_I386_FREEPDE failed: %d", r);
                }
        }
 
@@ -838,7 +837,7 @@ PUBLIC void pt_init(phys_bytes usedlimit)
 
        /* Increase kernel segment to address this memory. */
        if((r=sys_vmctl(SELF, VMCTL_I386_KERNELLIMIT, kernlimit)) != OK) {
-                vm_panic("VMCTL_I386_KERNELLIMIT failed", r);
+                panic("VMCTL_I386_KERNELLIMIT failed: %d", r);
        }
 
        kpagedir = arch_map2vir(&vmproc[VMP_SYSTEM],
@@ -846,7 +845,7 @@ PUBLIC void pt_init(phys_bytes usedlimit)
 
        /* Tell kernel how to get at the page directories. */
        if((r=sys_vmctl(SELF, VMCTL_I386_PAGEDIRS, kpagedir)) != OK) {
-                vm_panic("VMCTL_I386_PAGEDIRS failed", r);
+                panic("VMCTL_I386_PAGEDIRS failed: %d", r);
        }
        
         /* Give our process the new, copied, private page table. */
@@ -855,7 +854,7 @@ PUBLIC void pt_init(phys_bytes usedlimit)
        
        /* Now actually enable paging. */
        if(sys_vmctl_enable_paging(vmp->vm_arch.vm_seg) != OK)
-               vm_panic("pt_init: enable paging failed", NO_NUM);
+               panic("pt_init: enable paging failed");
 
         /* Back to reality - this is where the stack actually is. */
         vmp->vm_arch.vm_seg[S].mem_len -= extra_clicks;
@@ -934,7 +933,7 @@ PUBLIC int pt_mapkernel(pt_t *pt)
                                I386_VM_WRITE | global_bit;
                }
        } else {
-               vm_panic("VM: pt_mapkernel: no bigpage", NO_NUM);
+               panic("VM: pt_mapkernel: no bigpage");
        }
 
        if(pagedir_pde >= 0) {
@@ -948,7 +947,7 @@ PUBLIC int pt_mapkernel(pt_t *pt)
                        kern_mappings[i].phys_addr,
                        kern_mappings[i].len,
                        kern_mappings[i].flags, 0) != OK) {
-                       vm_panic("pt_mapkernel: pt_writemap failed", NO_NUM);
+                       panic("pt_mapkernel: pt_writemap failed");
                }
        }
 
index c734f6c0e698146b06ac050d5f680ae17668a2d2..d0a7f8a5fbd08471a994304552d2ada14bce513d 100644 (file)
@@ -84,7 +84,7 @@ PUBLIC int main(void)
        SANITYCHECK(SCL_DETAIL);
 
        if ((r=sef_receive(ANY, &msg)) != OK)
-               vm_panic("sef_receive() error", r);
+               panic("sef_receive() error: %d", r);
 
        SANITYCHECK(SCL_DETAIL);
 
@@ -136,7 +136,7 @@ PUBLIC int main(void)
                if((r=send(who_e, &msg)) != OK) {
                        printf("VM: couldn't send %d to %d (err %d)\n",
                                msg.m_type, who_e, r);
-                       vm_panic("send() error", NO_NUM);
+                       panic("send() error");
                }
        SANITYCHECK(SCL_DETAIL);
        }
@@ -193,7 +193,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
         * slots to fill in.
         */
        if (OK != (s=sys_getimage(image)))
-               vm_panic("couldn't get image table: %d\n", s);
+               panic("couldn't get image table: %d", s);
 
        /* Set table to 0. This invalidates all slots (clear VMF_INUSE). */
        memset(vmproc, 0, sizeof(vmproc));
@@ -209,7 +209,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
                phys_bytes proclimit;
                struct vmproc *vmp;
 
-               if(ip->proc_nr >= _NR_PROCS) { vm_panic("proc", ip->proc_nr); }
+               if(ip->proc_nr >= _NR_PROCS) { panic("proc: %d", ip->proc_nr); }
                if(ip->proc_nr < 0 && ip->proc_nr != SYSTEM) continue;
 
 #define GETVMP(v, nr)                                          \
@@ -218,7 +218,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
                } else if(nr == SYSTEM) {                       \
                        vmp = &vmproc[VMP_SYSTEM];              \
                } else {                                        \
-                       vm_panic("init: crazy proc_nr", nr);    \
+                       panic("init: crazy proc_nr: %d", nr);   \
                }
 
                /* Initialize normal process table slot or special SYSTEM
@@ -231,7 +231,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
                /* Get memory map for this process from the kernel. */
                if ((s=get_mem_map(ip->proc_nr, vmp->vm_arch.vm_seg)) != OK)
-                       vm_panic("couldn't get process mem_map",s);
+                       panic("couldn't get process mem_map: %d", s);
 
                /* Remove this memory from the free list. */
                reserve_proc_mem(mem_chunks, vmp->vm_arch.vm_seg);
@@ -279,13 +279,13 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
                        vmp->vm_arch.vm_seg[D].mem_len;
 
                if(pt_new(&vmp->vm_pt) != OK)
-                       vm_panic("VM: no new pagetable", NO_NUM);
+                       panic("VM: no new pagetable");
 #define BASICSTACK VM_PAGE_SIZE
                old_stacktop = CLICK2ABS(vmp->vm_arch.vm_seg[S].mem_vir +
                                vmp->vm_arch.vm_seg[S].mem_len);
                if(sys_vmctl(vmp->vm_endpoint, VMCTL_INCSP,
                        VM_STACKTOP - old_stacktop) != OK) {
-                       vm_panic("VM: vmctl for new stack failed", NO_NUM);
+                       panic("VM: vmctl for new stack failed");
                }
 
                FREE_MEM(vmp->vm_arch.vm_seg[D].mem_phys +
@@ -303,14 +303,14 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
                        CLICK2ABS(vmp->vm_arch.vm_seg[T].mem_phys),
                        CLICK2ABS(vmp->vm_arch.vm_seg[D].mem_phys),
                                VM_STACKTOP) != OK) {
-                       vm_panic("failed proc_new for boot process", NO_NUM);
+                       panic("failed proc_new for boot process");
                }
        }
 
        /* Set up table of calls. */
 #define CALLMAP(code, func) { int i;                         \
-       if((i=CALLNUMBER(code)) < 0) { vm_panic(#code " invalid", (code)); } \
-       if(i >= NR_VM_CALLS) { vm_panic(#code " invalid", (code)); } \
+       if((i=CALLNUMBER(code)) < 0) { panic(#code " invalid: %d", (code)); } \
+       if(i >= NR_VM_CALLS) { panic(#code " invalid: %d", (code)); } \
        vm_calls[i].vmc_func = (func);                                \
        vm_calls[i].vmc_name = #code;                                 \
 }
@@ -352,7 +352,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
 
        /* Sanity checks */
        if(find_kernel_top() >= VM_PROCSTART)
-               vm_panic("kernel loaded too high", NO_NUM);
+               panic("kernel loaded too high");
 
        /* Initialize the structures for queryexit */
        init_query_exit();
@@ -364,12 +364,12 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
        /* Map all the services in the boot image. */
        if((s = sys_safecopyfrom(RS_PROC_NR, info->rproctab_gid, 0,
                (vir_bytes) rprocpub, sizeof(rprocpub), S)) != OK) {
-               panic("VM", "sys_safecopyfrom failed", s);
+               panic("sys_safecopyfrom failed: %d", s);
        }
        for(i=0;i < NR_BOOT_PROCS;i++) {
                if(rprocpub[i].in_use) {
                        if((s = map_service(&rprocpub[i])) != OK) {
-                               vm_panic("unable to map service", s);
+                               panic("unable to map service: %d", s);
                        }
                }
        }
@@ -405,7 +405,7 @@ PRIVATE int vm_acl_ok(endpoint_t caller, int call)
        int n, r;
 
        if ((r = vm_isokendpt(caller, &n)) != OK)
-               vm_panic("VM: from strange source.", caller);
+               panic("VM: from strange source: %d", caller);
 
        /* See if the call is allowed. */
        if (!GET_BIT(vmproc[n].vm_call_mask, call)) {
index f4940fff0aaef2f7c9ab142d2519a9304d1cc7af..0cbb2dc349c37d195ee627a80eba25cf6f46421e 100644 (file)
@@ -145,7 +145,7 @@ PRIVATE int do_map_memory(struct vmproc *vms, struct vmproc *vmd,
        physr_start_iter(vrs->phys, &iter, offset_s, AVL_EQUAL);
        prs = physr_get_iter(&iter);
        if(!prs)
-               vm_panic("map_memory: no aligned phys region.", 0);
+               panic("map_memory: no aligned phys region: %d", 0);
 
        /* flag: 0 -> read-only
         *       1 -> writable
@@ -230,10 +230,10 @@ PUBLIC int map_memory(endpoint_t sour, endpoint_t dest,
        int r;
 
        if(vm_isokendpt(sour, &p) != OK)
-               vm_panic("handle_memory: endpoint wrong", sour);
+               panic("handle_memory: endpoint wrong: %d", sour);
        vms = &vmproc[p];
        if(vm_isokendpt(dest, &p) != OK)
-               vm_panic("handle_memory: endpoint wrong", dest);
+               panic("handle_memory: endpoint wrong: %d", dest);
        vmd = &vmproc[p];
 
        vrs = map_lookup(vms, virt_s);
@@ -295,7 +295,7 @@ PUBLIC int unmap_memory(endpoint_t sour, endpoint_t dest,
 
        /* Use information on the destination process to unmap. */
        if(vm_isokendpt(dest, &p) != OK)
-               vm_panic("handle_memory: endpoint wrong", dest);
+               panic("handle_memory: endpoint wrong: %d", dest);
        vmd = &vmproc[p];
 
        vrd = map_lookup(vmd, virt_d);
@@ -306,7 +306,7 @@ PUBLIC int unmap_memory(endpoint_t sour, endpoint_t dest,
        physr_start_iter(vrd->phys, &iter, off, AVL_EQUAL);
        pr = physr_get_iter(&iter);
        if(!pr)
-               vm_panic("map_memory: no aligned phys region.", 0);
+               panic("map_memory: no aligned phys region: %d", 0);
 
        /* Copy the phys block now rather than doing COW. */
        end = off + length;
index 5447f15fa3843f2dbe56f835ecc1f13bbc230098..975ad1e1178cf85be990c542079663f28e942802 100644 (file)
@@ -41,7 +41,7 @@ PUBLIC int do_mmap(message *m)
        struct vir_region *vr = NULL;
 
        if((r=vm_isokendpt(m->m_source, &n)) != OK) {
-               vm_panic("do_mmap: message from strange source", m->m_source);
+               panic("do_mmap: message from strange source: %d", m->m_source);
        }
 
        vmp = &vmproc[n];
@@ -281,7 +281,7 @@ PUBLIC int do_shared_unmap(message *m)
        }
 
        if(map_unmap_region(vmp, vr, vr->length) != OK)
-               vm_panic("do_shared_unmap: map_unmap_region failed", NO_NUM);
+               panic("do_shared_unmap: map_unmap_region failed");
 
        return OK;
 }
@@ -349,7 +349,7 @@ PUBLIC int do_munmap(message *m)
        struct vir_region *vr;
         
         if((r=vm_isokendpt(m->m_source, &n)) != OK) {
-                vm_panic("do_mmap: message from strange source", m->m_source);
+                panic("do_mmap: message from strange source: %d", m->m_source);
         }
  
         vmp = &vmproc[n];
@@ -362,7 +362,7 @@ PUBLIC int do_munmap(message *m)
        } else if(m->m_type == VM_MUNMAP_TEXT) {
                addr = (vir_bytes) arch_vir2map_text(vmp, (vir_bytes) m->VMUM_ADDR);
        } else {
-               vm_panic("do_munmap: strange type", NO_NUM);
+               panic("do_munmap: strange type");
        }
 
         if(!(vr = map_lookup(vmp, addr))) {
@@ -380,7 +380,7 @@ PUBLIC int do_munmap(message *m)
         }       
 
        if(map_unmap_region(vmp, vr, len) != OK)
-               vm_panic("do_munmap: map_unmap_region failed", NO_NUM);
+               panic("do_munmap: map_unmap_region failed");
 
        return OK;
 }
index 34c6570d055db1ff5bf6c2a5ac0678ed3ae91253..cccbed4f74c3e0f6e447f63f5d916b08682784c9 100644 (file)
@@ -63,7 +63,7 @@ PUBLIC void do_pagefaults(void)
                int p, wr = PFERR_WRITE(err);
 
                if(vm_isokendpt(ep, &p) != OK)
-                       vm_panic("do_pagefaults: endpoint wrong", ep);
+                       panic("do_pagefaults: endpoint wrong: %d", ep);
 
                vmp = &vmproc[p];
                vm_assert(vmp->vm_flags & VMF_INUSE);
@@ -75,9 +75,9 @@ PUBLIC void do_pagefaults(void)
                                ep, arch_map2vir(vmp, addr), pf_errstr(err));
                        sys_sysctl_stacktrace(vmp->vm_endpoint);
                        if((s=sys_kill(vmp->vm_endpoint, SIGSEGV)) != OK)
-                               vm_panic("sys_kill failed", s);
+                               panic("sys_kill failed: %d", s);
                        if((s=sys_vmctl(ep, VMCTL_CLEAR_PAGEFAULT, r)) != OK)
-                               vm_panic("do_pagefaults: sys_vmctl failed", ep);
+                               panic("do_pagefaults: sys_vmctl failed: %d", ep);
                        continue;
                }
 
@@ -97,9 +97,9 @@ PUBLIC void do_pagefaults(void)
                                ep, arch_map2vir(vmp, addr), pf_errstr(err));
                        sys_sysctl_stacktrace(vmp->vm_endpoint);
                        if((s=sys_kill(vmp->vm_endpoint, SIGSEGV)) != OK)
-                               vm_panic("sys_kill failed", s);
+                               panic("sys_kill failed: %d", s);
                        if((s=sys_vmctl(ep, VMCTL_CLEAR_PAGEFAULT, r)) != OK)
-                               vm_panic("do_pagefaults: sys_vmctl failed", ep);
+                               panic("do_pagefaults: sys_vmctl failed: %d", ep);
                        continue;
                }
 
@@ -111,15 +111,15 @@ PUBLIC void do_pagefaults(void)
                        printf("VM: pagefault: SIGSEGV %d pagefault not handled\n", ep);
                        sys_sysctl_stacktrace(vmp->vm_endpoint);
                        if((s=sys_kill(vmp->vm_endpoint, SIGSEGV)) != OK)
-                               vm_panic("sys_kill failed", s);
+                               panic("sys_kill failed: %d", s);
                        if((s=sys_vmctl(ep, VMCTL_CLEAR_PAGEFAULT, r)) != OK)
-                               vm_panic("do_pagefaults: sys_vmctl failed", ep);
+                               panic("do_pagefaults: sys_vmctl failed: %d", ep);
                        continue;
                }
 
                /* Pagefault is handled, so now reactivate the process. */
                if((s=sys_vmctl(ep, VMCTL_CLEAR_PAGEFAULT, r)) != OK)
-                       vm_panic("do_pagefaults: sys_vmctl failed", ep);
+                       panic("do_pagefaults: sys_vmctl failed: %d", ep);
 
        }
 
@@ -146,7 +146,7 @@ PUBLIC void do_memory(void)
                switch(r) {
                case VMPTYPE_CHECK:
                        if(vm_isokendpt(who, &p) != OK)
-                               vm_panic("do_memory: bad endpoint", who);
+                               panic("do_memory: bad endpoint: %d", who);
                        vmp = &vmproc[p];
 
                        r = handle_memory(vmp, mem, len, wrflag);
@@ -165,7 +165,7 @@ PUBLIC void do_memory(void)
                }
 
                if(sys_vmctl(requestor, VMCTL_MEMREQ_REPLY, r) != OK)
-                       vm_panic("do_memory: sys_vmctl failed", r);
+                       panic("do_memory: sys_vmctl failed: %d", r);
        }
 }
 
index 616c5c51e9e7b7b89544df41fb733b29d532bcac..1559eb0472820bdea550e41c2fcbbd4d5a3ba17b 100644 (file)
@@ -51,7 +51,7 @@ PRIVATE char *map_name(struct vir_region *vr)
                case VR_DIRECT:
                        return "direct";
                default:
-                       vm_panic("unknown mapping type", type);
+                       panic("unknown mapping type: %d", type);
        }
 
        return "NOTREACHED";
@@ -455,7 +455,7 @@ PUBLIC void pb_unreferenced(struct vir_region *region, struct phys_region *pr)
                } else if(region->flags & VR_DIRECT) {
                        ; /* No action required. */
                } else {
-                       vm_panic("strange phys flags", NO_NUM);
+                       panic("strange phys flags");
                }
                SLABFREE(pb);
        }
@@ -588,7 +588,7 @@ vir_bytes offset;
        SANITYCHECK(SCL_FUNCTIONS);
 
        if(!vmp->vm_regions)
-               vm_panic("process has no regions", vmp->vm_endpoint);
+               panic("process has no regions: %d", vmp->vm_endpoint);
 
        for(r = vmp->vm_regions; r; r = r->next) {
                if(offset >= r->vaddr && offset < r->vaddr + r->length)
@@ -758,7 +758,7 @@ USE(newpb,
         */
        r = map_ph_writept(vmp, region, ph);
        if(r != OK)
-               vm_panic("map_copy_ph_block: map_ph_writept failed", r);
+               panic("map_copy_ph_block: map_ph_writept failed: %d", r);
 
        return OK;
 }
@@ -825,7 +825,7 @@ int write;
 
 #if SANITYCHECKS
        if(OK != pt_checkrange(&vmp->vm_pt, region->vaddr+offset, VM_PAGE_SIZE, write)) {
-               vm_panic("map_pf: pt_checkrange failed", r);
+               panic("map_pf: pt_checkrange failed: %d", r);
        }
 #endif 
 
@@ -885,8 +885,8 @@ int write;
 #define RESET_ITER(it, where, what) {  \
        physr_start_iter(region->phys, &it, where, AVL_EQUAL);  \
        what = physr_get_iter(&it); \
-       if(!what)  vm_panic("thing missing", NO_NUM); \
-       if(what->offset != where) vm_panic("thing wrong", NO_NUM);      \
+       if(!what)  panic("thing missing"); \
+       if(what->offset != where) panic("thing wrong"); \
 }
 
        FREE_RANGE_HERE(NULL, physr);
@@ -960,7 +960,7 @@ int write;
                printf("handle mem %s-", arch_map2str(vmp, region->vaddr+offset));
                printf("%s failed\n", arch_map2str(vmp, region->vaddr+offset+length));
                map_printregion(vmp, region);
-               vm_panic("checkrange failed", NO_NUM);
+               panic("checkrange failed");
        }
 #endif
 
@@ -1269,7 +1269,7 @@ PUBLIC int map_unmap_region(struct vmproc *vmp, struct vir_region *region,
        SANITYCHECK(SCL_DETAIL);
 
        if(r == NULL)
-               vm_panic("map_unmap_region: region not found\n", NO_NUM);
+               panic("map_unmap_region: region not found");
 
        if(len > r->length || (len % VM_PAGE_SIZE)) {
                printf("VM: bogus length 0x%lx\n", len);
@@ -1388,7 +1388,7 @@ PUBLIC int map_remap(struct vmproc *dvmp, vir_bytes da, size_t size,
                struct phys_block *pb = ph->ph;
                USE(pb, pb->refcount++;);
                if(map_ph_writept(dvmp, vr, ph) != OK) {
-                       vm_panic("map_remap: map_ph_writept failed", NO_NUM);
+                       panic("map_remap: map_ph_writept failed");
                }
 
                physr_incr_iter(&iter);
index a0a67729e90a2bc0a551c750983b20a2d97b8a6b..13a4f23271d55f1f8b134217d4afdd523e525e3a 100644 (file)
@@ -11,7 +11,7 @@
  */
 #define MYASSERT(c) do { if(!(c)) { \
         printf("VM:%s:%d: %s failed\n", file, line, #c); \
-       vm_panic("sanity check failed", NO_NUM); } } while(0)
+       panic("sanity check failed"); } } while(0)
 
 #define SLABSANITYCHECK(l) if((l) <= vm_sanitychecklevel) { \
        slab_sanitycheck(__FILE__, __LINE__); }
 #define SLABSANE(ptr) { \
        if(!slabsane_f(__FILE__, __LINE__, ptr, sizeof(*(ptr)))) { \
                printf("VM:%s:%d: SLABSANE(%s)\n", __FILE__, __LINE__, #ptr); \
-               vm_panic("SLABSANE failed", NO_NUM);    \
+               panic("SLABSANE failed");       \
        } \
 }
 
 #define NOTRUNNABLE(ep) {                      \
        struct proc pr;                         \
        if(sys_getproc(&pr, ep) != OK) {        \
-               vm_panic("VM: sys_getproc failed", ep); \
+               panic("VM: sys_getproc failed: %d", ep);        \
        }                                       \
        if(!pr.p_rts_flags) {                   \
-               vm_panic("VM: runnable", ep);   \
+               panic("VM: runnable: %d", ep);  \
        }                                       \
 }
 
index bc7555bb5b94f830a4a30ee614b40401627134ad..ab4fda3cea4422b77a11606b959dfe0c7948a2c6 100644 (file)
@@ -46,7 +46,7 @@ PUBLIC int do_push_sig(message *msg)
        vmp = &vmproc[n];
 
         if ((r=get_stack_ptr(ep, &sp)) != OK)
-                vm_panic("couldn't get new stack pointer (for sig)",r);
+                panic("couldn't get new stack pointer (for sig): %d", r);
        
        /* Save old SP for caller */
        msg->VMPS_OLD_SP = (char *) sp;
index bf9e4fe00d27cbf4cf0f98d2334518567cec22f3..4ec4c818287da00185103f820aff3e7c87383ce7 100644 (file)
@@ -354,7 +354,7 @@ PUBLIC void *slaballoc(int bytes)
                printf("slaballoc: odd, bytes %d?\n", bytes);
        }
                        if(!slabsane_f(__FILE__, __LINE__, ret, bytes))
-                               vm_panic("slaballoc: slabsane failed", NO_NUM);
+                               panic("slaballoc: slabsane failed");
 #endif
 
                        return ret;
@@ -365,7 +365,7 @@ PUBLIC void *slaballoc(int bytes)
        }
        SLABSANITYCHECK(SCL_FUNCTIONS);
 
-       vm_panic("slaballoc: no space in 'used' slabdata", NO_NUM);
+       panic("slaballoc: no space in 'used' slabdata");
 
        /* Not reached. */
        return NULL;
@@ -442,7 +442,7 @@ PUBLIC void slabfree(void *mem, int bytes)
        SLABSANITYCHECK(SCL_FUNCTIONS);
 
        if(objstats(mem, bytes, &s, &f, &i) != OK) {
-               vm_panic("slabfree objstats failed", NO_NUM);
+               panic("slabfree objstats failed");
        }
 
 #if SANITYCHECKS
@@ -498,7 +498,7 @@ PUBLIC void slablock(void *mem, int bytes)
        struct slabdata *f;
 
        if(objstats(mem, bytes, &s, &f, &i) != OK)
-               vm_panic("slablock objstats failed", NO_NUM);
+               panic("slablock objstats failed");
 
        SLABDATAUNWRITABLE(f);
 
@@ -517,7 +517,7 @@ PUBLIC void slabunlock(void *mem, int bytes)
        struct slabdata *f;
 
        if(objstats(mem, bytes, &s, &f, &i) != OK)
-               vm_panic("slablock objstats failed", NO_NUM);
+               panic("slablock objstats failed");
 
        SLABDATAWRITABLE(f, i);
 
index 2b5bd6374e4aac4c4905597e1fe72ead5f3d07a4..00b3baf8cd30611ebfc7ed31db0fce3c5a1bd538 100644 (file)
        if(vm_sanitychecklevel > 0 && !(cond)) {        \
                printf("VM:%s:%d: assert failed: %s\n", \
                        __FILE__, __LINE__, #cond);     \
-               panic("VM", "assert failed", NO_NUM);   \
+               panic("assert failed");         \
        }                                               \
        }
 #else
 #define vm_assert(cond)        ;
 #endif
 
-#define vm_panic(str, n) { char _pline[100]; \
-       sprintf(_pline, "%s:%d: %s", __FILE__, __LINE__, (str));        \
-       panic("VM", _pline, (n));                                       \
-       }
-
 #endif
 
index bebf9fb51be086f96d1cc6c419042b061aa7b6c1..844aae7203ab3bb0ac39cf69fb2c83a1fd9ea44f 100644 (file)
@@ -68,7 +68,7 @@ struct memory *mem_chunks;                      /* store mem chunks here */
 
   /* Obtain and parse memory from system environment. */
   if(env_memory_parse(mem_chunks, NR_MEMS) != OK) 
-        vm_panic("couldn't obtain memory chunks", NO_NUM); 
+        panic("couldn't obtain memory chunks"); 
    
   /* Round physical memory to clicks. Round start up, round end down. */
   for (i = 0; i < NR_MEMS; i++) {
@@ -110,8 +110,8 @@ struct mem_map *map_ptr;                        /* memory to remove */
   }
   if (memp >= &mem_chunks[NR_MEMS])
   {
-        vm_panic("reserve_proc_mem: can't find map in mem_chunks ",
-                map_ptr[T].mem_phys);
+               panic("reserve_proc_mem: can't find map in mem_chunks: 0x%lx",
+                       map_ptr[T].mem_phys);
   }
 } 
 
@@ -160,7 +160,7 @@ char *brk_addr;
 
 /* VM wants to call brk() itself. */
         if((r=real_brk(vmm, (vir_bytes) brk_addr)) != OK)
-               vm_panic("VM: brk() on myself failed\n", NO_NUM);
+               panic("VM: brk() on myself failed");
         _brksize = brk_addr;
         return 0;
 }
index b737c44805aa7000575022ceca49a0f24f8907cd..ff1277755b926e7b1dbcb1f56cf17b097d9604a5 100644 (file)
 #define FIFO_WAIT(fid) {                                                      \
        int a;                                                                \
        if(read(fid, &a, sizeof(a)) != sizeof(a))                             \
-               panic(__FILE__, "FIFO_WAIT failed", NO_NUM);                  \
+               panic("FIFO_WAIT failed");                  \
 }
 #define FIFO_NOTIFY(fid) {                                                    \
        int a = 1;                                                            \
        if(write(fid, &a, sizeof(a)) != sizeof(a))                            \
-               panic(__FILE__, "FIFO_NOTIFY failed", NO_NUM);                \
+               panic("FIFO_NOTIFY failed");                \
 }
 
 #define DEBUG 0
index 32ef9c61e8efe3bbd88f389b78c6d99b5a1de313..faa460c309515f915026d958bf2b609a0f0fbfa9 100644 (file)
 #define FIFO_WAIT(fid) {                                                      \
        int a;                                                                \
        if(read(fid, &a, sizeof(a)) != sizeof(a))                             \
-               panic(__FILE__, "FIFO_WAIT failed", NO_NUM);                  \
+               panic( "FIFO_WAIT failed");                  \
 }
 #define FIFO_NOTIFY(fid) {                                                    \
        int a = 1;                                                            \
        if(write(fid, &a, sizeof(a)) != sizeof(a))                            \
-               panic(__FILE__, "FIFO_NOTIFY failed", NO_NUM);                \
+               panic( "FIFO_NOTIFY failed");                \
 }
 
 #define CHECK_TEST(who, result, expected, test_name) {                        \
index 893f29ec985c499d1e452004a3042782b44ffc91..0a9d2a77e8f266bbd4f951085d7979fbb25bd9e9 100644 (file)
 #define FIFO_WAIT(fid) {                                                      \
        int a;                                                                \
        if(read(fid, &a, sizeof(a)) != sizeof(a))                             \
-               panic(__FILE__, "FIFO_WAIT failed", NO_NUM);                  \
+               panic( "FIFO_WAIT failed");                  \
 }
 #define FIFO_NOTIFY(fid) {                                                    \
        int a = 1;                                                            \
        if(write(fid, &a, sizeof(a)) != sizeof(a))                            \
-               panic(__FILE__, "FIFO_NOTIFY failed", NO_NUM);                \
+               panic( "FIFO_NOTIFY failed");                \
 }
 
 #define REPORT_TEST(who, test_name, diff) {                                   \
index f348aae6682c1fadea0ae445a8aeb51e83745cb9..c09fc135f8cb42d3212a4ec7ece87c7cbbb38f54 100644 (file)
@@ -19,7 +19,7 @@ void read_write_buff(char* buff, int size, int is_write)
        char c;
 
        if(size % CLICK_SIZE != 0) {
-               panic("REQUESTOR", "buff_size not page aligned", NO_NUM);
+               panic("buff_size not page aligned");
        }
        if(is_write) {
            for(i=0;i<size;i+=CLICK_SIZE) buff[i] = 1;