Changeset 1f12fab in mainline for kernel/arch/sparc32/src/mm
- Timestamp:
- 2013-10-07T20:00:34Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a73ebf0
- Parents:
- 80d9d83
- Location:
- kernel/arch/sparc32/src/mm
- Files:
- 
      - 2 edited
 
 
Legend:
- Unmodified
- Added
- Removed
- 
      kernel/arch/sparc32/src/mm/frame.cr80d9d83 r1f12fab 60 60 BOOT_PT_START_FRAME + BOOT_PT_SIZE_FRAMES, 61 61 ZONE_AVAILABLE | ZONE_LOWMEM); 62 63 printf("low_zone: %d frames\n", SIZE2FRAMES(size)); 62 64 } else { 63 65 pfn_t conf = zone_external_conf_alloc(SIZE2FRAMES(size)); … … 65 67 zone_create(ADDR2PFN(base), SIZE2FRAMES(size), conf, 66 68 ZONE_AVAILABLE | ZONE_HIGHMEM); 69 70 printf("high zone: %d frames\n", SIZE2FRAMES(size)); 67 71 } 68 72 73 printf("free: %d\n", frame_total_free_get()); 69 74 } 70 75 … … 81 86 /* blacklist boot page table */ 82 87 frame_mark_unavailable(BOOT_PT_START_FRAME, BOOT_PT_SIZE_FRAMES); 88 printf("free: %d\n", frame_total_free_get()); 83 89 //machine_frame_init(); 84 90 } 
- 
      kernel/arch/sparc32/src/mm/page.cr80d9d83 r1f12fab 34 34 35 35 #include <arch/mm/page.h> 36 #include <arch/mm/page_fault.h> 37 #include <arch/mm/tlb.h> 36 38 #include <genarch/mm/page_pt.h> 37 39 #include <arch/mm/frame.h> … … 75 77 76 78 /* Switch MMU to new context table */ 77 asi_u32_write(ASI_MMUREGS, 0x100, KA2PA(as_context_table) >> 4);79 asi_u32_write(ASI_MMUREGS, MMU_CONTEXT_TABLE, KA2PA(as_context_table) >> 4); 78 80 79 81 //boot_page_table_free(); … … 82 84 void page_fault(unsigned int n __attribute__((unused)), istate_t *istate) 83 85 { 86 uint32_t fault_status = asi_u32_read(ASI_MMUREGS, MMU_FAULT_STATUS); 87 uintptr_t fault_address = asi_u32_read(ASI_MMUREGS, MMU_FAULT_ADDRESS); 88 mmu_fault_status_t *fault = (mmu_fault_status_t *)&fault_status; 89 mmu_fault_type_t type = (mmu_fault_type_t)fault->ft; 90 91 printf("page fault on address 0x%08x, status 0x%08x\n", fault_address, fault_status); 92 93 if (type == FAULT_TYPE_LOAD_USER_DATA) 94 as_page_fault(fault_address, PF_ACCESS_READ, istate); 95 96 if (type == FAULT_TYPE_EXECUTE_USER) 97 as_page_fault(fault_address, PF_ACCESS_EXEC, istate); 98 99 if (type == FAULT_TYPE_STORE_USER_DATA || type == FAULT_TYPE_STORE_USER_INSTRUCTION) 100 as_page_fault(fault_address, PF_ACCESS_WRITE, istate); 84 101 } 85 102 
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  
