Changeset e762b43 in mainline for kernel/arch/arm32/src/mm/page_fault.c
- Timestamp:
- 2009-03-03T16:12:43Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 02fd705
- Parents:
- f24d300
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/mm/page_fault.c
rf24d300 re762b43 50 50 { 51 51 fault_status_union_t fsu; 52 52 53 53 /* fault status is stored in CP15 register 5 */ 54 54 asm volatile ( 55 "mrc p15, 0, % 0, c5, c0, 0"56 : "=r"(fsu.dummy)55 "mrc p15, 0, %[dummy], c5, c0, 0" 56 : [dummy] "=r" (fsu.dummy) 57 57 ); 58 58 59 return fsu.fs; 59 60 } … … 62 63 * 63 64 * @return FAR (fault address register) content (address that caused a page 64 * 65 * fault) 65 66 */ 66 67 static inline uintptr_t read_fault_address_register(void) 67 68 { 68 69 uintptr_t ret; 69 70 70 71 /* fault adress is stored in CP15 register 6 */ 71 72 asm volatile ( 72 "mrc p15, 0, % 0, c6, c0, 0"73 : "=r"(ret)73 "mrc p15, 0, %[ret], c6, c0, 0" 74 : [ret] "=r" (ret) 74 75 ); 76 75 77 return ret; 76 78 } … … 81 83 * 82 84 * @return true when instruction is load/store, false otherwise 85 * 83 86 */ 84 87 static inline bool is_load_store_instruction(instruction_t instr) 85 88 { 86 89 /* load store immediate offset */ 87 if (instr.type == 0x2) { 88 return true; 89 } 90 90 if (instr.type == 0x2) 91 return true; 92 91 93 /* load store register offset */ 92 if (instr.type == 0x3 && instr.bit4 == 0) { 93 return true; 94 } 95 94 if ((instr.type == 0x3) && (instr.bit4 == 0)) 95 return true; 96 96 97 /* load store multiple */ 97 if (instr.type == 0x4) { 98 return true; 99 } 100 98 if (instr.type == 0x4) 99 return true; 100 101 101 /* oprocessor load/store */ 102 if (instr.type == 0x6) { 103 return true; 104 } 105 102 if (instr.type == 0x6) 103 return true; 104 106 105 return false; 107 106 } … … 116 115 { 117 116 /* swap, swapb instruction */ 118 if (instr.type == 0x0 && 119 (instr.opcode == 0x8 || instr.opcode == 0xa) && 120 instr.access == 0x0 && instr.bits567 == 0x4 && instr.bit4 == 1) { 121 return true; 122 } 123 117 if ((instr.type == 0x0) && 118 ((instr.opcode == 0x8) || (instr.opcode == 0xa)) && 119 (instr.access == 0x0) && (instr.bits567 == 0x4) && (instr.bit4 == 1)) 120 return true; 121 124 122 return false; 125 123 }
Note:
See TracChangeset
for help on using the changeset viewer.