From owner-svn-src-head@freebsd.org Sat Oct 15 05:53:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36F56C12EF9; Sat, 15 Oct 2016 05:53:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 05374BBD; Sat, 15 Oct 2016 05:53:10 +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 u9F5rAFH080193; Sat, 15 Oct 2016 05:53:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9F5rAMF080192; Sat, 15 Oct 2016 05:53:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610150553.u9F5rAMF080192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 15 Oct 2016 05:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307338 - head/sys/boot/i386/libi386 X-SVN-Group: head 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.23 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: Sat, 15 Oct 2016 05:53:11 -0000 Author: imp Date: Sat Oct 15 05:53:09 2016 New Revision: 307338 URL: https://svnweb.freebsd.org/changeset/base/307338 Log: Create a pcibios-version environment FORTH word. This allows one to conditionally compile forth code before using the pcibios- words. Modified: head/sys/boot/i386/libi386/biospci.c Modified: head/sys/boot/i386/libi386/biospci.c ============================================================================== --- head/sys/boot/i386/libi386/biospci.c Sat Oct 15 01:41:28 2016 (r307337) +++ head/sys/boot/i386/libi386/biospci.c Sat Oct 15 05:53:09 2016 (r307338) @@ -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_SYST 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);