Create a pcibios-version environment FORTH word. This allows one to

conditionally compile forth code before using the pcibios- words.
This commit is contained in:
Warner Losh 2016-10-15 05:53:09 +00:00
parent 09c305eb65
commit 40dd3b0bf1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=307338

View File

@ -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);