summaryrefslogtreecommitdiff
path: root/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm
diff options
context:
space:
mode:
Diffstat (limited to 'UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm')
-rw-r--r--UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm38
1 files changed, 21 insertions, 17 deletions
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm b/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm
index 9558b9d350..6206b44485 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm
+++ b/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm
@@ -2,7 +2,7 @@
; @file
; Search for the SEC Core entry point
;
-; Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
@@ -115,6 +115,7 @@ secCoreEntryPointWasFound:
OneTimeCallRet Flat32SearchForSecEntryPoint
%define EFI_SECTION_PE32 0x10
+%define EFI_SECTION_TE 0x12
;
; Input:
@@ -139,8 +140,11 @@ getEntryPointOfFfsFileLoopForSections:
cmp byte [eax + 3], EFI_SECTION_PE32
je getEntryPointOfFfsFileFoundPe32Section
+ cmp byte [eax + 3], EFI_SECTION_TE
+ je getEntryPointOfFfsFileFoundTeSection
+
;
- ; The section type was not PE32, so move to next section
+ ; The section type was not PE32 or TE, so move to next section
;
mov ebx, dword [eax]
and ebx, 0x00ffffff
@@ -158,16 +162,27 @@ getEntryPointOfFfsFileLoopForSections:
getEntryPointOfFfsFileFoundPe32Section:
add eax, 4 ; EAX = Start of PE32 image
- mov ebx, eax
cmp word [eax], 'MZ'
- jne thereIsNotAnMzSignature
+ jne getEntryPointOfFfsFileErrorReturn
movzx ebx, word [eax + 0x3c]
add ebx, eax
-thereIsNotAnMzSignature:
+
+ ; if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)
+ cmp dword [ebx], `PE\x00\x00`
+ jne getEntryPointOfFfsFileErrorReturn
+
+ ; *EntryPoint = (VOID *)((UINTN)Pe32Data +
+ ; (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));
+ add eax, [ebx + 0x4 + 0x14 + 0x10]
+ jmp getEntryPointOfFfsFileReturn
+
+getEntryPointOfFfsFileFoundTeSection:
+ add eax, 4 ; EAX = Start of TE image
+ mov ebx, eax
; if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE)
cmp word [ebx], 'VZ'
- jne thereIsNoVzSignature
+ jne getEntryPointOfFfsFileErrorReturn
; *EntryPoint = (VOID *)((UINTN)Pe32Data +
; (UINTN)(Hdr.Te->AddressOfEntryPoint & 0x0ffffffff) +
; sizeof(EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize);
@@ -177,17 +192,6 @@ thereIsNotAnMzSignature:
sub eax, ebx
jmp getEntryPointOfFfsFileReturn
-thereIsNoVzSignature:
-
- ; if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)
- cmp dword [ebx], `PE\x00\x00`
- jne getEntryPointOfFfsFileErrorReturn
-
- ; *EntryPoint = (VOID *)((UINTN)Pe32Data +
- ; (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));
- add eax, [ebx + 0x4 + 0x14 + 0x10]
- jmp getEntryPointOfFfsFileReturn
-
getEntryPointOfFfsFileErrorReturn:
mov eax, 0