svn commit: r328781 - in head: . stand/forth stand/i386/libi386

Warner Losh imp at FreeBSD.org
Fri Feb 2 15:01:53 UTC 2018


Author: imp
Date: Fri Feb  2 15:01:49 2018
New Revision: 328781
URL: https://svnweb.freebsd.org/changeset/base/328781

Log:
  Remove pcibios forth support.
  
  I had thought that this would be useful. However it was committed too
  late, and wound up being unused. It's in the way of future work now,
  so retire it rather than bring it forward.

Deleted:
  head/stand/forth/pcibios.4th
Modified:
  head/ObsoleteFiles.inc
  head/stand/forth/Makefile
  head/stand/i386/libi386/biospci.c

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Fri Feb  2 15:01:44 2018	(r328780)
+++ head/ObsoleteFiles.inc	Fri Feb  2 15:01:49 2018	(r328781)
@@ -40,6 +40,7 @@
 
 # 20180201: Obsolete forth files
 OLD_FILES+=boot/efi.4th
+OLD_FILES+=boot/pcibios.4th
 
 # 20180114: new clang import which bumps version from 5.0.1 to 6.0.0.
 OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h

Modified: head/stand/forth/Makefile
==============================================================================
--- head/stand/forth/Makefile	Fri Feb  2 15:01:44 2018	(r328780)
+++ head/stand/forth/Makefile	Fri Feb  2 15:01:49 2018	(r328781)
@@ -29,7 +29,6 @@ FILES+=	logo-orbbw.4th
 FILES+=	menu.4th
 FILES+=	menu-commands.4th
 FILES+=	menusets.4th
-FILES+=	pcibios.4th
 FILES+=	screen.4th
 FILES+=	shortcuts.4th
 FILES+=	support.4th

Modified: head/stand/i386/libi386/biospci.c
==============================================================================
--- head/stand/i386/libi386/biospci.c	Fri Feb  2 15:01:44 2018	(r328780)
+++ head/stand/i386/libi386/biospci.c	Fri Feb  2 15:01:49 2018	(r328781)
@@ -38,9 +38,6 @@ __FBSDID("$FreeBSD$");
 #include <isapnp.h>
 #include <btxv86.h>
 #include "libi386.h"
