aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2016-10-15 05:53:09 +0000
committerWarner Losh <imp@FreeBSD.org>2016-10-15 05:53:09 +0000
commit40dd3b0bf11c3cded6bde4fd5b31080d3bee3bde (patch)
treecec4551827ab8ec9928d181667fc80f52b92d690
parent09c305eb65f6d4d5a0c17466e8dad8441988b905 (diff)
downloadsrc-40dd3b0bf11c3cded6bde4fd5b31080d3bee3bde.tar.gz
src-40dd3b0bf11c3cded6bde4fd5b31080d3bee3bde.zip
Create a pcibios-version environment FORTH word. This allows one to
conditionally compile forth code before using the pcibios- words.
Notes
Notes: svn path=/head/; revision=307338
-rw-r--r--sys/boot/i386/libi386/biospci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/boot/i386/libi386/biospci.c b/sys/boot/i386/libi386/biospci.c
index c6e553800248..331f1526617e 100644
--- a/sys/boot/i386/libi386/biospci.c
+++ b/sys/boot/i386/libi386/biospci.c
@@ -190,7 +190,6 @@ static struct pci_class
{-1, NULL, NULL}
};
-
static void biospci_enumerate(void);
static void biospci_addinfo(int devid, struct pci_class *pc, struct pci_subclass *psc, struct pci_progif *ppi);
@@ -199,6 +198,7 @@ struct pnphandler biospcihandler =
"PCI BIOS",
biospci_enumerate
};
+static int biospci_version;
#define PCI_BIOS_PRESENT 0xb101
#define FIND_PCI_DEVICE 0xb102
@@ -254,7 +254,7 @@ biospci_detect(void)
setenv("pcibios.config2", buf, 1);
sprintf(buf, "%d", maxbus);
setenv("pcibios.maxbus", buf, 1);
-
+ biospci_version = bcd2bin((version >> 8) & 0xf) * 10 + bcd2bin(version & 0xf);
}
static void
@@ -577,6 +577,8 @@ static void ficlCompilePciBios(FICL_SYSTEM *pSys)
dictAppendWord(dp, "pcibios-find-devclass", ficlPciBiosFindDevclass, FW_DEFAULT);
dictAppendWord(dp, "pcibios-find-device", ficlPciBiosFindDevice, FW_DEFAULT);
dictAppendWord(dp, "pcibios-locator", ficlPciBiosLocator, FW_DEFAULT);
+
+ ficlSetEnv(pSys, "pcibios-version", biospci_version);
}
FICL_COMPILE_SET(ficlCompilePciBios);