From 262f80937885e158f3b99f7e6ec67f0e5d178e2d Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 31 Oct 2015 09:09:12 +0100 Subject: [PATCH] check if the apic_table raises a page boundary => if yes, map next page frame to the kernel space --- hermit/arch/x86/kernel/apic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hermit/arch/x86/kernel/apic.c b/hermit/arch/x86/kernel/apic.c index 97b937701..e4c64de9e 100644 --- a/hermit/arch/x86/kernel/apic.c +++ b/hermit/arch/x86/kernel/apic.c @@ -457,6 +457,13 @@ found_mp: addr = (size_t) apic_config; addr += sizeof(apic_config_table_t); + // does the apic table raise the page boundary? => map additional page + if (apic_config->entry_count * 20 + addr > ((size_t) apic_config & PAGE_MASK) + PAGE_SIZE) + { + page_map(((size_t) apic_config & PAGE_MASK) + PAGE_SIZE, ((size_t) apic_config & PAGE_MASK) + PAGE_SIZE, 1, PG_GLOBAL | PG_RW | PG_PCD); + vma_add( ((size_t) apic_config & PAGE_MASK) + PAGE_SIZE, ((size_t) apic_config & PAGE_MASK) + 2*PAGE_SIZE, VMA_READ|VMA_WRITE); + } + // search the ISA bus => required to redirect the IRQs for(i=0; ientry_count; i++) { switch(*((uint8_t*) addr)) {