X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fpci.c;h=0813ba7fc9e595c214db4e0286ccafa11be10ef0;hb=3cb6f9dad7e37db865bd3cbccf0b5d6471fdd73f;hp=c5cd65e38680123ebe480e2bd04a34ec4c6e24d0;hpb=91253d061647c194cdc8c16c9ae85eccdf942139;p=bootcensus
diff --git a/src/pci.c b/src/pci.c
index c5cd65e..0813ba7 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)