From owner-svn-src-head@freebsd.org Fri Feb 2 15:01:45 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 4F521EDDBA3; Fri, 2 Feb 2018 15:01:45 +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 058F96EC4C; Fri, 2 Feb 2018 15:01:45 +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 DBD3F1D4A5; Fri, 2 Feb 2018 15:01:44 +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 w12F1isU015335; Fri, 2 Feb 2018 15:01:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w12F1iL0015330; Fri, 2 Feb 2018 15:01:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802021501.w12F1iL0015330@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:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328780 - in head: . stand/efi/libefi stand/forth X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . stand/efi/libefi stand/forth X-SVN-Commit-Revision: 328780 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:45 -0000 Author: imp Date: Fri Feb 2 15:01:44 2018 New Revision: 328780 URL: https://svnweb.freebsd.org/changeset/base/328780 Log: These 4th words were an attempt to allow integration into the boot loader scripts. However, that path won't be taken after all it seems. Remove this code before it decays into uselessness. Also remove build dependencies on forth no longer needed. Modified: head/ObsoleteFiles.inc head/stand/efi/libefi/Makefile head/stand/efi/libefi/env.c head/stand/forth/Makefile head/stand/forth/loader.4th Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Feb 2 15:01:33 2018 (r328779) +++ head/ObsoleteFiles.inc Fri Feb 2 15:01:44 2018 (r328780) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180201: Obsolete forth files +OLD_FILES+=boot/efi.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 OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h Modified: head/stand/efi/libefi/Makefile ============================================================================== --- head/stand/efi/libefi/Makefile Fri Feb 2 15:01:33 2018 (r328779) +++ head/stand/efi/libefi/Makefile Fri Feb 2 15:01:44 2018 (r328780) @@ -2,10 +2,6 @@ .include -.if ${MK_FORTH} != "no" -.include "${BOOTSRC}/ficl.mk" -.endif - LIB= efi WARNS?= 2 Modified: head/stand/efi/libefi/env.c ============================================================================== --- head/stand/efi/libefi/env.c Fri Feb 2 15:01:33 2018 (r328779) +++ head/stand/efi/libefi/env.c Fri Feb 2 15:01:44 2018 (r328780) @@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include "bootstrap.h" -#ifdef BOOT_FORTH -#include "ficl.h" -#endif /* * Simple wrappers to the underlying UEFI functions. @@ -375,160 +372,3 @@ command_efi_unset(int argc, char *argv[]) } return (CMD_OK); } - -#ifdef BOOT_FORTH -/* - * FreeBSD's loader interaction words and extras - * - * efi-setenv ( value n name n guid n attr -- 0 | -1) - * efi-getenv ( guid n addr n -- addr' n' | -1 ) - * efi-unsetenv ( name n guid n'' -- ) - */ - -/* - * efi-setenv - * efi-setenv ( value n name n guid n attr -- 0 | -1) - * - * Set environment variables using the SetVariable EFI runtime service. - * - * Value and guid are passed through in binary form (so guid needs to be - * converted to binary form from its string form). Name is converted from - * ASCII to CHAR16. Since ficl doesn't have support for internationalization, - * there's no native CHAR16 interface provided. - * - * attr is an int in the bitmask of the following attributes for this variable. - * - * 1 Non volatile - * 2 Boot service access - * 4 Run time access - * (corresponding to the same bits in the UEFI spec). - */ -static void -ficlEfiSetenv(FICL_VM *pVM) -{ - char *value = NULL, *guid = NULL; - CHAR16 *name = NULL; - int i; - char *namep, *valuep, *guidp; - int names, values, guids, attr; - EFI_STATUS status; - uuid_t u; - uint32_t ustatus; - bool error = true; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 6, 0); -#endif - attr = stackPopINT(pVM->pStack); - guids = stackPopINT(pVM->pStack); - guidp = (char*)stackPopPtr(pVM->pStack); - names = stackPopINT(pVM->pStack); - namep = (char*)stackPopPtr(pVM->pStack); - values = stackPopINT(pVM->pStack); - valuep = (char*)stackPopPtr(pVM->pStack); - - guid = (char*)ficlMalloc(guids); - if (guid == NULL) - goto out; - memcpy(guid, guidp, guids); - uuid_from_string(guid, &u, &ustatus); - if (ustatus != uuid_s_ok) { - stackPushINT(pVM->pStack, -1); - goto out; - } - - name = ficlMalloc((names + 1) * sizeof(CHAR16)); - if (name == NULL) - goto out; - for (i = 0; i < names; i++) - name[i] = namep[i]; - name[names] = 0; - - value = ficlMalloc(values + 1); - if (value == NULL) - goto out; - memcpy(value, valuep, values); - - status = efi_set_variable(name, (EFI_GUID *)&u, attr, values, value); - if (status == EFI_SUCCESS) - stackPushINT(pVM->pStack, 0); - else - stackPushINT(pVM->pStack, -1); - error = false; -out: - ficlFree(name); - ficlFree(value); - ficlFree(guid); - - if (error == true) - vmThrowErr(pVM, "Error: out of memory"); -} - -static void -ficlEfiGetenv(FICL_VM *pVM) -{ - char *name, *value; - char *namep; - int names; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 2, 2); -#endif - names = stackPopINT(pVM->pStack); - namep = (char*) stackPopPtr(pVM->pStack); - - name = (char*) ficlMalloc(names+1); - if (name == NULL) - vmThrowErr(pVM, "Error: out of memory"); - strncpy(name, namep, names); - name[names] = '\0'; - - value = getenv(name); - ficlFree(name); - - if(value != NULL) { - stackPushPtr(pVM->pStack, value); - stackPushINT(pVM->pStack, strlen(value)); - } else - stackPushINT(pVM->pStack, -1); -} - -static void -ficlEfiUnsetenv(FICL_VM *pVM) -{ - char *name; - char *namep; - int names; - -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 2, 0); -#endif - names = stackPopINT(pVM->pStack); - namep = (char*) stackPopPtr(pVM->pStack); - - name = (char*) ficlMalloc(names+1); - if (name == NULL) - vmThrowErr(pVM, "Error: out of memory"); - strncpy(name, namep, names); - name[names] = '\0'; - - unsetenv(name); - ficlFree(name); -} - -/************************************************************************** -** Add FreeBSD UEFI platform extensions into the system dictionary -**************************************************************************/ -void ficlEfiCompilePlatform(FICL_SYSTEM *pSys) -{ - FICL_DICT *dp = pSys->dp; - assert (dp); - - dictAppendWord(dp, "efi-setenv", ficlEfiSetenv, FW_DEFAULT); - dictAppendWord(dp, "efi-getenv", ficlEfiGetenv, FW_DEFAULT); - dictAppendWord(dp, "efi-unsetenv", ficlEfiUnsetenv, FW_DEFAULT); -} - -FICL_COMPILE_SET(ficlEfiCompilePlatform); - -#endif /* BOOT_FORTH */ Modified: head/stand/forth/Makefile ============================================================================== --- head/stand/forth/Makefile Fri Feb 2 15:01:33 2018 (r328779) +++ head/stand/forth/Makefile Fri Feb 2 15:01:44 2018 (r328780) @@ -19,7 +19,6 @@ FILES+= brand-fbsd.4th FILES+= check-password.4th FILES+= color.4th FILES+= delay.4th -FILES+= efi.4th FILES+= frames.4th FILES+= loader.4th FILES+= logo-beastie.4th Modified: head/stand/forth/loader.4th ============================================================================== --- head/stand/forth/loader.4th Fri Feb 2 15:01:33 2018 (r328779) +++ head/stand/forth/loader.4th Fri Feb 2 15:01:44 2018 (r328780) @@ -46,9 +46,6 @@ include /boot/support.4th include /boot/color.4th include /boot/delay.4th include /boot/check-password.4th -s" efi-version" getenv? [if] - include /boot/efi.4th -[then] only forth definitions