Changed pci_dev_name and pci_slot_name to use safecopies.
Mae it possible to disable the use of safecopies in kputc for debugging.
sys_nice.c \
sys_out.c \
sys_physcopy.c \
+ sys_readbios.c \
sys_safecopy.c \
sys_vsafecopy.c \
sys_sdevio.c \
static char name[80]; /* We need a better interface for this */
int r;
+ cp_grant_id_t gid;
message m;
- m.m_type= BUSC_PCI_DEV_NAME;
- m.m1_i1= vid;
- m.m1_i2= did;
- m.m1_i3= sizeof(name);
- m.m1_p1= name;
+ gid= cpf_grant_direct(pci_procnr, (vir_bytes)name, sizeof(name),
+ CPF_WRITE);
+ if (gid == -1)
+ {
+ printf("pci_dev_name: cpf_grant_direct failed: %d\n",
+ errno);
+ return NULL;
+ }
+
+ m.m_type= BUSC_PCI_DEV_NAME_S;
+ m.m7_i1= vid;
+ m.m7_i2= did;
+ m.m7_i3= sizeof(name);
+ m.m7_i4= gid;
r= sendrec(pci_procnr, &m);
+ cpf_revoke(gid);
if (r != 0)
panic("pci", "pci_dev_name: can't talk to PCI", r);
static char name[80]; /* We need a better interface for this */
int r;
+ cp_grant_id_t gid;
message m;
- m.m_type= BUSC_PCI_SLOT_NAME;
+ gid= cpf_grant_direct(pci_procnr, (vir_bytes)name, sizeof(name),
+ CPF_WRITE);
+ if (gid == -1)
+ {
+ printf("pci_dev_name: cpf_grant_direct failed: %d\n",
+ errno);
+ return NULL;
+ }
+
+ m.m_type= BUSC_PCI_SLOT_NAME_S;
m.m1_i1= devind;
m.m1_i2= sizeof(name);
- m.m1_p1= name;
+ m.m1_i3= gid;
r= sendrec(pci_procnr, &m);
+ cpf_revoke(gid);
if (r != 0)
panic("pci", "pci_slot_name: can't talk to PCI", r);
name[sizeof(name)-1]= '\0'; /* Make sure that the string is NUL
* terminated.
*/
-
- printf("pci_slot_name: got name %s\n", name);
return name;
}
--- /dev/null
+#include "syslib.h"
+
+PUBLIC int sys_readbios(address, buf, size)
+phys_bytes address; /* Absolute memory address */
+void *buf; /* Buffer to store the results */
+size_t size; /* Amount of data to read */
+{
+/* Read data from BIOS locations */
+ message m;
+
+ m.RDB_SIZE = size;
+ m.RDB_ADDR = address;
+ m.RDB_BUF = buf;
+ return(_taskcall(SYSTASK, SYS_READBIOS, &m));
+}
static char print_buf[80]; /* output is buffered here */
+int kputc_use_private_grants= 0;
+
/*===========================================================================*
* kputc *
*===========================================================================*/
static cp_grant_id_t printgrants[PRINTPROCS];
int p;
+ if (kputc_use_private_grants)
+ {
+ for (p= 0; p<PRINTPROCS; p++)
+ printgrants[p]= GRANT_INVALID;
+ firstprint= 0;
+ }
if(firstprint) {
for(p = 0; procs[p] != NONE; p++) {
printgrants[p] = GRANT_INVALID;