Skip to content

Commit

Permalink
SDFamily: Lib/SecProtocolsLocator: use "UEFI FD" region as second opt…
Browse files Browse the repository at this point in the history
…ion for searching protocols.
  • Loading branch information
sunflower2333 committed Nov 21, 2024
1 parent f1942cb commit 178b3ed
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ EFI_STATUS FindTeAddr(TE_INFO_STRUCT *TEInfo)

// Get Previous UEFI FD Address
Status = LocateMemoryMapAreaByName("FD Reserved I", &PreFD);
if (EFI_ERROR(Status))
DEBUG((DEBUG_ERROR, "Failed to find \"FD Reserved I\"\n"));
if (EFI_ERROR(Status)) {
DEBUG((DEBUG_ERROR, "Failed to locate \"FD Reserved I\", search \"UEFI FD\" instead.\n"));
Status = LocateMemoryMapAreaByName("UEFI FD", &PreFD);
if (EFI_ERROR(Status)) {
DEBUG((DEBUG_ERROR, "Failed to find \"UEFI FD\"\n"));
return Status;
}
}

// Find Signature 0x565A 'VZ' And Arch 0x64AA 'd'
PreFD.Address += 0x1000; // Add 0x1000 here to skip useless data
Expand Down Expand Up @@ -238,19 +244,19 @@ VOID InitProtocolFinder(
TE_INFO_STRUCT CoreTE = {0};

// Find and fill TE info in memory
FindTeAddr(&CoreTE);
ASSERT_EFI_ERROR(FindTeAddr(&CoreTE));

// Find Scheduler address
if (NULL != ScheAddr) {
ScheIntrAddr = find_protocol_scheduler(&CoreTE, &gEfiSchedIntfGuid);
ScheIntrAddr = find_protocol_scheduler(&CoreTE, &gEfiSchedIntfGuid);
ASSERT(ScheIntrAddr > 0);
// Fill caller's address
*ScheAddr = ScheIntrAddr;
}

// Find XBLDT address
if (NULL != XBLDTOpsAddr) {
SecDTOpsAddr = find_protocol_xbldt(&CoreTE, &gEfiSecDtbGuid);
SecDTOpsAddr = find_protocol_xbldt(&CoreTE, &gEfiSecDtbGuid);
ASSERT(SecDTOpsAddr > 0);
// Fill caller's address
*XBLDTOpsAddr = SecDTOpsAddr;
Expand Down

0 comments on commit 178b3ed

Please sign in to comment.