From f7bb98019a719d8116fe840fd5e20703219c938d Mon Sep 17 00:00:00 2001 From: rsun3 Date: Wed, 28 Sep 2011 01:36:33 +0000 Subject: 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 --- .../Vtf0/Bin/ResetVector.ia32.port80.raw | Bin 500 -> 516 bytes .../ResetVector/Vtf0/Bin/ResetVector.ia32.raw | Bin 484 -> 484 bytes .../Vtf0/Bin/ResetVector.ia32.serial.raw | Bin 884 -> 884 bytes .../Vtf0/Bin/ResetVector.x64.port80.raw | Bin 28676 -> 28676 bytes .../ResetVector/Vtf0/Bin/ResetVector.x64.raw | Bin 28676 -> 28676 bytes .../Vtf0/Bin/ResetVector.x64.serial.raw | Bin 28676 -> 28676 bytes .../ResetVector/Vtf0/Ia32/SearchForSecEntry.asm | 38 ++++++++++++--------- 7 files changed, 21 insertions(+), 17 deletions(-) (limited to 'UefiCpuPkg') diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw index ec6bcfd48b..2c6ff655de 100644 Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw differ diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw index 02cb66c848..e34780a3a2 100644 Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw 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 Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw 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 Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw differ diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw index 7ab1161a21..a78d5b407c 100644 Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw 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 Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw 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.
+; Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
; 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 -- cgit v1.2.3