public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Kuo, Ted" <ted.kuo@intel.com>
To: devel@edk2.groups.io
Cc: Chasel Chiu <chasel.chiu@intel.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>,
	Star Zeng <star.zeng@intel.com>,
	Ashraf Ali S <ashraf.ali.s@intel.com>
Subject: [edk2-devel][PATCH v3 5/8] IntelFsp2Pkg: SecFspSecPlatformLibNull support for X64
Date: Thu,  7 Apr 2022 01:02:36 +0800	[thread overview]
Message-ID: <ddc5622fea00ddf3b3835b0ce6f7e3ad0e02dc08.1649264447.git.ted.kuo@intel.com> (raw)
In-Reply-To: <cover.1649264447.git.ted.kuo@intel.com>
In-Reply-To: <cover.1649264447.git.ted.kuo@intel.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3893
1.Added SecFspSecPlatformLibNull support for X64.
2.Added X64 support to IntelFsp2Pkg.dsc.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
---
 IntelFsp2Pkg/IntelFsp2Pkg.dsc                      |  2 +-
 .../SecFspSecPlatformLibNull.inf                   |  6 +++-
 .../SecFspSecPlatformLibNull/X64/Long64.nasm       | 31 +++++++++++++++++
 .../SecFspSecPlatformLibNull/X64/SecCarInit.nasm   | 40 ++++++++++++++++++++++
 4 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/X64/Long64.nasm
 create mode 100644 IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/X64/SecCarInit.nasm

diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
index c1414f7e75..1284aa042c 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
@@ -12,7 +12,7 @@
   PLATFORM_VERSION               = 0.1
   DSC_SPECIFICATION              = 0x00010005
   OUTPUT_DIRECTORY               = Build/IntelFsp2Pkg
-  SUPPORTED_ARCHITECTURES        = IA32
+  SUPPORTED_ARCHITECTURES        = IA32|X64
   BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER               = DEFAULT
 
diff --git a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf
index 42e7d83c32..ef859d5ea5 100644
--- a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf
+++ b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf
@@ -23,7 +23,7 @@
 #
 # The following information is for reference only and not required by the build tools.
 #
-#  VALID_ARCHITECTURES           = IA32
+#  VALID_ARCHITECTURES           = IA32 X64
 #
 
 ################################################################################
@@ -39,6 +39,10 @@
   Ia32/Flat32.nasm
   Ia32/SecCarInit.nasm
 
+[Sources.X64]
+  X64/Long64.nasm
+  X64/SecCarInit.nasm
+
 ################################################################################
 #
 # Package Dependency Section - list of Package files that are required for
diff --git a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/X64/Long64.nasm b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/X64/Long64.nasm
new file mode 100644
index 0000000000..836257f962
--- /dev/null
+++ b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/X64/Long64.nasm
@@ -0,0 +1,31 @@
+;; @file
+;  This is the code that performs early platform initialization.
+;  It consumes the reset vector, configures the stack.
+;
+; Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
+; SPDX-License-Identifier: BSD-2-Clause-Patent
+;;
+
+;
+; Define assembler characteristics
+;
+
+extern   ASM_PFX(TempRamInitApi)
+
+SECTION .text
+
+%macro RET_RSI  0
+
+  movd    rsi, mm7                      ; restore RSI from MM7
+  jmp     rsi
+
+%endmacro
+
+;
+; Perform early platform initialization
+;
+global ASM_PFX(SecPlatformInit)
+ASM_PFX(SecPlatformInit):
+
+  RET_RSI
+
diff --git a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/X64/SecCarInit.nasm b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/X64/SecCarInit.nasm
new file mode 100644
index 0000000000..e64c77ed18
--- /dev/null
+++ b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/X64/SecCarInit.nasm
@@ -0,0 +1,40 @@
+;; @file
+;  SEC CAR function
+;
+; Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
+; SPDX-License-Identifier: BSD-2-Clause-Patent
+;;
+
+;
+; Define assembler characteristics
+;
+
+%macro RET_RSI 0
+
+  movd    rsi, mm7                      ; move ReturnAddress from MM7 to RSI
+  jmp     rsi
+
+%endmacro
+
+SECTION .text
+
+;-----------------------------------------------------------------------------
+;
+;  Section:     SecCarInit
+;
+;  Description: This function initializes the Cache for Data, Stack, and Code
+;
+;-----------------------------------------------------------------------------
+global ASM_PFX(SecCarInit)
+ASM_PFX(SecCarInit):
+
+  ;
+  ; Set up CAR
+  ;
+
+  xor    rax, rax
+
+SecCarInitExit:
+
+  RET_RSI
+
-- 
2.16.2.windows.1


  parent reply	other threads:[~2022-04-06 17:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 17:02 [edk2-devel][PATCH v3 0/8] Support PEI 64bit in IntelFsp2Pkg and IntelFsp2WrapperPkg Kuo, Ted
2022-04-06 17:02 ` [edk2-devel][PATCH v3 1/8] IntelFsp2Pkg: X64 compatible changes to support PEI in 64bit Kuo, Ted
2022-04-06 23:57   ` Ni, Ray
2022-04-07  0:05     ` Andrew Fish
2022-04-07  0:08       ` Ni, Ray
2022-04-07  1:25       ` Kuo, Ted
2022-04-07  1:10     ` Kuo, Ted
2022-04-06 17:02 ` [edk2-devel][PATCH v3 2/8] IntelFsp2Pkg: Add FSPx_ARCH2_UPD support for X64 Kuo, Ted
2022-04-06 17:02 ` [edk2-devel][PATCH v3 3/8] IntelFsp2Pkg: Update FSP_GLOBAL_DATA and FSP_PLAT_DATA " Kuo, Ted
2022-04-06 17:02 ` [edk2-devel][PATCH v3 4/8] IntelFsp2Pkg: FspSecCore support " Kuo, Ted
2022-04-06 17:02 ` Kuo, Ted [this message]
2022-04-06 17:02 ` [edk2-devel][PATCH v3 6/8] IntelFsp2WrapperPkg: Adopt FSPM_UPD_COMMON_FSP24 " Kuo, Ted
2022-04-06 17:02 ` [edk2-devel][PATCH v3 7/8] IntelFsp2WrapperPkg: BaseFspWrapperApiLib support " Kuo, Ted
2022-04-06 17:02 ` [edk2-devel][PATCH v3 8/8] IntelFsp2WrapperPkg: SecFspWrapperPlatformSecLibSample " Kuo, Ted

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ddc5622fea00ddf3b3835b0ce6f7e3ad0e02dc08.1649264447.git.ted.kuo@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox