Changeset 1f12fab in mainline for kernel/arch/sparc32/src/trap_table.S
- 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/trap_table.S
r80d9d83 r1f12fab 33 33 .global trap_table 34 34 .global reset_trap 35 .global preemptible_trap 35 36 .global window_overflow_trap 36 37 .global window_underflow_trap … … 116 117 rett %l2 117 118 118 #define TRAP(_vector, _handler) \ 119 preemptible_trap: 120 /* Enable traps */ 121 mov %psr, %l0 122 or %l0, (1 << 5), %l0 123 mov %l0, %psr 124 125 /* Check whether previous mode was usermode */ 126 and %l0, (1 << 6), %l0 127 cmp %l0, 0 128 bne 1f 129 nop 130 131 /* Set up stack */ 132 set kernel_sp, %l4 133 ld [%l4], %sp 134 mov %sp, %fp 135 1: sub %sp, 112, %sp 136 137 /* Save trap data on stack */ 138 st %l1, [%fp - 4] 139 st %l2, [%fp - 8] 140 st %l0, [%fp - 12] 141 142 /* Jump to actual subroutine */ 143 mov 1, %o0 144 jmp %g1 145 sub %fp, 12, %o1 146 147 /* Return from handler */ 148 ld [%fp - 4], %l1 149 ld [%fp - 8], %l2 150 jmp %l1 151 rett %l2 152 153 #define STRAP(_vector, _handler) \ 119 154 .org trap_table + _vector * TRAP_ENTRY_SIZE; \ 120 155 mov %psr, %l0 ; \ 121 156 sethi %hi(_handler), %l4 ; \ 122 jmp %l4 + %lo(_handler); \ 123 mov _vector, %l3 ; 157 jmp %lo(_handler) + %l4 ; \ 158 nop 159 160 #define TRAP(_vector, _handler) \ 161 .org trap_table + _vector * TRAP_ENTRY_SIZE; \ 162 sethi %hi(_handler), %g1 ; \ 163 b preemptible_trap ; \ 164 or %g1, %lo(_handler), %g1 ; 124 165 125 166 #define INTERRUPT(_vector, _priority) \ … … 141 182 TRAP(0x3, privileged_instruction) 142 183 TRAP(0x4, fp_disabled) 143 TRAP(0x5, window_overflow_trap)144 TRAP(0x6, window_underflow_trap)184 STRAP(0x5, window_overflow_trap) 185 STRAP(0x6, window_underflow_trap) 145 186 TRAP(0x7, mem_address_not_aligned) 146 187 TRAP(0x8, fp_exception)
Note:
See TracChangeset
for help on using the changeset viewer.