X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fpci.c;h=93ea560d1d31d64a2b5391693d545aab53864dbd;hb=0a37e241149d011e038aceb3faac568b405f8ecd;hp=c5cd65e38680123ebe480e2bd04a34ec4c6e24d0;hpb=91253d061647c194cdc8c16c9ae85eccdf942139;p=bootcensus
diff --git a/src/pci.c b/src/pci.c
index c5cd65e..93ea560 100644
--- a/src/pci.c
+++ b/src/pci.c
@@ -19,6 +19,7 @@ along with this program. If not, see .
#include
#include
#include "pci.h"
+#include "intr.h"
#include "int86.h"
#include "asmops.h"
#include "panic.h"
@@ -69,12 +70,18 @@ static uint32_t (*cfg_read32)(int, int, int, int);
void init_pci(void)
{
int i, count = 0;
+ int intrflag;
struct int86regs regs;
+ intrflag = get_intr_flag();
+
memset(®s, 0, sizeof regs);
regs.eax = 0xb101;
int86(0x1a, ®s);
+ /* restore interrupt state in case bios changed it */
+ set_intr_flag(intrflag);
+
/* PCI BIOS present if CF=0, AH=0, and EDX has the "PCI " sig FOURCC */
if((regs.flags & FLAGS_CARRY) || (regs.eax & 0xff00) || regs.edx != PCI_SIG) {
printf("No PCI BIOS present\n");
@@ -96,7 +103,7 @@ void init_pci(void)
for(i=0; i<256; i++) {
count += enum_bus(i);
}
- printf("found %d PCI devices\n", count);
+ printf("found %d PCI devices\n\n", count);
}
static int enum_bus(int busid)
@@ -122,7 +129,7 @@ static int enum_dev(int busid, int dev)
if(read_dev_info(&info, busid, dev, 0) == -1) {
return 0;
}
- print_dev_info(&info, busid, dev, 0);
+ /*print_dev_info(&info, busid, dev, 0);*/
count = 1;
@@ -131,7 +138,7 @@ static int enum_dev(int busid, int dev)
if(read_dev_info(&info, busid, dev, i) == -1) {
continue;
}
- print_dev_info(&info, busid, dev, i);
+ /*print_dev_info(&info, busid, dev, i);*/
count++;
}
}