Commit 306b1c06 authored by Michael Neuling's avatar Michael Neuling Committed by Michael Ellerman

powerpc/tm: Reformat comments

The comments in this file don't conform to the coding style so take
them to "Comment Formatting Re-Education Camp".
Suggested-by: default avatarMichael "Camp Drill Sergeant" Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
[mpe: Reflow some comments and add full stops, fix spelling of Sergeant.]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 5bd9b444
...@@ -92,7 +92,8 @@ _GLOBAL(tm_abort) ...@@ -92,7 +92,8 @@ _GLOBAL(tm_abort)
blr blr
EXPORT_SYMBOL_GPL(tm_abort); EXPORT_SYMBOL_GPL(tm_abort);
/* void tm_reclaim(struct thread_struct *thread, /*
* void tm_reclaim(struct thread_struct *thread,
* uint8_t cause) * uint8_t cause)
* *
* - Performs a full reclaim. This destroys outstanding * - Performs a full reclaim. This destroys outstanding
...@@ -163,26 +164,27 @@ _GLOBAL(tm_reclaim) ...@@ -163,26 +164,27 @@ _GLOBAL(tm_reclaim)
*/ */
TRECLAIM(R4) /* Cause in r4 */ TRECLAIM(R4) /* Cause in r4 */
/* ******************** GPRs ******************** */ /*
/* Stash the checkpointed r13 away in the scratch SPR and get the real * ******************** GPRs ********************
* paca * Stash the checkpointed r13 in the scratch SPR and get the real paca.
*/ */
SET_SCRATCH0(r13) SET_SCRATCH0(r13)
GET_PACA(r13) GET_PACA(r13)
/* Stash the checkpointed r1 away in paca tm_scratch and get the real /*
* stack pointer back * Stash the checkpointed r1 away in paca->tm_scratch and get the real
* stack pointer back into r1.
*/ */
std r1, PACATMSCRATCH(r13) std r1, PACATMSCRATCH(r13)
ld r1, PACAR1(r13) ld r1, PACAR1(r13)
/* Store the PPR in r11 and reset to decent value */
std r11, GPR11(r1) /* Temporary stash */ std r11, GPR11(r1) /* Temporary stash */
/* Reset MSR RI so we can take SLB faults again */ /* Reset MSR RI so we can take SLB faults again */
li r11, MSR_RI li r11, MSR_RI
mtmsrd r11, 1 mtmsrd r11, 1
/* Store the PPR in r11 and reset to decent value */
mfspr r11, SPRN_PPR mfspr r11, SPRN_PPR
HMT_MEDIUM HMT_MEDIUM
...@@ -195,14 +197,15 @@ _GLOBAL(tm_reclaim) ...@@ -195,14 +197,15 @@ _GLOBAL(tm_reclaim)
addi r7, r12, PT_CKPT_REGS /* Thread's ckpt_regs */ addi r7, r12, PT_CKPT_REGS /* Thread's ckpt_regs */
/* Make r7 look like an exception frame so that we /*
* can use the neat GPRx(n) macros. r7 is NOT a pt_regs ptr! * Make r7 look like an exception frame so that we can use the neat
* GPRx(n) macros. r7 is NOT a pt_regs ptr!
*/ */
subi r7, r7, STACK_FRAME_OVERHEAD subi r7, r7, STACK_FRAME_OVERHEAD
/* Sync the userland GPRs 2-12, 14-31 to thread->regs: */ /* Sync the userland GPRs 2-12, 14-31 to thread->regs: */
SAVE_GPR(0, r7) /* user r0 */ SAVE_GPR(0, r7) /* user r0 */
SAVE_GPR(2, r7) /* user r2 */ SAVE_GPR(2, r7) /* user r2 */
SAVE_4GPRS(3, r7) /* user r3-r6 */ SAVE_4GPRS(3, r7) /* user r3-r6 */
SAVE_GPR(8, r7) /* user r8 */ SAVE_GPR(8, r7) /* user r8 */
SAVE_GPR(9, r7) /* user r9 */ SAVE_GPR(9, r7) /* user r9 */
...@@ -223,7 +226,8 @@ _GLOBAL(tm_reclaim) ...@@ -223,7 +226,8 @@ _GLOBAL(tm_reclaim)
/* ******************** NIP ******************** */ /* ******************** NIP ******************** */
mfspr r3, SPRN_TFHAR mfspr r3, SPRN_TFHAR
std r3, _NIP(r7) /* Returns to failhandler */ std r3, _NIP(r7) /* Returns to failhandler */
/* The checkpointed NIP is ignored when rescheduling/rechkpting, /*
* The checkpointed NIP is ignored when rescheduling/rechkpting,
* but is used in signal return to 'wind back' to the abort handler. * but is used in signal return to 'wind back' to the abort handler.
*/ */
...@@ -246,12 +250,13 @@ _GLOBAL(tm_reclaim) ...@@ -246,12 +250,13 @@ _GLOBAL(tm_reclaim)
std r3, THREAD_TM_TAR(r12) std r3, THREAD_TM_TAR(r12)
std r4, THREAD_TM_DSCR(r12) std r4, THREAD_TM_DSCR(r12)
/* MSR and flags: We don't change CRs, and we don't need to alter /*
* MSR. * MSR and flags: We don't change CRs, and we don't need to alter MSR.
*/ */
/* ******************** FPR/VR/VSRs ************ /*
* ******************** FPR/VR/VSRs ************
* After reclaiming, capture the checkpointed FPRs/VRs. * After reclaiming, capture the checkpointed FPRs/VRs.
* *
* We enabled VEC/FP/VSX in the msr above, so we can execute these * We enabled VEC/FP/VSX in the msr above, so we can execute these
...@@ -277,7 +282,8 @@ _GLOBAL(tm_reclaim) ...@@ -277,7 +282,8 @@ _GLOBAL(tm_reclaim)
stfd fr0,FPSTATE_FPSCR(r7) stfd fr0,FPSTATE_FPSCR(r7)
/* TM regs, incl TEXASR -- these live in thread_struct. Note they've /*
* TM regs, incl TEXASR -- these live in thread_struct. Note they've
* been updated by the treclaim, to explain to userland the failure * been updated by the treclaim, to explain to userland the failure
* cause (aborted). * cause (aborted).
*/ */
...@@ -313,7 +319,7 @@ _GLOBAL(tm_reclaim) ...@@ -313,7 +319,7 @@ _GLOBAL(tm_reclaim)
blr blr
/* /*
* void __tm_recheckpoint(struct thread_struct *thread) * void __tm_recheckpoint(struct thread_struct *thread)
* - Restore the checkpointed register state saved by tm_reclaim * - Restore the checkpointed register state saved by tm_reclaim
* when we switch_to a process. * when we switch_to a process.
...@@ -329,7 +335,8 @@ _GLOBAL(__tm_recheckpoint) ...@@ -329,7 +335,8 @@ _GLOBAL(__tm_recheckpoint)
std r2, STK_GOT(r1) std r2, STK_GOT(r1)
stdu r1, -TM_FRAME_SIZE(r1) stdu r1, -TM_FRAME_SIZE(r1)
/* We've a struct pt_regs at [r1+STACK_FRAME_OVERHEAD]. /*
* We've a struct pt_regs at [r1+STACK_FRAME_OVERHEAD].
* This is used for backing up the NVGPRs: * This is used for backing up the NVGPRs:
*/ */
SAVE_NVGPRS(r1) SAVE_NVGPRS(r1)
...@@ -338,8 +345,9 @@ _GLOBAL(__tm_recheckpoint) ...@@ -338,8 +345,9 @@ _GLOBAL(__tm_recheckpoint)
addi r7, r3, PT_CKPT_REGS /* Thread's ckpt_regs */ addi r7, r3, PT_CKPT_REGS /* Thread's ckpt_regs */
/* Make r7 look like an exception frame so that we /*
* can use the neat GPRx(n) macros. r7 is now NOT a pt_regs ptr! * Make r7 look like an exception frame so that we can use the neat
* GPRx(n) macros. r7 is now NOT a pt_regs ptr!
*/ */
subi r7, r7, STACK_FRAME_OVERHEAD subi r7, r7, STACK_FRAME_OVERHEAD
...@@ -407,14 +415,15 @@ restore_gprs: ...@@ -407,14 +415,15 @@ restore_gprs:
REST_NVGPRS(r7) /* GPR14-31 */ REST_NVGPRS(r7) /* GPR14-31 */
/* Load up PPR and DSCR here so we don't run with user values for long /* Load up PPR and DSCR here so we don't run with user values for long */
*/
mtspr SPRN_DSCR, r5 mtspr SPRN_DSCR, r5
mtspr SPRN_PPR, r6 mtspr SPRN_PPR, r6
/* Do final sanity check on TEXASR to make sure FS is set. Do this /*
* Do final sanity check on TEXASR to make sure FS is set. Do this
* here before we load up the userspace r1 so any bugs we hit will get * here before we load up the userspace r1 so any bugs we hit will get
* a call chain */ * a call chain.
*/
mfspr r5, SPRN_TEXASR mfspr r5, SPRN_TEXASR
srdi r5, r5, 16 srdi r5, r5, 16
li r6, (TEXASR_FS)@h li r6, (TEXASR_FS)@h
...@@ -422,8 +431,9 @@ restore_gprs: ...@@ -422,8 +431,9 @@ restore_gprs:
1: tdeqi r6, 0 1: tdeqi r6, 0
EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0 EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0
/* Do final sanity check on MSR to make sure we are not transactional /*
* or suspended * Do final sanity check on MSR to make sure we are not transactional
* or suspended.
*/ */
mfmsr r6 mfmsr r6
li r5, (MSR_TS_MASK)@higher li r5, (MSR_TS_MASK)@higher
...@@ -439,8 +449,8 @@ restore_gprs: ...@@ -439,8 +449,8 @@ restore_gprs:
REST_GPR(6, r7) REST_GPR(6, r7)
/* /*
* Store r1 and r5 on the stack so that we can access them * Store r1 and r5 on the stack so that we can access them after we
* after we clear MSR RI. * clear MSR RI.
*/ */
REST_GPR(5, r7) REST_GPR(5, r7)
...@@ -470,7 +480,8 @@ restore_gprs: ...@@ -470,7 +480,8 @@ restore_gprs:
HMT_MEDIUM HMT_MEDIUM
/* Our transactional state has now changed. /*
* Our transactional state has now changed.
* *
* Now just get out of here. Transactional (current) state will be * Now just get out of here. Transactional (current) state will be
* updated once restore is called on the return path in the _switch-ed * updated once restore is called on the return path in the _switch-ed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment