2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
5 #include <kernel/kernel.h>
6 #include <kernel/console.h>
8 #include <kernel/vm_page.h>
9 #include <kernel/vm_priv.h>
10 #include <kernel/debug.h>
12 #include <kernel/arch/vm.h>
13 #include <kernel/arch/int.h>
14 #include <kernel/arch/cpu.h>
16 #include <kernel/arch/i386/interrupts.h>
18 int arch_vm_init(kernel_args
*ka
)
20 dprintf("arch_vm_init: entry\n");
24 int arch_vm_init2(kernel_args
*ka
)
26 dprintf("arch_vm_init2: entry\n");
28 // account for DMA area and mark the pages unusable
29 vm_mark_page_range_inuse(0x0, 0xa0000 / PAGE_SIZE
);
34 int arch_vm_init_existing_maps(kernel_args
*ka
)
39 int arch_vm_init_endvm(kernel_args
*ka
)
44 dprintf("arch_vm_init_endvm: entry\n");
46 // map 0 - 0xa0000 directly
47 id
= vm_map_physical_memory(vm_get_kernel_aspace_id(), "dma_region", &ptr
,
48 REGION_ADDR_ANY_ADDRESS
, 0xa0000, LOCK_RW
|LOCK_KERNEL
, 0x0);
50 panic("arch_vm_init_endvm: unable to map dma region\n");
56 void arch_vm_aspace_swap(vm_address_space
*aspace
)
58 i386_swap_pgdir(vm_translation_map_get_pgdir(&aspace
->translation_map
));