Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/aim/trap_subr64.S
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | 1: ld %r31, 0(%r28) /* Load SLB entry pointer */ | ||||
addi %r29, %r29, 1 | addi %r29, %r29, 1 | ||||
b 1b /* Repeat */ | b 1b /* Repeat */ | ||||
/* | /* | ||||
* Kernel SRs are loaded directly from the PCPU fields | * Kernel SRs are loaded directly from the PCPU fields | ||||
*/ | */ | ||||
restore_kernsrs: | restore_kernsrs: | ||||
GET_CPUINFO(%r28) | GET_CPUINFO(%r28) | ||||
lwz %r29, PC_FLAGS(%r28) | |||||
mtcr %r29 | |||||
btlr 0 | |||||
addi %r28,%r28,PC_KERNSLB | addi %r28,%r28,PC_KERNSLB | ||||
ld %r29,16(%r28) /* One past USER_SLB_SLOT */ | ld %r29,16(%r28) /* One past USER_SLB_SLOT */ | ||||
cmpdi %r29,0 | cmpdi %r29,0 | ||||
beqlr /* If first kernel entry is invalid, | beqlr /* If first kernel entry is invalid, | ||||
* SLBs not in use, so exit early */ | * SLBs not in use, so exit early */ | ||||
/* Otherwise, set up SLBs */ | /* Otherwise, set up SLBs */ | ||||
li %r29, 0 /* Set the counter to zero */ | li %r29, 0 /* Set the counter to zero */ | ||||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | /* Decide whether we return to user mode: */ \ | ||||
bf 17,1f; /* branch if PSL_PR is false */ \ | bf 17,1f; /* branch if PSL_PR is false */ \ | ||||
/* Restore user SRs */ \ | /* Restore user SRs */ \ | ||||
GET_CPUINFO(%r3); \ | GET_CPUINFO(%r3); \ | ||||
std %r27,(savearea+CPUSAVE_R27)(%r3); \ | std %r27,(savearea+CPUSAVE_R27)(%r3); \ | ||||
std %r28,(savearea+CPUSAVE_R28)(%r3); \ | std %r28,(savearea+CPUSAVE_R28)(%r3); \ | ||||
std %r29,(savearea+CPUSAVE_R29)(%r3); \ | std %r29,(savearea+CPUSAVE_R29)(%r3); \ | ||||
std %r30,(savearea+CPUSAVE_R30)(%r3); \ | std %r30,(savearea+CPUSAVE_R30)(%r3); \ | ||||
std %r31,(savearea+CPUSAVE_R31)(%r3); \ | std %r31,(savearea+CPUSAVE_R31)(%r3); \ | ||||
lwz %r28,PC_FLAGS(%r3); \ | |||||
mtcr %r28; \ | |||||
bt 0, 0f; /* Check to skip restoring SRs. */ \ | |||||
mflr %r27; /* preserve LR */ \ | mflr %r27; /* preserve LR */ \ | ||||
bl restore_usersrs; /* uses r28-r31 */ \ | bl restore_usersrs; /* uses r28-r31 */ \ | ||||
mtlr %r27; \ | mtlr %r27; \ | ||||
0: \ | |||||
ld %r31,(savearea+CPUSAVE_R31)(%r3); \ | ld %r31,(savearea+CPUSAVE_R31)(%r3); \ | ||||
ld %r30,(savearea+CPUSAVE_R30)(%r3); \ | ld %r30,(savearea+CPUSAVE_R30)(%r3); \ | ||||
ld %r29,(savearea+CPUSAVE_R29)(%r3); \ | ld %r29,(savearea+CPUSAVE_R29)(%r3); \ | ||||
ld %r28,(savearea+CPUSAVE_R28)(%r3); \ | ld %r28,(savearea+CPUSAVE_R28)(%r3); \ | ||||
ld %r27,(savearea+CPUSAVE_R27)(%r3); \ | ld %r27,(savearea+CPUSAVE_R27)(%r3); \ | ||||
1: mfsprg2 %r3; /* restore cr */ \ | 1: mfsprg2 %r3; /* restore cr */ \ | ||||
mtcr %r3; \ | mtcr %r3; \ | ||||
GET_CPUINFO(%r3); \ | GET_CPUINFO(%r3); \ | ||||
▲ Show 20 Lines • Show All 696 Lines • Show Last 20 Lines |