; @file\r
; Search for the Boot Firmware Volume (BFV) base address\r
;\r
-; Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2008 - 2022, Intel Corporation. All rights reserved.<BR>\r
; SPDX-License-Identifier: BSD-2-Clause-Patent\r
;\r
;------------------------------------------------------------------------------\r
Flat32SearchForBfvBase:\r
\r
xor eax, eax\r
- mov ecx, 3 ; 3: FFS3 GUID, 2: FFS2 GUID, 1: Not Found\r
searchingForBfvHeaderLoop:\r
;\r
; We check for a firmware volume at every 4KB address in the top 16MB\r
;\r
sub eax, 0x1000\r
cmp eax, 0xff000000\r
- jb searchingForBfvWithOtherFfsGuid\r
- cmp ecx, 3\r
- jne searchingForFfs2Guid\r
+ jb searchedForBfvHeaderButNotFound\r
\r
;\r
; Check FFS3 GUID\r
;\r
cmp dword [eax + 0x10], FFS3_GUID_DWORD0\r
- jne searchingForBfvHeaderLoop\r
+ jne searchingForFfs2Guid\r
cmp dword [eax + 0x14], FFS3_GUID_DWORD1\r
- jne searchingForBfvHeaderLoop\r
+ jne searchingForFfs2Guid\r
cmp dword [eax + 0x18], FFS3_GUID_DWORD2\r
- jne searchingForBfvHeaderLoop\r
+ jne searchingForFfs2Guid\r
cmp dword [eax + 0x1c], FFS3_GUID_DWORD3\r
- jne searchingForBfvHeaderLoop\r
+ jne searchingForFfs2Guid\r
jmp checkingFvLength\r
\r
searchingForFfs2Guid:\r
\r
jmp searchedForBfvHeaderAndItWasFound\r
\r
-searchingForBfvWithOtherFfsGuid:\r
- xor eax, eax\r
- dec ecx\r
- cmp ecx, 1\r
- jne searchingForBfvHeaderLoop\r
-\r
searchedForBfvHeaderButNotFound:\r
;\r
; Hang if the SEC entry point was not found\r