acpi: Fix length of RSDP calculation

This commit is contained in:
mintsuki 2021-03-10 02:27:26 +01:00
parent 7c4f71e532
commit 2cfa5b281a
1 changed files with 4 additions and 1 deletions

View File

@ -49,7 +49,10 @@ void *acpi_get_table(const char *signature, int index) {
else
rsdt = (struct rsdt *)rsdp->rsdt_addr;
for (size_t i = 0; i < rsdt->length - sizeof(struct sdt); i++) {
size_t entry_count =
(rsdt->length - sizeof(struct sdt)) / (use_xsdt ? 8 : 4);
for (size_t i = 0; i < entry_count; i++) {
struct sdt *ptr;
if (use_xsdt)
ptr = (struct sdt *)(size_t)((uint64_t *)rsdt->ptrs_start)[i];