Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/aim/trap_subr32.S
Show First 20 Lines • Show All 342 Lines • ▼ Show 20 Lines | |||||
* (except ISI/DSI, ALI, and the interrupts) | * (except ISI/DSI, ALI, and the interrupts) | ||||
*/ | */ | ||||
.globl CNAME(trapcode),CNAME(trapcodeend) | .globl CNAME(trapcode),CNAME(trapcodeend) | ||||
CNAME(trapcode): | CNAME(trapcode): | ||||
mtsprg1 %r1 /* save SP */ | mtsprg1 %r1 /* save SP */ | ||||
mflr %r1 /* Save the old LR in r1 */ | mflr %r1 /* Save the old LR in r1 */ | ||||
mtsprg2 %r1 /* And then in SPRG2 */ | mtsprg2 %r1 /* And then in SPRG2 */ | ||||
lwz %r1, TRAP_GENTRAP(0) /* Get branch address */ | lwz %r1, TRAP_ENTRY(0) /* Get branch address */ | ||||
mtlr %r1 | mtlr %r1 | ||||
li %r1, 0xe0 /* How to get the vector from LR */ | li %r1, 0xe0 /* How to get the vector from LR */ | ||||
blrl /* LR & (0xff00 | r1) is exception # */ | blrl /* LR & (0xff00 | r1) is exception # */ | ||||
CNAME(trapcodeend): | CNAME(trapcodeend): | ||||
/* | /* | ||||
* For ALI: has to save DSISR and DAR | * For ALI: has to save DSISR and DAR | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 543 Lines • ▼ Show 20 Lines | CNAME(dblow): | ||||
mtcr %r1 | mtcr %r1 | ||||
bf 17,1f /* branch if privileged */ | bf 17,1f /* branch if privileged */ | ||||
/* Unprivileged case */ | /* Unprivileged case */ | ||||
mtcr %r29 /* put the condition register back */ | mtcr %r29 /* put the condition register back */ | ||||
mfsprg2 %r29 /* ... and r29 */ | mfsprg2 %r29 /* ... and r29 */ | ||||
mflr %r1 /* save LR */ | mflr %r1 /* save LR */ | ||||
mtsprg2 %r1 /* And then in SPRG2 */ | mtsprg2 %r1 /* And then in SPRG2 */ | ||||
lwz %r1, TRAP_GENTRAP(0) /* Get branch address */ | lwz %r1, TRAP_ENTRY(0) /* Get branch address */ | ||||
mtlr %r1 | mtlr %r1 | ||||
li %r1, 0 /* How to get the vector from LR */ | li %r1, 0 /* How to get the vector from LR */ | ||||
blrl /* LR & (0xff00 | r1) is exception # */ | blrl /* LR & (0xff00 | r1) is exception # */ | ||||
1: | 1: | ||||
/* Privileged, so drop to KDB */ | /* Privileged, so drop to KDB */ | ||||
GET_CPUINFO(%r1) | GET_CPUINFO(%r1) | ||||
stw %r28,(PC_DBSAVE+CPUSAVE_R28)(%r1) /* free r28 */ | stw %r28,(PC_DBSAVE+CPUSAVE_R28)(%r1) /* free r28 */ | ||||
mfsprg2 %r28 /* r29 holds cr... */ | mfsprg2 %r28 /* r29 holds cr... */ | ||||
Show All 12 Lines |