Skip to content

Commit 5745eef

Browse files
author
Russell King
committed
ARM: rename S_FRAME_SIZE to PT_REGS_SIZE
S_FRAME_SIZE is no longer the size of the kernel stack frame, so this name is misleading. It is the size of the kernel pt_regs structure. Name it so. Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
1 parent 1a695a9 commit 5745eef

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎arch/arm/include/asm/assembler.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,13 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
480480
.macro uaccess_save, tmp
481481
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
482482
mrc p15, 0, \tmp, c3, c0, 0
483-
str \tmp, [sp, #S_FRAME_SIZE]
483+
str \tmp, [sp, #PT_REGS_SIZE]
484484
#endif
485485
.endm
486486

487487
.macro uaccess_restore
488488
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
489-
ldr r0, [sp, #S_FRAME_SIZE]
489+
ldr r0, [sp, #PT_REGS_SIZE]
490490
mcr p15, 0, r0, c3, c0, 0
491491
#endif
492492
.endm

‎arch/arm/kernel/asm-offsets.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int main(void)
107107
DEFINE(S_PC, offsetof(struct pt_regs, ARM_pc));
108108
DEFINE(S_PSR, offsetof(struct pt_regs, ARM_cpsr));
109109
DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0));
110-
DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs));
110+
DEFINE(PT_REGS_SIZE, sizeof(struct pt_regs));
111111
BLANK();
112112
#ifdef CONFIG_CACHE_L2X0
113113
DEFINE(L2X0_R_PHY_BASE, offsetof(struct l2x0_regs, phy_base));

‎arch/arm/kernel/entry-armv.S‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
* Invalid mode handlers
9393
*/
9494
.macro inv_entry, reason
95-
sub sp, sp, #S_FRAME_SIZE
95+
sub sp, sp, #PT_REGS_SIZE
9696
ARM( stmib sp, {r1 - lr} )
9797
THUMB( stmia sp, {r0 - r12} )
9898
THUMB( str sp, [sp, #S_SP] )
@@ -152,7 +152,7 @@ ENDPROC(__und_invalid)
152152
.macro svc_entry, stack_hole=0, trace=1, uaccess=1
153153
UNWIND(.fnstart )
154154
UNWIND(.save {r0 - pc} )
155-
sub sp, sp, #(S_FRAME_SIZE + 8 + \stack_hole - 4)
155+
sub sp, sp, #(PT_REGS_SIZE + 8 + \stack_hole - 4)
156156
#ifdef CONFIG_THUMB2_KERNEL
157157
SPFIX( str r0, [sp] ) @ temporarily saved
158158
SPFIX( mov r0, sp )
@@ -167,7 +167,7 @@ ENDPROC(__und_invalid)
167167
ldmia r0, {r3 - r5}
168168
add r7, sp, #S_SP - 4 @ here for interlock avoidance
169169
mov r6, #-1 @ "" "" "" ""
170-
add r2, sp, #(S_FRAME_SIZE + 8 + \stack_hole - 4)
170+
add r2, sp, #(PT_REGS_SIZE + 8 + \stack_hole - 4)
171171
SPFIX( addeq r2, r2, #4 )
172172
str r3, [sp, #-4]! @ save the "real" r0 copied
173173
@ from the exception stack
@@ -366,17 +366,17 @@ ENDPROC(__fiq_abt)
366366
/*
367367
* User mode handlers
368368
*
369-
* EABI note: sp_svc is always 64-bit aligned here, so should S_FRAME_SIZE
369+
* EABI note: sp_svc is always 64-bit aligned here, so should PT_REGS_SIZE
370370
*/
371371

372-
#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (S_FRAME_SIZE & 7)
372+
#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (PT_REGS_SIZE & 7)
373373
#error "sizeof(struct pt_regs) must be a multiple of 8"
374374
#endif
375375

376376
.macro usr_entry, trace=1, uaccess=1
377377
UNWIND(.fnstart )
378378
UNWIND(.cantunwind ) @ don't unwind the user space
379-
sub sp, sp, #S_FRAME_SIZE
379+
sub sp, sp, #PT_REGS_SIZE
380380
ARM( stmib sp, {r1 - r12} )
381381
THUMB( stmia sp, {r0 - r12} )
382382

‎arch/arm/kernel/entry-common.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ ENTRY(vector_swi)
145145
#ifdef CONFIG_CPU_V7M
146146
v7m_exception_entry
147147
#else
148-
sub sp, sp, #S_FRAME_SIZE
148+
sub sp, sp, #PT_REGS_SIZE
149149
stmia sp, {r0 - r12} @ Calling r0 - r12
150150
ARM( add r8, sp, #S_PC )
151151
ARM( stmdb r8, {sp, lr}^ ) @ Calling sp, lr

‎arch/arm/kernel/entry-header.S‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
@ Linux expects to have irqs off. Do it here before taking stack space
9191
cpsid i
9292

93-
sub sp, #S_FRAME_SIZE-S_IP
93+
sub sp, #PT_REGS_SIZE-S_IP
9494
stmdb sp!, {r0-r11}
9595

9696
@ load saved r12, lr, return address and xPSR.
@@ -160,7 +160,7 @@
160160
ldmia sp!, {r0-r11}
161161

162162
@ restore main sp
163-
add sp, sp, #S_FRAME_SIZE-S_IP
163+
add sp, sp, #PT_REGS_SIZE-S_IP
164164

165165
cpsie i
166166
bx lr
@@ -307,7 +307,7 @@
307307
.endif
308308
mov r0, r0 @ ARMv5T and earlier require a nop
309309
@ after ldm {}^
310-
add sp, sp, #\offset + S_FRAME_SIZE
310+
add sp, sp, #\offset + PT_REGS_SIZE
311311
movs pc, lr @ return & move spsr_svc into cpsr
312312
#elif defined(CONFIG_CPU_V7M)
313313
@ V7M restore.
@@ -334,7 +334,7 @@
334334
.else
335335
ldmdb sp, {r0 - r12} @ get calling r0 - r12
336336
.endif
337-
add sp, sp, #S_FRAME_SIZE - S_SP
337+
add sp, sp, #PT_REGS_SIZE - S_SP
338338
movs pc, lr @ return & move spsr_svc into cpsr
339339
#endif /* !CONFIG_THUMB2_KERNEL */
340340
.endm

‎arch/arm/kernel/entry-v7m.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ __irq_entry:
7373
@ correctness they don't need to be restored. So only r8-r11 must be
7474
@ restored here. The easiest way to do so is to restore r0-r7, too.
7575
ldmia sp!, {r0-r11}
76-
add sp, #S_FRAME_SIZE-S_IP
76+
add sp, #PT_REGS_SIZE-S_IP
7777
cpsie i
7878
bx lr
7979
ENDPROC(__irq_entry)

0 commit comments

Comments
 (0)