Skip to content

Commit 453557f

Browse files
committed
arch/xtensa: Rename "ALLOCA" ZSR to "A0SAVE"
This register alias was originally introduced to allow A0 to be used as a scratch register when handling exceptions from MOVSP instructions. (It replaced some upstream code from Cadence that hard-coded EXCSAVE1). Now the MMU code is now using too, and for exactly the same purpose. Calling it "ALLOCA" is only confusing. Rename it to make it clear what it's doing. Signed-off-by: Andy Ross <andyross@google.com>
1 parent 7c3705d commit 453557f

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

arch/xtensa/core/gen_zsr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# -dM") core-isa.h file for the current architecture and assigns
1212
# registers to usages.
1313

14-
NEEDED = ("ALLOCA", "CPU", "FLUSH")
14+
NEEDED = ("A0SAVE", "CPU", "FLUSH")
1515

1616
coreisa = sys.argv[1]
1717
outfile = sys.argv[2]

arch/xtensa/core/window_vectors.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ _WindowUnderflow4:
8484
/* Handle alloca exception generated by interruptee executing 'movsp'.
8585
* This uses space between the window vectors, so is essentially
8686
* "free". All interruptee's regs are intact except a0 which is saved
87-
* in $ZSR_ALLOCA (assigned at build time, see gen_zsr.py for
87+
* in $ZSR_A0SAVE (assigned at build time, see gen_zsr.py for
8888
* details), and PS.EXCM has been set by the exception hardware (can't
8989
* be interrupted). The fact the alloca exception was taken means the
9090
* registers associated with the base-save area have been spilled and
@@ -102,7 +102,7 @@ _xt_alloca_exc:
102102
rsr a2, PS
103103
extui a3, a2, XCHAL_PS_OWB_SHIFT, XCHAL_PS_OWB_BITS
104104
xor a3, a3, a4 /* bits changed from old to current windowbase */
105-
rsr a4, ZSR_ALLOCA /* restore original a0 (now in a4) */
105+
rsr a4, ZSR_A0SAVE /* restore original a0 (now in a4) */
106106
slli a3, a3, XCHAL_PS_OWB_SHIFT
107107
xor a2, a2, a3 /* flip changed bits in old window base */
108108
wsr a2, PS /* update PS.OWB to new window base */

arch/xtensa/core/xtensa-asm2-util.S

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ DEF_EXCINT XCHAL_DEBUGLEVEL, _handle_excint, xtensa_debugint_c
342342
.pushsection .UserExceptionVector.text, "ax"
343343
.global _Level1RealVector
344344
_Level1RealVector:
345-
wsr a0, ZSR_ALLOCA
345+
wsr a0, ZSR_A0SAVE
346346
rsync
347347
rsr.exccause a0
348348
#ifdef CONFIG_XTENSA_MMU
@@ -355,7 +355,7 @@ _Level1RealVector:
355355

356356
j _xt_alloca_exc
357357
_not_alloca:
358-
rsr a0, ZSR_ALLOCA
358+
rsr a0, ZSR_A0SAVE
359359
j _Level1Vector
360360
#ifdef CONFIG_XTENSA_MMU
361361
_handle_tlb_miss_user:
@@ -374,7 +374,7 @@ _handle_tlb_miss_user:
374374
*/
375375
rsr.ptevaddr a0
376376
l32i a0, a0, 0
377-
rsr a0, ZSR_ALLOCA
377+
rsr a0, ZSR_A0SAVE
378378
rfe
379379
#endif /* CONFIG_XTENSA_MMU */
380380
.popsection
@@ -391,12 +391,12 @@ _handle_tlb_miss_user:
391391
.global _KernelExceptionVector
392392
_KernelExceptionVector:
393393
#ifdef CONFIG_XTENSA_MMU
394-
wsr a0, ZSR_ALLOCA
394+
wsr a0, ZSR_A0SAVE
395395
rsr.exccause a0
396396
beqi a0, EXCCAUSE_ITLB_MISS, _handle_tlb_miss_kernel
397397
addi a0, a0, -EXCCAUSE_DTLB_MISS
398398
beqz a0, _handle_tlb_miss_kernel
399-
rsr a0, ZSR_ALLOCA
399+
rsr a0, ZSR_A0SAVE
400400
#endif
401401
j _Level1Vector
402402
#ifdef CONFIG_XTENSA_MMU
@@ -410,7 +410,7 @@ _handle_tlb_miss_kernel:
410410
*/
411411
rsr.ptevaddr a0
412412
l32i a0, a0, 0
413-
rsr a0, ZSR_ALLOCA
413+
rsr a0, ZSR_A0SAVE
414414
rfe
415415
#endif
416416
.popsection
@@ -420,14 +420,14 @@ _handle_tlb_miss_kernel:
420420
.global _DoubleExceptionVector
421421
_DoubleExceptionVector:
422422
#ifdef CONFIG_XTENSA_MMU
423-
wsr a0, ZSR_ALLOCA
423+
wsr a0, ZSR_A0SAVE
424424
rsync
425425

426426
rsr.exccause a0
427427
addi a0, a0, -EXCCAUSE_DTLB_MISS
428428
beqz a0, _handle_tlb_miss_dblexc
429429

430-
rsr a0, ZSR_ALLOCA
430+
rsr a0, ZSR_A0SAVE
431431
#endif
432432
#if defined(CONFIG_SIMULATOR_XTENSA) || defined(XT_SIMULATOR)
433433
1:
@@ -459,7 +459,7 @@ _handle_tlb_miss_dblexc:
459459
rsr.ptevaddr a0
460460
l32i a0, a0, 0
461461

462-
rsr a0, ZSR_ALLOCA
462+
rsr a0, ZSR_A0SAVE
463463
rfde
464464
#endif
465465
.popsection

0 commit comments

Comments
 (0)