From owner-svn-src-head@freebsd.org Thu Feb 20 00:46:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 771D3249A32; Thu, 20 Feb 2020 00:46:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48NG9j235hz3PMk; Thu, 20 Feb 2020 00:46:17 +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 3FF1D1965D; Thu, 20 Feb 2020 00:46:17 +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 01K0kHkK061929; Thu, 20 Feb 2020 00:46:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01K0kGNO061926; Thu, 20 Feb 2020 00:46:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002200046.01K0kGNO061926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 20 Feb 2020 00:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358135 - in head/stand: efi/loader i386/libi386 i386/loader libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: efi/loader i386/libi386 i386/loader libsa X-SVN-Commit-Revision: 358135 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.29 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: Thu, 20 Feb 2020 00:46:17 -0000 Author: imp Date: Thu Feb 20 00:46:16 2020 New Revision: 358135 URL: https://svnweb.freebsd.org/changeset/base/358135 Log: Create ptov() function. Create a ptov() function. It's basically the same as the btx PTOV macro, but works everywhere. smbios needs this to translate addresses, but the translation differs between BIOS booting and EFI booting. Make it a function so one smbios.o can be used everywhere. Provide definitions for it in the two loaders affected. Differential Revision: https://reviews.freebsd.org/D23660 Modified: head/stand/efi/loader/main.c head/stand/i386/libi386/smbios.c head/stand/i386/loader/main.c head/stand/libsa/stand.h Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Feb 20 00:34:46 2020 (r358134) +++ head/stand/efi/loader/main.c Thu Feb 20 00:46:16 2020 (r358135) @@ -852,7 +852,11 @@ read_loader_env(const char *name, char *def_fn, bool o } } - +caddr_t +ptov(uintptr_t x) +{ + return ((caddr_t)x); +} EFI_STATUS main(int argc, CHAR16 *argv[]) Modified: head/stand/i386/libi386/smbios.c ============================================================================== --- head/stand/i386/libi386/smbios.c Thu Feb 20 00:34:46 2020 (r358134) +++ head/stand/i386/libi386/smbios.c Thu Feb 20 00:46:16 2020 (r358135) @@ -28,16 +28,9 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#ifdef EFI -/* In EFI, we don't need PTOV(). */ -#define PTOV(x) (caddr_t)(x) -#else -#include "btxv86.h" -#endif -#include "smbios.h" +#define PTOV(x) ptov(x) /* * Detect SMBIOS and export information about the SMBIOS into the Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Thu Feb 20 00:34:46 2020 (r358134) +++ head/stand/i386/loader/main.c Thu Feb 20 00:46:16 2020 (r358135) @@ -86,6 +86,12 @@ extern char end[]; static void *heap_top; static void *heap_bottom; +caddr_t +ptov(uintptr_t x) +{ + return (PTOV(x)); +} + int main(void) { Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Thu Feb 20 00:34:46 2020 (r358134) +++ head/stand/libsa/stand.h Thu Feb 20 00:46:16 2020 (r358135) @@ -452,4 +452,9 @@ const char *x86_hypervisor(void); #define reallocf(x, y) Reallocf(x, y, NULL, 0) #endif +/* + * va <-> pa routines. MD code must supply. + */ +caddr_t ptov(uintptr_t); + #endif /* STAND_H */