From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: jordan.l.justen@intel.com) Received: from mga11.intel.com (mga11.intel.com []) by groups.io with SMTP; Wed, 10 Apr 2019 01:41:49 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 01:41:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,332,1549958400"; d="scan'208";a="130116378" Received: from askirtik-mobl1.amr.corp.intel.com (HELO jljusten-skl.amr.corp.intel.com) ([10.254.188.249]) by orsmga007.jf.intel.com with ESMTP; 10 Apr 2019 01:41:11 -0700 From: "Jordan Justen" To: devel@edk2.groups.io Cc: Jordan Justen , Jian J Wang , Hao Wu , Ray Ni , Star Zeng Subject: [PATCH v2 4/6] MdeModulePkg/Core/Pei: Add IA32 assembly for TemporaryRamMigration Date: Wed, 10 Apr 2019 01:39:58 -0700 Message-Id: <20190410084000.19660-5-jordan.l.justen@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410084000.19660-1-jordan.l.justen@intel.com> References: <20190410084000.19660-1-jordan.l.justen@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Jordan Justen Cc: Jian J Wang Cc: Hao Wu Cc: Ray Ni Cc: Star Zeng --- .../Ia32/TemporaryRamMigration.nasm | 77 +++++++++++++++++++ MdeModulePkg/Core/Pei/PeiMain.inf | 3 + 2 files changed, 80 insertions(+) create mode 100644 MdeModulePkg/Core/Pei/Dispatcher/Ia32/TemporaryRamMigration.nasm diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Ia32/TemporaryRamMigration.nasm b/MdeModulePkg/Core/Pei/Dispatcher/Ia32/TemporaryRamMigration.nasm new file mode 100644 index 0000000000..8014e3cc95 --- /dev/null +++ b/MdeModulePkg/Core/Pei/Dispatcher/Ia32/TemporaryRamMigration.nasm @@ -0,0 +1,77 @@ +;------------------------------------------------------------------------------ +; +; Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-Patent +; +;------------------------------------------------------------------------------ + +#include + + SECTION .text + +extern ASM_PFX(PeiTemporaryRamMigrated) + +;------------------------------------------------------------------------------ +; VOID +; EFIAPI +; PeiTemporaryRamMigration ( +; IN PEI_CORE_TEMPORARY_RAM_TRANSITION *TempRamTransitionData +; ); +; +; @param[in] Stack Pointer to PEI_CORE_TEMPORARY_RAM_TRANSITION +; +; @return None This routine does not return +;------------------------------------------------------------------------------ +global ASM_PFX(PeiTemporaryRamMigration) +ASM_PFX(PeiTemporaryRamMigration): + + ; + ; We never return from this call + ; + add esp, 4 + + ; + ; (eax) Pointer to PEI_CORE_TEMPORARY_RAM_TRANSITION + ; + mov eax, [esp] + + ; + ; We store the TempRamTransitionData pointer in ebx. By the IA32 + ; calling convention we should normally save ebx, but we won't be + ; returning to the caller, so we don't need to save it. By the + ; same rule, the TemporaryRamMigration PPI call should preserve + ; ebx for us. + ; + mov ebx, [esp] + + ; + ; Setup parameters and call TemporaryRamSupport->TemporaryRamMigration + ; 32-bit PeiServices + ; 64-bit TemporaryMemoryBase + ; 64-bit PermanentMemoryBase + ; 32-bit CopySize + ; + push DWORD [eax + 0x18] ; CopySize + push DWORD [eax + 0x14] ; PermanentMemoryBase Upper 32-bit + push DWORD [eax + 0x10] ; PermanentMemoryBase Lower 32-bit + push DWORD [eax + 0x0c] ; TemporaryMemoryBase Upper 32-bit + push DWORD [eax + 0x08] ; TemporaryMemoryBase Lower 32-bit + push DWORD [eax + 0x04] ; PeiServices + + ; + ; (ebx) Pointer to PEI_CORE_TEMPORARY_RAM_TRANSITION on stack + ; + ; Adjusted based on stack change made during + ; TemporaryRamSupport->TemporaryRamMigration call + ; + sub ebx, esp + call DWORD [eax + 0x00] + add ebx, esp + add esp, 0x18 + + ; + ; Setup parameters and call PeiTemporaryRamMigrated + ; 32-bit Pointer to PEI_CORE_TEMPORARY_RAM_TRANSITION + ; + push ebx + call ASM_PFX(PeiTemporaryRamMigrated) diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 1be898bb91..918c4a0df8 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -56,6 +56,9 @@ Dispatcher/Arm/TemporaryRamMigration.asm | MSFT Dispatcher/Arm/TemporaryRamMigration.S | GCC +[Sources.Ia32] + Dispatcher/Ia32/TemporaryRamMigration.nasm + [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec -- 2.20.1