ref: 5fd97c7d605e3d72232c11d1f93911f7bd2f772d
parent: ca4e12839aa7234104c5d455046c8ea20af64dec
author: cinap_lenrek <[email protected]>
date: Thu Apr 9 10:55:01 EDT 2015
pc, pc64: remove PCICONS debug buffer from pci.c
--- a/sys/src/9/pc/pci.c
+++ b/sys/src/9/pc/pci.c
@@ -10,30 +10,8 @@
#include "io.h"
#include "../port/error.h"
-#define DBG if(0) pcilog
+#define DBG if(0) print
-struct
-{
- char output[16384];
- int ptr;
-}PCICONS;
-
-int
-pcilog(char *fmt, ...)
-{
- int n;
- va_list arg;
- char buf[PRINTSIZE];
-
- va_start(arg, fmt);
- n = vseprint(buf, buf+sizeof(buf), fmt, arg) - buf;
- va_end(arg);
-
- memmove(PCICONS.output+PCICONS.ptr, buf, n);
- PCICONS.ptr += n;
- return n;
-}
-
enum
{ /* configuration mechanism #1 */
PciADDR = 0xCF8, /* CONFIG_ADDRESS */
@@ -211,7 +189,7 @@
for(p = root; p != nil; p = p->link) {
if(p->ccrb == 0x06) {
if(p->ccru != 0x04 || p->bridge == nil) {
-// DBG("pci: ignored bridge %T\n", p->tbdf);
+ DBG("pci: ignored bridge %T\n", p->tbdf);
continue;
}
@@ -1068,7 +1046,7 @@
ioa = 0x1000;
mema = 0x90000000;
- pcilog("Mask sizes: mem=%lux io=%lux\n", mema, ioa);
+ DBG("Mask sizes: mem=%lux io=%lux\n", mema, ioa);
pcibusmap(pciroot, &mema, &ioa, 1);
DBG("Sizes2: mem=%lux io=%lux\n", mema, ioa);
@@ -1335,7 +1313,6 @@
Pcidev *t;
if(p == nil) {
- putstrn(PCICONS.output, PCICONS.ptr);
p = pciroot;
print("bus dev type vid did intl memory\n");
}