• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;; @file
2;  Provide FSP helper function.
3;
4; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
5; This program and the accompanying materials
6; are licensed and made available under the terms and conditions of the BSD License
7; which accompanies this distribution.  The full text of the license may be found at
8; http://opensource.org/licenses/bsd-license.php.
9;
10; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12;;
13
14    SECTION .text
15
16global ASM_PFX(FspInfoHeaderRelativeOff)
17ASM_PFX(FspInfoHeaderRelativeOff):
18   DD    0x12345678               ; This value must be patched by the build script
19
20global ASM_PFX(AsmGetFspBaseAddress)
21ASM_PFX(AsmGetFspBaseAddress):
22   call  ASM_PFX(AsmGetFspInfoHeader)
23   add   eax, 0x1C
24   mov   eax, dword [eax]
25   ret
26
27global ASM_PFX(AsmGetFspInfoHeader)
28ASM_PFX(AsmGetFspInfoHeader):
29   call  ASM_PFX(NextInstruction)
30ASM_PFX(NextInstruction):
31   pop   eax
32   sub   eax, ASM_PFX(NextInstruction)
33   add   eax, ASM_PFX(AsmGetFspInfoHeader)
34   sub   eax, dword [eax - ASM_PFX(AsmGetFspInfoHeader) + ASM_PFX(FspInfoHeaderRelativeOff)]
35   ret
36
37global ASM_PFX(AsmGetFspInfoHeaderNoStack)
38ASM_PFX(AsmGetFspInfoHeaderNoStack):
39   mov   eax, ASM_PFX(AsmGetFspInfoHeader)
40   sub   eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)]
41   jmp   edi
42