From: Ben Gras Date: Wed, 11 Jul 2007 13:38:13 +0000 (+0000) Subject: . clarify panic messages in syslib about pci X-Git-Tag: v3.1.4~374 X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/zones/static/man.7.txt?a=commitdiff_plain;h=ee3e40516ba9b76eedaf9affb5e266cbff05ccc4;p=minix.git . clarify panic messages in syslib about pci . use ds_retrieve_u32 instead of _pm_findproc --- diff --git a/lib/syslib/pci_attr_r16.c b/lib/syslib/pci_attr_r16.c index 6aff1aa5a..03de6151a 100644 --- a/lib/syslib/pci_attr_r16.c +++ b/lib/syslib/pci_attr_r16.c @@ -22,10 +22,10 @@ int port; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_attr_r16: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_attr_r16: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_attr_r16: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_attr_r16: got bad reply from PCI", m.m_type); return m.m2_l1; } diff --git a/lib/syslib/pci_attr_r32.c b/lib/syslib/pci_attr_r32.c index aa9bd7a91..0a3aefe49 100644 --- a/lib/syslib/pci_attr_r32.c +++ b/lib/syslib/pci_attr_r32.c @@ -22,10 +22,10 @@ int port; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_attr_r32: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_attr_r32: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_attr_r32: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_attr_r32: got bad reply from PCI", m.m_type); return m.m2_l1; } diff --git a/lib/syslib/pci_attr_r8.c b/lib/syslib/pci_attr_r8.c index 95f4ce27e..d08a6851e 100644 --- a/lib/syslib/pci_attr_r8.c +++ b/lib/syslib/pci_attr_r8.c @@ -22,10 +22,10 @@ int port; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_attr_r8: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_attr_r8: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_attr_r8: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_attr_r8: got bad reply from PCI", m.m_type); return m.m2_l1; } diff --git a/lib/syslib/pci_attr_w16.c b/lib/syslib/pci_attr_w16.c index 7c13ed6a1..a201f5c00 100644 --- a/lib/syslib/pci_attr_w16.c +++ b/lib/syslib/pci_attr_w16.c @@ -24,9 +24,9 @@ u16_t value; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_attr_w16: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_attr_w16: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_attr_w16: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_attr_w16: got bad reply from PCI", m.m_type); } diff --git a/lib/syslib/pci_attr_w32.c b/lib/syslib/pci_attr_w32.c index 887dd0752..775570b68 100644 --- a/lib/syslib/pci_attr_w32.c +++ b/lib/syslib/pci_attr_w32.c @@ -24,9 +24,9 @@ u32_t value; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_attr_w32: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_attr_w32: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_attr_w32: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_attr_w32: got bad reply from PCI", m.m_type); } diff --git a/lib/syslib/pci_attr_w8.c b/lib/syslib/pci_attr_w8.c index a764d3a51..f4fa9eb2f 100644 --- a/lib/syslib/pci_attr_w8.c +++ b/lib/syslib/pci_attr_w8.c @@ -24,9 +24,9 @@ u8_t value; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_attr_w8: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_attr_w8: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_attr_w8: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_attr_w8: got bad reply from PCI", m.m_type); } diff --git a/lib/syslib/pci_del_acl.c b/lib/syslib/pci_del_acl.c index 6a09cc30f..3ab86db58 100644 --- a/lib/syslib/pci_del_acl.c +++ b/lib/syslib/pci_del_acl.c @@ -6,6 +6,7 @@ pci_del_acl.c #include "syslib.h" #include #include +#include #include /*===========================================================================* @@ -16,16 +17,18 @@ endpoint_t proc_nr; { int r; message m; + u32_t u32; if (pci_procnr == ANY) { - r= _pm_findproc("pci", &pci_procnr); + r= ds_retrieve_u32("pci", &u32); if (r != 0) { - panic("pci", + panic("syslib/" __FILE__, "pci_del_acl: _pm_findproc failed for 'pci'", r); } + pci_procnr = u32; } @@ -34,7 +37,7 @@ endpoint_t proc_nr; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_del_acl: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_del_acl: can't talk to PCI", r); return m.m_type; } diff --git a/lib/syslib/pci_dev_name.c b/lib/syslib/pci_dev_name.c index 0bc6f552c..cd21f87d9 100644 --- a/lib/syslib/pci_dev_name.c +++ b/lib/syslib/pci_dev_name.c @@ -37,7 +37,7 @@ u16_t did; r= sendrec(pci_procnr, &m); cpf_revoke(gid); if (r != 0) - panic("pci", "pci_dev_name: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_dev_name: can't talk to PCI", r); if (m.m_type == ENOENT) { @@ -45,7 +45,7 @@ u16_t did; return NULL; /* No name for this device */ } if (m.m_type != 0) - panic("pci", "pci_dev_name: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_dev_name: got bad reply from PCI", m.m_type); name[sizeof(name)-1]= '\0'; /* Make sure that the string is NUL * terminated. diff --git a/lib/syslib/pci_find_dev.c b/lib/syslib/pci_find_dev.c index c498ddec6..db60548cb 100644 --- a/lib/syslib/pci_find_dev.c +++ b/lib/syslib/pci_find_dev.c @@ -25,7 +25,7 @@ int *devindp; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_find_dev: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_find_dev: can't talk to PCI", r); if (m.m_type == 1) { @@ -35,7 +35,7 @@ int *devindp; return 1; } if (m.m_type != 0) - panic("pci", "pci_find_dev: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_find_dev: got bad reply from PCI", m.m_type); printf("pci_find_dev: got nothing\n"); return 0; diff --git a/lib/syslib/pci_first_dev.c b/lib/syslib/pci_first_dev.c index 9fd06de75..55d51f6b0 100644 --- a/lib/syslib/pci_first_dev.c +++ b/lib/syslib/pci_first_dev.c @@ -20,7 +20,7 @@ u16_t *didp; m.m_type= BUSC_PCI_FIRST_DEV; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_first_dev: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_first_dev: can't talk to PCI", 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("pci", "pci_first_dev: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_first_dev: got bad reply from PCI", m.m_type); #if DEBUG printf("pci_first_dev: got nothing\n"); diff --git a/lib/syslib/pci_ids.c b/lib/syslib/pci_ids.c index 33f839fd2..38c30a485 100644 --- a/lib/syslib/pci_ids.c +++ b/lib/syslib/pci_ids.c @@ -22,10 +22,10 @@ u16_t *didp; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_ids: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_ids: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_ids: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_ids: got bad reply from PCI", m.m_type); *vidp= m.m1_i1; *didp= m.m1_i2; printf("pci_ids: %04x/%04x\n", *vidp, *didp); diff --git a/lib/syslib/pci_init1.c b/lib/syslib/pci_init1.c index 0e6d6b32f..89d241acd 100644 --- a/lib/syslib/pci_init1.c +++ b/lib/syslib/pci_init1.c @@ -23,7 +23,7 @@ char *name; r= ds_retrieve_u32("pci", &u32); if (r != 0) - panic("pci", "pci_init1: ds_retrieve_u32 failed for 'pci'", r); + panic("syslib/" __FILE__, "pci_init1: ds_retrieve_u32 failed for 'pci'", r); pci_procnr= u32; m.m_type= BUSC_PCI_INIT; @@ -38,8 +38,8 @@ char *name; } r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_init1: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_init1: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_init1: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_init1: got bad reply from PCI", m.m_type); } diff --git a/lib/syslib/pci_next_dev.c b/lib/syslib/pci_next_dev.c index 399c72d4e..547186881 100644 --- a/lib/syslib/pci_next_dev.c +++ b/lib/syslib/pci_next_dev.c @@ -22,7 +22,7 @@ u16_t *didp; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_next_dev: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_next_dev: can't talk to PCI", r); if (m.m_type == 1) { @@ -36,7 +36,7 @@ u16_t *didp; return 1; } if (m.m_type != 0) - panic("pci", "pci_next_dev: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_next_dev: got bad reply from PCI", m.m_type); return 0; } diff --git a/lib/syslib/pci_rescan_bus.c b/lib/syslib/pci_rescan_bus.c index 7542b202d..ef0aed1ef 100644 --- a/lib/syslib/pci_rescan_bus.c +++ b/lib/syslib/pci_rescan_bus.c @@ -20,11 +20,11 @@ u8_t busnr; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_rescan_bus: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_rescan_bus: can't talk to PCI", r); if (m.m_type != 0) { - panic("pci", "pci_rescan_bus: got bad reply from PCI", + panic("syslib/" __FILE__, "pci_rescan_bus: got bad reply from PCI", m.m_type); } } diff --git a/lib/syslib/pci_reserve.c b/lib/syslib/pci_reserve.c index 3c0941ad0..b00d6d826 100644 --- a/lib/syslib/pci_reserve.c +++ b/lib/syslib/pci_reserve.c @@ -20,10 +20,10 @@ int devind; r= sendrec(pci_procnr, &m); if (r != 0) - panic("pci", "pci_reserve: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_reserve: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_reserve: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_reserve: got bad reply from PCI", m.m_type); } /*===========================================================================* diff --git a/lib/syslib/pci_set_acl.c b/lib/syslib/pci_set_acl.c index d5ee446a5..8e8885322 100644 --- a/lib/syslib/pci_set_acl.c +++ b/lib/syslib/pci_set_acl.c @@ -6,6 +6,7 @@ pci_set_acl.c #include "syslib.h" #include #include +#include #include /*===========================================================================* @@ -17,16 +18,18 @@ struct rs_pci *rs_pci; int r; cp_grant_id_t gid; message m; + u32_t u32; if (pci_procnr == ANY) { - r= _pm_findproc("pci", &pci_procnr); + r= ds_retrieve_u32("pci", &u32); if (r != 0) { - panic("pci", - "pci_set_acl: _pm_findproc failed for 'pci'", + panic("syslib/" __FILE__, + "pci_set_acl: ds_retrieve_u32 failed for 'pci'", r); } + pci_procnr = u32; } @@ -45,7 +48,7 @@ struct rs_pci *rs_pci; r= sendrec(pci_procnr, &m); cpf_revoke(gid); if (r != 0) - panic("pci", "pci_set_acl: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_set_acl: can't talk to PCI", r); return m.m_type; } diff --git a/lib/syslib/pci_slot_name.c b/lib/syslib/pci_slot_name.c index 98c049b4c..ad2d84092 100644 --- a/lib/syslib/pci_slot_name.c +++ b/lib/syslib/pci_slot_name.c @@ -35,10 +35,10 @@ int devind; r= sendrec(pci_procnr, &m); cpf_revoke(gid); if (r != 0) - panic("pci", "pci_slot_name: can't talk to PCI", r); + panic("syslib/" __FILE__, "pci_slot_name: can't talk to PCI", r); if (m.m_type != 0) - panic("pci", "pci_slot_name: got bad reply from PCI", m.m_type); + panic("syslib/" __FILE__, "pci_slot_name: got bad reply from PCI", m.m_type); name[sizeof(name)-1]= '\0'; /* Make sure that the string is NUL * terminated.