From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.22191.1678062132259075315 for ; Sun, 05 Mar 2023 16:22:12 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=iLaUuj0H; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: nathaniel.l.desimone@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678062132; x=1709598132; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Dd+iaFQUwgZKWeNSfNbMzz6GPMp7ZRgIOVkcLodqIT0=; b=iLaUuj0HMLeO8TIqX+gs3SKHC8lLaXqWm+FnPayRGI0vOvwUuAmDiCAa 0boRH4SEwFtPSTx4rRc1o9BRzgXCXxGkmA1cKLw6YLz7KlsJg5VcUXg1j qqJjVsjQYTQV8S4ZMP8kGjQHXiLMWesTo6KdlkX2YAig4beBvr9OYAz6N /z4gKSAWDMzz52v+kPoxK80JeJ2uwyWb0t0zKcCVvVwe+IEkIvyAP8DY0 ZblK1oLibT6sg7ptZCFuf+bS8QbLOb9usUTjM5/G8tUEydQyRp3ADh7LW hLnNseYRP9BB2Nf7siu7qA1UTNUJhS2XVQscVYCkcHnOvq8dn/mfwES26 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10640"; a="337758114" X-IronPort-AV: E=Sophos;i="5.98,236,1673942400"; d="scan'208";a="337758114" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2023 16:22:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10640"; a="669263312" X-IronPort-AV: E=Sophos;i="5.98,236,1673942400"; d="scan'208";a="669263312" Received: from nldesimo-desk.amr.corp.intel.com ([10.24.12.177]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2023 16:22:11 -0800 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni , Michael D Kinney , Chasel Chiu Subject: [PATCH v1 2/6] EmulatorPkg: Add ARM Build Target Date: Sun, 5 Mar 2023 16:22:01 -0800 Message-Id: <20230306002205.1640-3-nathaniel.l.desimone@intel.com> X-Mailer: git-send-email 2.39.2.windows.1 In-Reply-To: <20230306002205.1640-1-nathaniel.l.desimone@intel.com> References: <20230306002205.1640-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Adds the ARM build target to EmulatorPkg. Moves PcdDxeIplSwitchToLongMode and PcdDxeIplBuildPageTables to only apply for the IA32 and X64 build targets since they are not used on ARM. Adds ARM compiler instrinsics libraries. Adds NULL implementation of ArmMmuLib. Disables EbcDxe on ARM builds since EbcDxe does not support the ARM architecture. Cc: Andrew Fish Cc: Ray Ni Cc: Michael D Kinney Cc: Chasel Chiu Signed-off-by: Nate DeSimone --- EmulatorPkg/EmulatorPkg.dsc | 17 ++++++++++++++--- EmulatorPkg/EmulatorPkg.fdf | 6 ++++-- EmulatorPkg/build.sh | 13 ++++++++++++- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index b44435d7e6..19ba60aa23 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -4,7 +4,7 @@ # The Emulation Platform can be used to debug individual modules, prior to creating # a real platform. This also provides an example for how an DSC is created. # -# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2023, Intel Corporation. All rights reserved.
# Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.
# Copyright (c) Microsoft Corporation. # @@ -19,7 +19,7 @@ DSC_SPECIFICATION = 0x00010005 OUTPUT_DIRECTORY = Build/Emulator$(ARCH) - SUPPORTED_ARCHITECTURES = X64|IA32 + SUPPORTED_ARCHITECTURES = X64|IA32|ARM BUILD_TARGETS = DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER = DEFAULT FLASH_DEFINITION = EmulatorPkg/EmulatorPkg.fdf @@ -140,6 +140,13 @@ AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf !endif +[LibraryClasses.ARM] + ArmMmuLib|ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + + # Add support for GCC stack protector + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf + [LibraryClasses.common.SEC] PeiServicesLib|EmulatorPkg/Library/SecPeiServicesLib/SecPeiServicesLib.inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf @@ -211,8 +218,10 @@ TimerLib|EmulatorPkg/Library/DxeTimerLib/DxeTimerLib.inf [PcdsFeatureFlag] - gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE + +[PcdsFeatureFlag.IA32, PcdsFeatureFlag.X64] + gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplBuildPageTables|FALSE [PcdsFixedAtBuild] @@ -368,7 +377,9 @@ !endif } +!if "ARM" not in $(ARCH) MdeModulePkg/Universal/EbcDxe/EbcDxe.inf +!endif MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf EmulatorPkg/EmuThunkDxe/EmuThunk.inf EmulatorPkg/CpuRuntimeDxe/Cpu.inf diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf index 5420756eaa..06f002a624 100644 --- a/EmulatorPkg/EmulatorPkg.fdf +++ b/EmulatorPkg/EmulatorPkg.fdf @@ -1,7 +1,7 @@ ## @file # This is Emulator FDF file with UEFI HII features enabled # -# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2023, Intel Corporation. All rights reserved.
# Portions copyright (c) 2009 - 2011, Apple Inc. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -148,7 +148,9 @@ INF EmulatorPkg/ResetRuntimeDxe/Reset.inf INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF EmulatorPkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf -INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf +!if "ARM" not in $(ARCH) + INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf +!endif INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf INF EmulatorPkg/EmuThunkDxe/EmuThunk.inf INF EmulatorPkg/CpuRuntimeDxe/Cpu.inf diff --git a/EmulatorPkg/build.sh b/EmulatorPkg/build.sh index 76c22dfaf8..55f9cbaa1b 100755 --- a/EmulatorPkg/build.sh +++ b/EmulatorPkg/build.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
-# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2023, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -83,6 +83,15 @@ case `uname` in x86_64) HOST_PROCESSOR=X64 ;; + armv6l) + HOST_PROCESSOR=ARM + ;; + armv7l) + HOST_PROCESSOR=ARM + ;; + armv8l) + HOST_PROCESSOR=ARM + ;; esac gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}') @@ -174,6 +183,8 @@ case $PROCESSOR in LIB_NAMES="ld-linux-x86-64.so.2 libdl.so.2 crt1.o crti.o crtn.o" LIB_SEARCH_PATHS="/usr/lib/x86_64-linux-gnu /usr/lib64 /lib64 /usr/lib /lib" ;; + ARM) + ARCH_SIZE=32 esac for libname in $LIB_NAMES -- 2.30.2