forked from Bananymous/banan-os
Kernel: ACPI unmap_header does not do anything
We have to work with MMU mapping/unmapping to be user friendly
This commit is contained in:
parent
0ef318633c
commit
f9a0412e78
|
@ -144,20 +144,19 @@ namespace Kernel
|
||||||
{
|
{
|
||||||
const SDTHeader* header = get_header_from_index(i);
|
const SDTHeader* header = get_header_from_index(i);
|
||||||
MMU::get().allocate_range((uintptr_t)header, header->length, MMU::Flags::Present);
|
MMU::get().allocate_range((uintptr_t)header, header->length, MMU::Flags::Present);
|
||||||
if (!is_valid_std_header(header))
|
if (is_valid_std_header(header) && memcmp(header->signature, signature, 4) == 0)
|
||||||
{
|
|
||||||
unmap_header(header);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (memcmp(header->signature, signature, 4) == 0)
|
|
||||||
return header;
|
return header;
|
||||||
|
unmap_header(header);
|
||||||
}
|
}
|
||||||
return BAN::Error::from_format("Could not find ACPI header '{}'", BAN::StringView(signature, 4));
|
return BAN::Error::from_format("Could not find ACPI header '{}'", BAN::StringView(signature, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ACPI::unmap_header(const ACPI::SDTHeader* header)
|
void ACPI::unmap_header(const ACPI::SDTHeader* header)
|
||||||
{
|
{
|
||||||
MMU::get().unallocate_range((uintptr_t)header, header->length);
|
// I have to improve MMU page mapping so we can actually unmap
|
||||||
|
// without unmapping other mapped tables
|
||||||
|
(void)header;
|
||||||
|
//MMU::get().unallocate_range((uintptr_t)header, header->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ACPI::SDTHeader* ACPI::get_header_from_index(size_t index)
|
const ACPI::SDTHeader* ACPI::get_header_from_index(size_t index)
|
||||||
|
|
Loading…
Reference in New Issue