Changeset 00287cc in mainline for kernel/arch/arm32/src/mm
- Timestamp:
- 2009-03-12T23:26:32Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 648c9d9
- Parents:
- 3b122e9
- Location:
- kernel/arch/arm32/src/mm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/mm/frame.c
r3b122e9 r00287cc 36 36 #include <mm/frame.h> 37 37 #include <arch/mm/frame.h> 38 #include <arch/ machine.h>38 #include <arch/drivers/gxemul.h> 39 39 #include <config.h> 40 #include <arch/debug/print.h>41 40 42 41 /** Address of the last frame in the memory. */ … … 46 45 void frame_arch_init(void) 47 46 { 48 /* all memory as one zone */ 49 zone_create(0, ADDR2PFN(machine_get_memory_size()), 47 last_frame = *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET)); 48 49 /* All memory as one zone */ 50 zone_create(0, ADDR2PFN(last_frame), 50 51 BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0); 51 last_frame = machine_get_memory_size();52 52 53 53 /* blacklist boot page table */ … … 59 59 void boot_page_table_free(void) 60 60 { 61 int i;62 for (i = 0; i < BOOT_PAGE_TABLE_SIZE_IN_FRAMES; i++) {61 unsigned int i; 62 for (i = 0; i < BOOT_PAGE_TABLE_SIZE_IN_FRAMES; i++) 63 63 frame_free(i * FRAME_SIZE + BOOT_PAGE_TABLE_ADDRESS); 64 }65 64 } 66 65 -
kernel/arch/arm32/src/mm/page.c
r3b122e9 r00287cc 52 52 void page_arch_init(void) 53 53 { 54 int flags = PAGE_CACHEABLE; 55 page_mapping_operations = &pt_mapping_operations; 56 54 57 uintptr_t cur; 55 int flags; 56 57 page_mapping_operations = &pt_mapping_operations; 58 59 flags = PAGE_CACHEABLE; 60 61 /* PA2KA(identity) mapping for all frames until last_frame */ 62 for (cur = 0; cur < last_frame; cur += FRAME_SIZE) { 58 /* Kernel identity mapping */ 59 for (cur = 0; cur < last_frame; cur += FRAME_SIZE) 63 60 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); 64 }65 61 66 /* create mapping for exception table at high offset */62 /* Create mapping for exception table at high offset */ 67 63 #ifdef HIGH_EXCEPTION_VECTORS 68 64 void *virtaddr = frame_alloc(ONE_FRAME, FRAME_KA); … … 71 67 #error "Only high exception vector supported now" 72 68 #endif 73 69 74 70 as_switch(NULL, AS_KERNEL); 75 71 76 72 boot_page_table_free(); 77 73 } … … 94 90 physaddr, size) 95 91 } 96 92 97 93 uintptr_t virtaddr = PA2KA(last_frame); 98 94 pfn_t i; … … 102 98 PAGE_NOT_CACHEABLE | PAGE_READ | PAGE_WRITE | PAGE_KERNEL); 103 99 } 104 100 105 101 last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); 106 102 return virtaddr; -
kernel/arch/arm32/src/mm/page_fault.c
r3b122e9 r00287cc 35 35 #include <panic.h> 36 36 #include <arch/exception.h> 37 #include <arch/debug/print.h>38 37 #include <arch/mm/page_fault.h> 39 38 #include <mm/as.h> … … 183 182 if (ret == AS_PF_FAULT) { 184 183 print_istate(istate); 185 dprintf("page fault - pc: %x, va: %x, status: %x(%x), "184 printf("page fault - pc: %x, va: %x, status: %x(%x), " 186 185 "access:%d\n", istate->pc, badvaddr, fsr.status, fsr, 187 186 access); 188 187 189 188 fault_if_from_uspace(istate, "Page fault: %#x.", badvaddr); 190 189 panic("Page fault."); … … 202 201 203 202 if (ret == AS_PF_FAULT) { 204 dprintf("prefetch_abort\n");203 printf("prefetch_abort\n"); 205 204 print_istate(istate); 206 205 panic("page fault - prefetch_abort at address: %x.",
Note:
See TracChangeset
for help on using the changeset viewer.