-#ifdef BOOT_FORTH
-#include "ficl.h"
-#endif
 
 /*
  * Stupid PCI BIOS interface doesn't let you simply enumerate everything
@@ -406,183 +403,3 @@ biospci_locator(int8_t bus, uint8_t device, uint8_t fu
 
 	return ((bus << 8) | ((device & 0x1f) << 3) | (function & 0x7));
 }
-
-/*
- * Counts the number of instances of devid we have in the system, as least as
- * far as the PCI BIOS is able to tell.
- */
-static int
-biospci_count_device_type(uint32_t devid)
-{
-	int i;
-
-	for (i = 0; 1; i++) {
-		v86.ctl = V86_FLAGS;
-		v86.addr = PCI_INT;
-		v86.eax = FIND_PCI_DEVICE;
-		v86.edx = devid & 0xffff;		/* EDX - Vendor ID */
-		v86.ecx = (devid >> 16) & 0xffff;	/* ECX - Device ID */
-		v86.esi = i;
-		v86int();
-		if (V86_CY(v86.efl) || (v86.eax & 0xff00))
-			break;
-
-	}
-	return i;
-}
-
-#ifdef BOOT_FORTH
-/*
- * pcibios-device-count (devid -- count)
- *
- * Returns the PCI BIOS' count of how many devices matching devid are in the system.
- * devid is the 32-bit vendor + device.
- */
-static void
-ficlPciBiosCountDevices(FICL_VM *pVM)
-{
-    uint32_t devid;
-    int i;
-
-    devid = stackPopINT(pVM->pStack);
-
-    i = biospci_count_device_type(devid);
-
-    stackPushINT(pVM->pStack, i);
-}
-
-/*
- * pcibios-write-config (locator offset width value -- )
- *
- * Writes the specified config register.
- * Locator is bus << 8 | device << 3 | fuction
- * offset is the pci config register
- * width is 0 for byte, 1 for word, 2 for dword
- * value is the value to write
- */
-static void
-ficlPciBiosWriteConfig(FICL_VM *pVM)
-{
-    uint32_t value, width, offset, locator;
-
-    value = stackPopINT(pVM->pStack);
-    width = stackPopINT(pVM->pStack);
-    offset = stackPopINT(pVM->pStack);
-    locator = stackPopINT(pVM->pStack);
-
-    biospci_write_config(locator, offset, width, value);
-}
-
-/*
- * pcibios-read-config (locator offset width -- value)
- *
- * Reads the specified config register.
- * Locator is bus << 8 | device << 3 | fuction
- * offset is the pci config register
- * width is 0 for byte, 1 for word, 2 for dword
- * value is the value to read from the register
- */
-static void
-ficlPciBiosReadConfig(FICL_VM *pVM)
-{
-    uint32_t value, width, offset, locator;
-
-    width = stackPopINT(pVM->pStack);
-    offset = stackPopINT(pVM->pStack);
-    locator = stackPopINT(pVM->pStack);
-
-    biospci_read_config(locator, offset, width, &value);
-
-    stackPushINT(pVM->pStack, value);
-}
-
-/*
- * pcibios-find-devclass (class index -- locator)
- *
- * Finds the index'th instance of class in the pci tree.
- * must be an exact match.
- * class is the class to search for.
- * index 0..N (set to 0, increment until error)
- *
- * Locator is bus << 8 | device << 3 | fuction (or -1 on error)
- */
-static void
-ficlPciBiosFindDevclass(FICL_VM *pVM)
-{
-    uint32_t index, class, locator;
-
-    index = stackPopINT(pVM->pStack);
-    class = stackPopINT(pVM->pStack);
-
-    if (biospci_find_devclass(class, index, &locator))
-	locator = 0xffffffff;
-
-    stackPushINT(pVM->pStack, locator);
-}
-
-/*
- * pcibios-find-device(devid index -- locator)
- *
- * Finds the index'th instance of devid in the pci tree.
- * must be an exact match.
- * class is the class to search for.
- * index 0..N (set to 0, increment until error)
- *
- * Locator is bus << 8 | device << 3 | fuction (or -1 on error)
- */
-static void
-ficlPciBiosFindDevice(FICL_VM *pVM)
-{
-    uint32_t index, devid, locator;
-
-    index = stackPopINT(pVM->pStack);
-    devid = stackPopINT(pVM->pStack);
-
-    if (biospci_find_device(devid, index, &locator))
-	locator = 0xffffffff;
-
-    stackPushINT(pVM->pStack, locator);
-}
-
-/*
- * pcibios-find-device(bus device function -- locator)
- *
- * converts bus, device, function to locator.
- *
- * Locator is bus << 8 | device << 3 | fuction
- */
-static void
-ficlPciBiosLocator(FICL_VM *pVM)
-{
-    uint32_t bus, device, function, locator;
-
-    function = stackPopINT(pVM->pStack);
-    device = stackPopINT(pVM->pStack);
-    bus = stackPopINT(pVM->pStack);
-
-    locator = biospci_locator(bus, device, function);
-
-    stackPushINT(pVM->pStack, locator);
-}
-
-/*
- * Glue function to add the appropriate forth words to access pci bios
- * functionality.
- */
-static void ficlCompilePciBios(FICL_SYSTEM *pSys)
-{
-    FICL_DICT *dp = pSys->dp;
-    assert (dp);
-
-    dictAppendWord(dp, "pcibios-device-count", ficlPciBiosCountDevices, FW_DEFAULT);
-    dictAppendWord(dp, "pcibios-read-config", ficlPciBiosReadConfig, FW_DEFAULT);
-    dictAppendWord(dp, "pcibios-write-config", ficlPciBiosWriteConfig, FW_DEFAULT);
-    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);
-#endif


More information about the svn-src-head mailing list