. clarify panic messages in syslib about pci

. use ds_retrieve_u32 instead of _pm_findproc
This commit is contained in:
Ben Gras 2007-07-11 13:38:13 +00:00
parent c829928cf1
commit ee3e40516b
17 changed files with 44 additions and 38 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -6,6 +6,7 @@ pci_del_acl.c
#include "syslib.h"
#include <unistd.h>
#include <minix/rs.h>
#include <minix/ds.h>
#include <minix/sysutil.h>
/*===========================================================================*
@ -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;
}

View file

@ -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.

View file

@ -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;

View file

@ -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");

View file

@ -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);

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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);
}
}

View file

@ -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);
}
/*===========================================================================*

View file

@ -6,6 +6,7 @@ pci_set_acl.c
#include "syslib.h"
#include <unistd.h>
#include <minix/rs.h>
#include <minix/ds.h>
#include <minix/sysutil.h>
/*===========================================================================*
@ -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;
}

View file

@ -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.