| 166 | } |
| 167 | |
| 168 | UINT32* 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 | |
| 195 | UINT32* ScanRSDT(UINT32 Signature, UINT64 TableId) |
no outgoing calls
no test coverage detected