diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-11-28 11:41:35 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-11-28 11:44:40 +0100 |
commit | 230d7726ce55114c5c32c440c5928f104a085ba6 (patch) | |
tree | 270728ff42aa3e1d6d1f213b5a7271973008041b /i386/i386at/biosmem.c | |
parent | 7bb961dfd808df26b9245c999b8cb4e897439019 (diff) | |
download | gnumach-230d7726ce55114c5c32c440c5928f104a085ba6.tar.gz gnumach-230d7726ce55114c5c32c440c5928f104a085ba6.tar.bz2 gnumach-230d7726ce55114c5c32c440c5928f104a085ba6.zip |
memmmap: Use biosmem_addr_available rather than vm_page_lookup_pa
The segment code actually has vm_page entries for reserved pages, and
thus memmmap would reject mapping ACPI pages. Taking the information
from biosmem is much more precise, and indeed knows all hardware quirks
which can now be dropped from memmmap.
Diffstat (limited to 'i386/i386at/biosmem.c')
-rw-r--r-- | i386/i386at/biosmem.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/i386/i386at/biosmem.c b/i386/i386at/biosmem.c index 9f86b66a..4f0914ca 100644 --- a/i386/i386at/biosmem.c +++ b/i386/i386at/biosmem.c @@ -995,3 +995,21 @@ biosmem_free_usable(void) biosmem_free_usable_entry(start, end); } } + +boolean_t +biosmem_addr_available(phys_addr_t addr) +{ + struct biosmem_map_entry *entry; + unsigned i; + + if (addr < BIOSMEM_BASE) + return FALSE; + + for (i = 0; i < biosmem_map_size; i++) { + entry = &biosmem_map[i]; + + if (addr >= entry->base_addr && addr < entry->base_addr + entry->length) + return entry->type == BIOSMEM_TYPE_AVAILABLE; + } + return FALSE; +} |