Changeset 1f12fab in mainline for kernel/arch/sparc32/src/mm/page.c
- Timestamp:
- 2013-10-07T20:00:34Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a73ebf0
- Parents:
- 80d9d83
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc32/src/mm/page.c
r80d9d83 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.