]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg VTF0: Fix support for finding SEC image of type TE.
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 28 Sep 2011 01:36:33 +0000 (01:36 +0000)
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 28 Sep 2011 01:36:33 +0000 (01:36 +0000)
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

UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw
UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw
UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw
UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw
UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw
UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw
UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForSecEntry.asm

index ec6bcfd48b1f71520c87f15fb3347eea72ff099f..2c6ff655ded2a5855ca8f4428d559a7727eb6983 100644 (file)
Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw differ
index 02cb66c848ffc3bd8a8c574335d8b25425d3601b..e34780a3a2c9b22bd10a1d5a405e344faaff94f3 100644 (file)
Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw differ
index 58542ad9d1a151aafcce1e9446b449e8c48ec881..6dfa68eabb48a44bc50a0b7fe678f80b5cdadfd5 100644 (file)
Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw differ
index 393b6ef2caa40a0cb882fe4cd1eeae9d5d841f68..6c0bcc47ebff84830b59047790c70d96e9488296 100644 (file)
Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw differ
index 7ab1161a210e24c310cd9dc660fa3adb2cf87750..a78d5b407c8a106c221af127216d073cf8fdb99d 100644 (file)
Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw differ
index f32e81ac12a2e9ca71dcb0b87165ecc358eb52f5..61c71349a8a599916f3eeae8c5dee92efb56db71 100644 (file)
Binary files a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw and b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw differ
index 9558b9d3506786296b464953048208aeff047e34..6206b44485e7658980d58c0c4b51244ffdb71992 100644 (file)
@@ -2,7 +2,7 @@
 ; @file\r
 ; Search for the SEC Core entry point\r
 ;\r
-; Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -115,6 +115,7 @@ secCoreEntryPointWasFound:
     OneTimeCallRet Flat32SearchForSecEntryPoint\r
 \r
 %define EFI_SECTION_PE32                  0x10\r
+%define EFI_SECTION_TE                    0x12\r
 \r
 ;\r
 ; Input:\r
@@ -139,8 +140,11 @@ getEntryPointOfFfsFileLoopForSections:
     cmp     byte [eax + 3], EFI_SECTION_PE32\r
     je      getEntryPointOfFfsFileFoundPe32Section\r
 \r
+    cmp     byte [eax + 3], EFI_SECTION_TE\r
+    je      getEntryPointOfFfsFileFoundTeSection\r
+\r
     ;\r
-    ; The section type was not PE32, so move to next section\r
+    ; The section type was not PE32 or TE, so move to next section\r
     ;\r
     mov     ebx, dword [eax]\r
     and     ebx, 0x00ffffff\r
@@ -158,16 +162,27 @@ getEntryPointOfFfsFileLoopForSections:
 getEntryPointOfFfsFileFoundPe32Section:\r
     add     eax, 4       ; EAX = Start of PE32 image\r
 \r
-    mov     ebx, eax\r
     cmp     word [eax], 'MZ'\r
-    jne     thereIsNotAnMzSignature\r
+    jne     getEntryPointOfFfsFileErrorReturn\r
     movzx   ebx, word [eax + 0x3c]\r
     add     ebx, eax\r
-thereIsNotAnMzSignature:\r
+\r
+    ; if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)\r
+    cmp     dword [ebx], `PE\x00\x00`\r
+    jne     getEntryPointOfFfsFileErrorReturn\r
+\r
+    ; *EntryPoint = (VOID *)((UINTN)Pe32Data +\r
+    ;   (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));\r
+    add     eax, [ebx + 0x4 + 0x14 + 0x10]\r
+    jmp     getEntryPointOfFfsFileReturn\r
+\r
+getEntryPointOfFfsFileFoundTeSection:\r
+    add     eax, 4       ; EAX = Start of TE image\r
+    mov     ebx, eax\r
 \r
     ; if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE)\r
     cmp     word [ebx], 'VZ'\r
-    jne     thereIsNoVzSignature\r
+    jne     getEntryPointOfFfsFileErrorReturn\r
     ; *EntryPoint = (VOID *)((UINTN)Pe32Data +\r
     ;   (UINTN)(Hdr.Te->AddressOfEntryPoint & 0x0ffffffff) +\r
     ;   sizeof(EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize);\r
@@ -177,17 +192,6 @@ thereIsNotAnMzSignature:
     sub     eax, ebx\r
     jmp     getEntryPointOfFfsFileReturn\r
 \r
-thereIsNoVzSignature:\r
-\r
-    ; if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)\r
-    cmp     dword [ebx], `PE\x00\x00`\r
-    jne     getEntryPointOfFfsFileErrorReturn\r
-\r
-    ; *EntryPoint = (VOID *)((UINTN)Pe32Data +\r
-    ;   (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));\r
-    add     eax, [ebx + 0x4 + 0x14 + 0x10]\r
-    jmp     getEntryPointOfFfsFileReturn\r
-\r
 getEntryPointOfFfsFileErrorReturn:\r
     mov     eax, 0\r
 \r