From owner-svn-src-head@freebsd.org Fri Feb 2 15:01:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4836EEDDBF5; Fri, 2 Feb 2018 15:01:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C33AB6ECE5; Fri, 2 Feb 2018 15:01:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D54651D4AE; Fri, 2 Feb 2018 15:01:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w12F1nKV016172; Fri, 2 Feb 2018 15:01:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w12F1nG2016169; Fri, 2 Feb 2018 15:01:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802021501.w12F1nG2016169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Feb 2018 15:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328781 - in head: . stand/forth stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . stand/forth stand/i386/libi386 X-SVN-Commit-Revision: 328781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2018 15:01:53 -0000 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 #include #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