Changeset 32e8cd1 in mainline for kernel/arch/sparc32/src/mm/page.c
- Timestamp:
- 2013-12-28T17:16:44Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1023bcb
- Parents:
- f6f22cdb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc32/src/mm/page.c
rf6f22cdb r32e8cd1 27 27 */ 28 28 29 /** @addtogroup abs32lemm29 /** @addtogroup sparc32mm 30 30 * @{ 31 31 */ … … 57 57 int flags = PAGE_CACHEABLE | PAGE_EXEC; 58 58 page_mapping_operations = &pt_mapping_operations; 59 59 60 60 page_table_lock(AS_KERNEL, true); 61 61 62 62 /* Kernel identity mapping */ 63 //FIXME: We need to consider the possibility that 64 //identity_base > identity_size and physmem_end. 65 //This might lead to overflow if identity_size is too big. 63 // FIXME: 64 // We need to consider the possibility that 65 // identity_base > identity_size and physmem_end. 66 // This might lead to overflow if identity_size is too big. 66 67 for (uintptr_t cur = PHYSMEM_START_ADDR; 67 68 cur < min(KA2PA(config.identity_base) + 68 69 config.identity_size, config.physmem_end); 69 70 cur += FRAME_SIZE) 70 71 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); 71 72 72 73 73 page_table_unlock(AS_KERNEL, true); 74 74 as_switch(NULL, AS_KERNEL); 75 76 // printf("as_context_table=0x%08x\n", as_context_table); 77 75 78 76 /* Switch MMU to new context table */ 79 77 asi_u32_write(ASI_MMUREGS, MMU_CONTEXT_TABLE, KA2PA(as_context_table) >> 4); 80 81 //boot_page_table_free();82 78 } 83 79 … … 86 82 uint32_t fault_status = asi_u32_read(ASI_MMUREGS, MMU_FAULT_STATUS); 87 83 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->at; 90 91 // printf("page fault on address 0x%08x, status 0x%08x, type %d\n", fault_address, fault_status, type); 92 93 if (type == FAULT_TYPE_LOAD_USER_DATA || 94 type == FAULT_TYPE_LOAD_SUPERVISOR_DATA) 84 mmu_fault_status_t *fault = (mmu_fault_status_t *) &fault_status; 85 mmu_fault_type_t type = (mmu_fault_type_t) fault->at; 86 87 if ((type == FAULT_TYPE_LOAD_USER_DATA) || 88 (type == FAULT_TYPE_LOAD_SUPERVISOR_DATA)) 95 89 as_page_fault(fault_address, PF_ACCESS_READ, istate); 96 90 97 if ( type == FAULT_TYPE_EXECUTE_USER ||98 type == FAULT_TYPE_EXECUTE_SUPERVISOR)91 if ((type == FAULT_TYPE_EXECUTE_USER) || 92 (type == FAULT_TYPE_EXECUTE_SUPERVISOR)) 99 93 as_page_fault(fault_address, PF_ACCESS_EXEC, istate); 100 94 101 if ( type == FAULT_TYPE_STORE_USER_DATA||102 type == FAULT_TYPE_STORE_USER_INSTRUCTION||103 type == FAULT_TYPE_STORE_SUPERVISOR_INSTRUCTION||104 type == FAULT_TYPE_STORE_SUPERVISOR_DATA)95 if ((type == FAULT_TYPE_STORE_USER_DATA) || 96 (type == FAULT_TYPE_STORE_USER_INSTRUCTION) || 97 (type == FAULT_TYPE_STORE_SUPERVISOR_INSTRUCTION) || 98 (type == FAULT_TYPE_STORE_SUPERVISOR_DATA)) 105 99 as_page_fault(fault_address, PF_ACCESS_WRITE, istate); 106 100 }
Note:
See TracChangeset
for help on using the changeset viewer.