Changeset e34a141 in mainline
- Timestamp:
- 2006-05-02T16:03:58Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 738ad2e
- Parents:
- 9417cdc
- Location:
- arch/ppc32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc32/Makefile.inc
r9417cdc re34a141 39 39 # 40 40 41 CFLAGS += -mcpu=powerpc -m 3241 CFLAGS += -mcpu=powerpc -msoft-float -m32 42 42 AFLAGS += -a32 43 43 LFLAGS += -no-check-sections -N -
arch/ppc32/include/exception.h
r9417cdc re34a141 67 67 __u32 r30; 68 68 __u32 r31; 69 __u32 cr; 69 70 __u32 pc; 70 71 __u32 srr1; 71 72 __u32 lr; 72 __u32 cr;73 73 __u32 ctr; 74 74 __u32 xer; 75 __u32 r12; 76 __u32 sp; 75 77 }; 76 78 -
arch/ppc32/src/asm.S
r9417cdc re34a141 33 33 .global userspace_asm 34 34 .global iret 35 .global iret_syscall 35 36 .global memsetb 36 37 .global memcpy … … 67 68 68 69 iret: 70 71 # disable interrupts 72 73 mfmsr r31 74 rlwinm r31, r31, 0, 17, 15 75 mtmsr r31 76 69 77 lwz r0, 0(sp) 70 78 lwz r2, 4(sp) … … 99 107 100 108 lwz r12, 120(sp) 109 mtcr r12 110 111 lwz r12, 124(sp) 101 112 mtsrr0 r12 102 113 103 lwz r12, 12 4(sp)114 lwz r12, 128(sp) 104 115 mtsrr1 r12 105 116 106 lwz r12, 1 28(sp)117 lwz r12, 132(sp) 107 118 mtlr r12 108 109 lwz r12, 132(sp)110 mtcr r12111 119 112 120 lwz r12, 136(sp) … … 115 123 lwz r12, 140(sp) 116 124 mtxer r12 117 118 mfsprg1 sp 119 mfsprg2 r12 120 125 126 lwz r12, 144(sp) 127 lwz sp, 148(sp) 128 129 rfi 130 131 iret_syscall: 132 133 # disable interrupts 134 135 mfmsr r31 136 rlwinm r31, r31, 0, 17, 15 137 mtmsr r31 138 139 lwz r0, 0(sp) 140 lwz r2, 4(sp) 141 lwz r4, 12(sp) 142 lwz r5, 16(sp) 143 lwz r6, 20(sp) 144 lwz r7, 24(sp) 145 lwz r8, 28(sp) 146 lwz r9, 32(sp) 147 lwz r10, 36(sp) 148 lwz r11, 40(sp) 149 lwz r13, 44(sp) 150 lwz r14, 48(sp) 151 lwz r15, 52(sp) 152 lwz r16, 56(sp) 153 lwz r17, 60(sp) 154 lwz r18, 64(sp) 155 lwz r19, 68(sp) 156 lwz r20, 72(sp) 157 lwz r21, 76(sp) 158 lwz r22, 80(sp) 159 lwz r23, 84(sp) 160 lwz r24, 88(sp) 161 lwz r25, 92(sp) 162 lwz r26, 96(sp) 163 lwz r27, 100(sp) 164 lwz r28, 104(sp) 165 lwz r29, 108(sp) 166 lwz r30, 112(sp) 167 lwz r31, 116(sp) 168 169 lwz r12, 120(sp) 170 mtcr r12 171 172 lwz r12, 124(sp) 173 mtsrr0 r12 174 175 lwz r12, 128(sp) 176 mtsrr1 r12 177 178 lwz r12, 132(sp) 179 mtlr r12 180 181 lwz r12, 136(sp) 182 mtctr r12 183 184 lwz r12, 140(sp) 185 mtxer r12 186 187 lwz r12, 144(sp) 188 lwz sp, 148(sp) 189 121 190 rfi 122 191 -
arch/ppc32/src/exception.S
r9417cdc re34a141 34 34 .macro CONTEXT_STORE 35 35 36 # save SP in SPRG1 37 # save R12 in SPRG2, backup CR in R12 38 39 mtsprg1 sp 40 mtsprg2 r12 36 # save R12 in SPRG1, backup CR in R12 37 # save SP in SPRG2 38 39 mtsprg1 r12 41 40 mfcr r12 41 mtsprg2 sp 42 42 43 43 # check whether SP is in kernel … … 56 56 # stack is in kernel 57 57 58 mfsprg 1sp58 mfsprg2 sp 59 59 subis sp, sp, 0x8000 60 60 61 61 2: 62 62 63 subi sp, sp, 14 063 subi sp, sp, 148 64 64 stw r0, 0(sp) 65 65 stw r2, 4(sp) … … 93 93 stw r31, 116(sp) 94 94 95 mfsrr0 r396 stw r3, 120(sp)97 98 mfsrr1 r399 stw r3, 124(sp)100 101 mflr r3102 stw r3, 128(sp)103 95 stw r12, 120(sp) 96 97 mfsrr0 r12 98 stw r12, 124(sp) 99 100 mfsrr1 r12 101 stw r12, 128(sp) 102 103 mflr r12 104 104 stw r12, 132(sp) 105 105 106 mfctr r3 107 stw r3, 136(sp) 108 109 mfxer r3 110 stw r3, 140(sp) 106 mfctr r12 107 stw r12, 136(sp) 108 109 mfxer r12 110 stw r12, 140(sp) 111 112 mfsprg1 r12 113 stw r12, 144(sp) 114 115 mfsprg2 r12 116 stw r12, 148(sp) 111 117 .endm 118 119 .org 0x060 120 jump_to_kernel: 121 lis r12, iret@ha 122 addi r12, r12, iret@l 123 mtlr r12 124 125 mfmsr r12 126 ori r12, r12, (msr_ir | msr_dr)@l 127 mtsrr1 r12 128 129 addis sp, sp, 0x8000 130 mr r4, sp 131 rfi 132 133 jump_to_kernel_syscall: 134 lis r12, syscall_handler@ha 135 addi r12, r12, syscall_handler@l 136 mtsrr0 r12 137 138 lis r12, iret_syscall@ha 139 addi r12, r12, iret_syscall@l 140 mtlr r12 141 142 mfmsr r12 143 ori r12, r12, (msr_ir | msr_dr)@l 144 mtsrr1 r12 145 146 addis sp, sp, 0x8000 147 rfi 112 148 113 149 .org 0x100 … … 126 162 CONTEXT_STORE 127 163 128 lis r3, pht_refill@ha 129 addi r3, r3, pht_refill@l 130 mtsrr0 r3 131 132 mfmsr r3 133 ori r3, r3, (msr_ir | msr_dr)@l 134 mtsrr1 r3 135 136 lis r3, iret@ha 137 addi r3, r3, iret@l 138 mtlr r3 139 140 addis sp, sp, 0x8000 164 lis r12, pht_refill@ha 165 addi r12, r12, pht_refill@l 166 mtsrr0 r12 167 141 168 li r3, 1 142 mr r4, sp 143 rfi 169 b jump_to_kernel 144 170 145 171 .org 0x400 … … 148 174 CONTEXT_STORE 149 175 150 lis r3, pht_refill@ha 151 addi r3, r3, pht_refill@l 152 mtsrr0 r3 153 154 mfmsr r3 155 ori r3, r3, (msr_ir | msr_dr)@l 156 mtsrr1 r3 157 158 lis r3, iret@ha 159 addi r3, r3, iret@l 160 mtlr r3 161 162 addis sp, sp, 0x8000 176 lis r12, pht_refill@ha 177 addi r12, r12, pht_refill@l 178 mtsrr0 r12 179 163 180 li r3, 0 164 mr r4, sp 165 rfi 181 b jump_to_kernel 166 182 167 183 .org 0x500 … … 190 206 CONTEXT_STORE 191 207 192 lis r3, exc_dispatch@ha 193 addi r3, r3, exc_dispatch@l 194 mtsrr0 r3 195 196 mfmsr r3 197 ori r3, r3, (msr_ir | msr_dr)@l 198 mtsrr1 r3 199 200 lis r3, iret@ha 201 addi r3, r3, iret@l 202 mtlr r3 203 204 addis sp, sp, 0x8000 208 lis r12, exc_dispatch@ha 209 addi r12, r12, exc_dispatch@l 210 mtsrr0 r12 211 205 212 li r3, 10 206 mr r4, sp 207 rfi 213 b jump_to_kernel 208 214 209 215 .org 0xa00 … … 220 226 .global exc_syscall 221 227 exc_syscall: 222 b exc_syscall 228 CONTEXT_STORE 229 230 b jump_to_kernel_syscall 223 231 224 232 .org 0xd00
Note:
See TracChangeset
for help on using the changeset viewer.