From: Ben Gras Date: Wed, 21 Feb 2007 17:49:35 +0000 (+0000) Subject: add/re-enable at_wini debug output X-Git-Tag: v3.1.3~64 X-Git-Url: http://zhaoyanbai.com/repos/icons/debian/static//%22http:/%22%29?a=commitdiff_plain;h=3bb73b431bfae35b2dbedda5522821ee35b7b704;p=minix.git add/re-enable at_wini debug output --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 4b3339106..a24c358e5 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -375,6 +375,9 @@ FORWARD _PROTOTYPE( int atapi_transfer, (int proc_nr, int opcode, u64_t position, iovec_t *iov, unsigned nr_req, int safe)); #endif +#define panic(f,m,n) at_panic(__LINE__, (f), (m), (n)) +FORWARD _PROTOTYPE( void at_panic, (int line, char *h, char *msg, int n)); + /* Entry points to this driver. */ PRIVATE struct driver w_dtab = { w_name, /* current device's name */ @@ -520,6 +523,9 @@ PRIVATE void init_drive(struct wini *w, int base_cmd, int base_ctl, w->base_cmd = base_cmd; w->base_ctl = base_ctl; w->base_dma = base_dma; + if(w_pci_debug) + printf("at_wini%d: drive %d: base_cmd 0x%x, base_ctl 0x%x, base_dma 0x%x\n", + w_instance, w-wini, w->base_cmd, w->base_ctl, w->base_dma); w->irq = irq; w->irq_mask = 1 << irq; w->irq_need_ack = ack; @@ -623,7 +629,7 @@ PRIVATE void init_params_pci(int skip) printf("atapci: couldn't enable IRQ line %d\n", irq); continue; } - } + } else if(w_pci_debug) printf("at_wini%d: dev %d: only compat drives\n", w_instance, devind); base_dma = pci_attr_r32(devind, PCI_BAR_5) & 0xfffffffc; @@ -641,9 +647,9 @@ PRIVATE void init_params_pci(int skip) base_cmd, base_ctl+PCI_CTL_OFF, base_dma, irq, 1, irq_hook, 1); if (w_pci_debug) - printf("atapci %d: 0x%x 0x%x irq %d\n", devind, base_cmd, base_ctl, irq); + printf("at_wini%d: atapci %d: 0x%x 0x%x irq %d\n", w_instance, devind, base_cmd, base_ctl, irq); w_next_drive += 2; - } else printf("atapci: ignored drives on primary channel, base %x\n", base_cmd); + } else printf("at_wini%d: atapci: ignored drives on primary channel, base %x\n", w_instance, base_cmd); } else { @@ -652,6 +658,9 @@ PRIVATE void init_params_pci(int skip) { if (wini[i].base_cmd == REG_CMD_BASE0) { wini[i].base_dma= base_dma; + if(w_pci_debug) + printf("at_wini%d: drive %d: base_dma 0x%x\n", + w_instance, i, wini[i].base_dma); pci_compat = 1; } } @@ -673,9 +682,11 @@ PRIVATE void init_params_pci(int skip) base_cmd, base_ctl+PCI_CTL_OFF, base_dma, irq, 1, irq_hook, 3); if (w_pci_debug) - printf("atapci %d: 0x%x 0x%x irq %d\n", devind, base_cmd, base_ctl, irq); + printf("at_wini%d: atapci %d: 0x%x 0x%x irq %d\n", + w_instance, devind, base_cmd, base_ctl, irq); w_next_drive += 2; - } else printf("atapci: ignored drives on secondary channel, base %x\n", base_cmd); + } else printf("at_wini%d: atapci: ignored drives on " + "secondary channel, base %x\n", w_instance, base_cmd); } else { @@ -684,6 +695,9 @@ PRIVATE void init_params_pci(int skip) { if (wini[i].base_cmd == REG_CMD_BASE1 && base_dma != 0) { wini[i].base_dma= base_dma+PCI_DMA_2ND_OFF; + if (w_pci_debug) + printf("at_wini%d: drive %d: base_dma 0x%x\n", + w_instance, i, wini[i].base_dma); pci_compat = 1; } } @@ -2622,3 +2636,15 @@ PRIVATE int atapi_intr_wait() #endif /* ENABLE_ATAPI */ +#undef panic + +PRIVATE void at_panic(line, h, msg, n) +int line; +char *h; +char *msg; +int n; +{ + printf("at_wini%d: panic at line %d: ", w_instance, line); + panic(h, msg, n); +} + diff --git a/kernel/system/do_privctl.c b/kernel/system/do_privctl.c index 2e34825a5..94e2be762 100644 --- a/kernel/system/do_privctl.c +++ b/kernel/system/do_privctl.c @@ -110,8 +110,8 @@ message *m_ptr; /* pointer to request message */ { priv(rp)->s_irq_tab[i]= priv.s_irq_tab[i]; #if 0 - kprintf("do_privctl: adding IRQ %d\n", - priv(rp)->s_irq_tab[i]); + kprintf("do_privctl: adding IRQ %d for %d\n", + priv(rp)->s_irq_tab[i], rp->p_endpoint); #endif } @@ -124,11 +124,10 @@ message *m_ptr; /* pointer to request message */ for (i= 0; is_io_tab[i]= priv.s_io_tab[i]; -#if 0 - kprintf("do_privctl: adding I/O range [%x..%x]\n", + kprintf("do_privctl: adding I/O range [%x..%x] for %d\n", priv(rp)->s_io_tab[i].ior_base, - priv(rp)->s_io_tab[i].ior_limit); -#endif + priv(rp)->s_io_tab[i].ior_limit, + rp->p_endpoint); } /* Check requests for IRQs */