MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / ScanRSDT2

Function ScanRSDT2

rEFIt_UEFI/Platform/AcpiPatcher.cpp:168–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168UINT32* ScanRSDT2(UINT32 Signature, UINT64 TableId, UINTN MatchIndex)
169{
170 if (!Rsdt || (0 == Signature && 0 == TableId)) {
171 return NULL;
172 }
173
174 UINT32 Count = RsdtTableCount();
175 UINTN MatchingCount = 0;
176 UINT32* Ptr = RsdtEntryPtrFromIndex(0);
177 UINT32* EndPtr = RsdtEntryPtrFromIndex(Count);
178 for (; Ptr < EndPtr; Ptr++) {
179 EFI_ACPI_DESCRIPTION_HEADER* Table = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)*Ptr;
180 if (!Table) {
181 // skip NULL entry
182 continue;
183 }
184 if (0 == Signature || Table->Signature == Signature) {
185 if ((0 == TableId || Table->OemTableId == TableId) && (IGNORE_INDEX == MatchIndex || MatchingCount == MatchIndex)) {
186 return Ptr; // pointer to the matching entry
187 }
188 ++MatchingCount;
189 }
190 }
191 return NULL;
192}
193
194
195UINT32* ScanRSDT(UINT32 Signature, UINT64 TableId)

Callers 2

ScanRSDTFunction · 0.85
ReplaceOrInsertTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected