Commit 7ecc6c1d authored by Eugeniy Paltsev's avatar Eugeniy Paltsev Committed by Vineet Gupta

ARC: pt_regs: remove hardcoded registers offset

Replace hardcoded registers offset numbers by calculated via
offsetof.
Signed-off-by: default avatarEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent 833a20b8
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
#endif #endif
#ifdef CONFIG_ARC_HAS_ACCL_REGS #ifdef CONFIG_ARC_HAS_ACCL_REGS
ST2 r58, r59, PT_sp + 12 ST2 r58, r59, PT_r58
#endif #endif
.endm .endm
...@@ -172,8 +172,8 @@ ...@@ -172,8 +172,8 @@
LD2 gp, fp, PT_r26 ; gp (r26), fp (r27) LD2 gp, fp, PT_r26 ; gp (r26), fp (r27)
ld r12, [sp, PT_sp + 4] ld r12, [sp, PT_r12]
ld r30, [sp, PT_sp + 8] ld r30, [sp, PT_r30]
; Restore SP (into AUX_USER_SP) only if returning to U mode ; Restore SP (into AUX_USER_SP) only if returning to U mode
; - for K mode, it will be implicitly restored as stack is unwound ; - for K mode, it will be implicitly restored as stack is unwound
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
#endif #endif
#ifdef CONFIG_ARC_HAS_ACCL_REGS #ifdef CONFIG_ARC_HAS_ACCL_REGS
LD2 r58, r59, PT_sp + 12 LD2 r58, r59, PT_r58
#endif #endif
.endm .endm
......
...@@ -67,5 +67,14 @@ int main(void) ...@@ -67,5 +67,14 @@ int main(void)
DEFINE(SZ_CALLEE_REGS, sizeof(struct callee_regs)); DEFINE(SZ_CALLEE_REGS, sizeof(struct callee_regs));
DEFINE(SZ_PT_REGS, sizeof(struct pt_regs)); DEFINE(SZ_PT_REGS, sizeof(struct pt_regs));
#ifdef CONFIG_ISA_ARCV2
OFFSET(PT_r12, pt_regs, r12);
OFFSET(PT_r30, pt_regs, r30);
#endif
#ifdef CONFIG_ARC_HAS_ACCL_REGS
OFFSET(PT_r58, pt_regs, r58);
OFFSET(PT_r59, pt_regs, r59);
#endif
return 0; return 0;
} }
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