Home | History | Annotate | Download | only in Ia32
      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 
     16 global ASM_PFX(FspInfoHeaderRelativeOff)
     17 ASM_PFX(FspInfoHeaderRelativeOff):
     18    DD    0x12345678               ; This value must be patched by the build script
     19 
     20 global ASM_PFX(AsmGetFspBaseAddress)
     21 ASM_PFX(AsmGetFspBaseAddress):
     22    call  ASM_PFX(AsmGetFspInfoHeader)
     23    add   eax, 0x1C
     24    mov   eax, dword [eax]
     25    ret
     26 
     27 global ASM_PFX(AsmGetFspInfoHeader)
     28 ASM_PFX(AsmGetFspInfoHeader):
     29    call  ASM_PFX(NextInstruction)
     30 ASM_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 
     37 global ASM_PFX(AsmGetFspInfoHeaderNoStack)
     38 ASM_PFX(AsmGetFspInfoHeaderNoStack):
     39    mov   eax, ASM_PFX(AsmGetFspInfoHeader)
     40    sub   eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)]
     41    jmp   edi
     42