summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-28 01:36:33 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-28 01:36:33 +0000
commitf7bb98019a719d8116fe840fd5e20703219c938d (patch)
tree9da0e67a2bf8f14582e8e9c7d47463cc47a127d7
parent19a7404aecbc03999bb2b9f24bae96e2dcf67915 (diff)
downloadedk2-platforms-f7bb98019a719d8116fe840fd5e20703219c938d.tar.xz
UefiCpuPkg VTF0: Fix support for finding SEC image of type TE.
Update Flat32SearchForSecEntryPoint assembly code to support finding an SEC image using the TE image format. Signed-off-by: rsun3 Reviewed-by: jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12462 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.rawbin500 -> 516 bytes
-rw-r--r--UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.rawbin484 -> 484 bytes
-rw-r--r--UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.rawbin884 -> 884 bytes
-rw-r--r--UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.rawbin28676 -> 28676 bytes
-rw-r--r--UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.rawbin28676 -> 28676 bytes
-rw-r--r--UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.rawbin28676 -> 28676 bytes
-rw-r--r--UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm38
7 files changed, 21 insertions, 17 deletions
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw
index ec6bcfd48b..2c6ff655de 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw
+++ b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw
Binary files differ
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw
index 02cb66c848..e34780a3a2 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw
+++ b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw
Binary files differ
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw
index 58542ad9d1..6dfa68eabb 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw
+++ b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw
Binary files differ
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw
index 393b6ef2ca..6c0bcc47eb 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw
+++ b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw
Binary files differ
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw
index 7ab1161a21..a78d5b407c 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw
+++ b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw
Binary files differ
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw
index f32e81ac12..61c71349a8 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw
+++ b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw
Binary files differ
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