]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
IntelFsp2Pkg: Locate FSP Info Header dynamically
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / Ia32 / FspHelper.nasm
CommitLineData
cf1d4549
JY
1;; @file\r
2; Provide FSP helper function.\r
3;\r
4; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
5; This program and the accompanying materials\r
6; are licensed and made available under the terms and conditions of the BSD License\r
7; which accompanies this distribution. The full text of the license may be found at\r
8; http://opensource.org/licenses/bsd-license.php.\r
9;\r
10; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12;;\r
13\r
14 SECTION .text\r
15\r
16global ASM_PFX(FspInfoHeaderRelativeOff)\r
cf1d4549
JY
17\r
18global ASM_PFX(AsmGetFspBaseAddress)\r
19ASM_PFX(AsmGetFspBaseAddress):\r
8265373e 20 call ASM_PFX(AsmGetFspInfoHeader)\r
cf1d4549
JY
21 add eax, 0x1C\r
22 mov eax, dword [eax]\r
23 ret\r
24\r
25global ASM_PFX(AsmGetFspInfoHeader)\r
26ASM_PFX(AsmGetFspInfoHeader):\r
8265373e
YS
27 call ASM_PFX(NextInstruction)\r
28ASM_PFX(NextInstruction):\r
29 pop eax\r
30 sub eax, ASM_PFX(NextInstruction)\r
31 add eax, ASM_PFX(AsmGetFspInfoHeader)\r
32 DB 02Dh ; opcode of sub eax, imm32\r
33ASM_PFX(FspInfoHeaderRelativeOff): DD 0x12345678 ; sub eax, FspInfoHeaderRelativeOff\r
cf1d4549 34 ret\r