trap_subr64.S (223479) | trap_subr64.S (223485) |
---|---|
1/* $FreeBSD: head/sys/powerpc/aim/trap_subr64.S 223479 2011-06-23 16:34:41Z nwhitehorn $ */ | 1/* $FreeBSD: head/sys/powerpc/aim/trap_subr64.S 223485 2011-06-23 22:21:28Z nwhitehorn $ */ |
2/* $NetBSD: trap_subr.S,v 1.20 2002/04/22 23:20:08 kleink Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 6 * Copyright (C) 1995, 1996 TooLs GmbH. 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 164 unchanged lines hidden (view full) --- 174 mfctr %r4; \ 175 mfsprg3 %r5; \ 176 std %r3, FRAME_XER+48(1); /* save xer/ctr/exc */ \ 177 std %r4, FRAME_CTR+48(1); \ 178 std %r5, FRAME_EXC+48(1); \ 179 std %r28,FRAME_AIM_DAR+48(1); \ 180 std %r29,FRAME_AIM_DSISR+48(1); /* save dsisr/srr0/srr1 */ \ 181 std %r30,FRAME_SRR0+48(1); \ | 2/* $NetBSD: trap_subr.S,v 1.20 2002/04/22 23:20:08 kleink Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 6 * Copyright (C) 1995, 1996 TooLs GmbH. 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 164 unchanged lines hidden (view full) --- 174 mfctr %r4; \ 175 mfsprg3 %r5; \ 176 std %r3, FRAME_XER+48(1); /* save xer/ctr/exc */ \ 177 std %r4, FRAME_CTR+48(1); \ 178 std %r5, FRAME_EXC+48(1); \ 179 std %r28,FRAME_AIM_DAR+48(1); \ 180 std %r29,FRAME_AIM_DSISR+48(1); /* save dsisr/srr0/srr1 */ \ 181 std %r30,FRAME_SRR0+48(1); \ |
182 std %r31,FRAME_SRR1+48(1) | 182 std %r31,FRAME_SRR1+48(1); \ 183 ld %r13,PC_CURTHREAD(%r2) /* set kernel curthread */ |
183 184#define FRAME_LEAVE(savearea) \ | 184 185#define FRAME_LEAVE(savearea) \ |
186/* Disable exceptions: */ \ 187 mfmsr %r2; \ 188 andi. %r2,%r2,~PSL_EE@l; \ 189 mtmsr %r2; \ 190 isync; \ |
|
185/* Now restore regs: */ \ 186 ld %r2,FRAME_SRR0+48(%r1); \ 187 ld %r3,FRAME_SRR1+48(%r1); \ 188 ld %r4,FRAME_CTR+48(%r1); \ 189 ld %r5,FRAME_XER+48(%r1); \ 190 ld %r6,FRAME_LR+48(%r1); \ 191 GET_CPUINFO(%r7); \ 192 std %r2,(savearea+CPUSAVE_SRR0)(%r7); /* save SRR0 */ \ --- 35 unchanged lines hidden (view full) --- 228 ld %r2, FRAME_2+48(%r1); \ 229 ld %r0, FRAME_0+48(%r1); \ 230 ld %r1, FRAME_1+48(%r1); \ 231/* Can't touch %r1 from here on */ \ 232 mtsprg2 %r2; /* save r2 & r3 */ \ 233 mtsprg3 %r3; \ 234/* Disable translation, machine check and recoverability: */ \ 235 mfmsr %r2; \ | 191/* Now restore regs: */ \ 192 ld %r2,FRAME_SRR0+48(%r1); \ 193 ld %r3,FRAME_SRR1+48(%r1); \ 194 ld %r4,FRAME_CTR+48(%r1); \ 195 ld %r5,FRAME_XER+48(%r1); \ 196 ld %r6,FRAME_LR+48(%r1); \ 197 GET_CPUINFO(%r7); \ 198 std %r2,(savearea+CPUSAVE_SRR0)(%r7); /* save SRR0 */ \ --- 35 unchanged lines hidden (view full) --- 234 ld %r2, FRAME_2+48(%r1); \ 235 ld %r0, FRAME_0+48(%r1); \ 236 ld %r1, FRAME_1+48(%r1); \ 237/* Can't touch %r1 from here on */ \ 238 mtsprg2 %r2; /* save r2 & r3 */ \ 239 mtsprg3 %r3; \ 240/* Disable translation, machine check and recoverability: */ \ 241 mfmsr %r2; \ |
236 andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_EE|PSL_ME|PSL_RI)@l; \ | 242 andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ |
237 mtmsr %r2; \ 238 isync; \ 239/* Decide whether we return to user mode: */ \ 240 GET_CPUINFO(%r2); \ 241 ld %r3,(savearea+CPUSAVE_SRR1)(%r2); \ 242 mtcr %r3; \ 243 bf 17,1f; /* branch if PSL_PR is false */ \ 244/* Restore user SRs */ \ --- 276 unchanged lines hidden (view full) --- 521 mtmsr %r3 522 isync 523/* Test AST pending: */ 524 ld %r5,FRAME_SRR1+48(%r1) 525 mtcr %r5 526 bf 17,1f /* branch if PSL_PR is false */ 527 528 GET_CPUINFO(%r3) /* get per-CPU pointer */ | 243 mtmsr %r2; \ 244 isync; \ 245/* Decide whether we return to user mode: */ \ 246 GET_CPUINFO(%r2); \ 247 ld %r3,(savearea+CPUSAVE_SRR1)(%r2); \ 248 mtcr %r3; \ 249 bf 17,1f; /* branch if PSL_PR is false */ \ 250/* Restore user SRs */ \ --- 276 unchanged lines hidden (view full) --- 527 mtmsr %r3 528 isync 529/* Test AST pending: */ 530 ld %r5,FRAME_SRR1+48(%r1) 531 mtcr %r5 532 bf 17,1f /* branch if PSL_PR is false */ 533 534 GET_CPUINFO(%r3) /* get per-CPU pointer */ |
529 ld %r4, PC_CURTHREAD(%r3) /* deref to get curthread */ 530 lwz %r4, TD_FLAGS(%r4) /* get thread flags value */ | 535 lwz %r4, TD_FLAGS(%r13) /* get thread flags value */ |
531 lis %r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@h 532 ori %r5,%r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@l 533 and. %r4,%r4,%r5 534 beq 1f 535 mfmsr %r3 /* re-enable interrupts */ 536 ori %r3,%r3,PSL_EE@l 537 mtmsr %r3 538 isync --- 111 unchanged lines hidden --- | 536 lis %r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@h 537 ori %r5,%r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@l 538 and. %r4,%r4,%r5 539 beq 1f 540 mfmsr %r3 /* re-enable interrupts */ 541 ori %r3,%r3,PSL_EE@l 542 mtmsr %r3 543 isync --- 111 unchanged lines hidden --- |