Kernel: Allow offsetof with packed fields

This is not standard C++ but should be fine with my toolchain.
This commit is contained in:
2023-10-30 17:51:18 +02:00
parent 3f638f125e
commit 066fb44105
2 changed files with 4 additions and 1 deletions

View File

@@ -213,7 +213,7 @@ namespace Kernel
auto* fadt = (FADT*)header;
paddr_t dsdt_paddr = 0;
if (fadt->length > 140) // 140 is the offset of x_dsdt
if (fadt->length > offsetof(FADT, x_dsdt))
dsdt_paddr = fadt->x_dsdt;
if (dsdt_paddr == 0 || !PageTable::is_valid_pointer(dsdt_paddr))
dsdt_paddr = fadt->dsdt;