Skip to content

Commit 7dd7dff

Browse files
Mathieu Choplainnashif
authored andcommitted
arch: arm: cortex_m: pm_s2ram: ignore xPSR
Remove all xPSR-related registers from struct __cpu_context, and the associated save/restore code in S2RAM code, as they are not needed: * EPSR and IPSR are read-only - they cannot be "restored" * Bits N, V, Z, C, V, Q, and GE (if DSP Extension is implemented) of APSR could be restored, but this is not needed as the AAPCS indicates these bits to be "undefined on entry to or return from a public interface" Signed-off-by: Mathieu Choplain <[email protected]>
1 parent 1d6a89d commit 7dd7dff

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

arch/arm/core/cortex_m/pm_s2ram.S

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,6 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend)
4646
mrs r2, psplim
4747
str r2, [r1, #___cpu_context_t_psplim_OFFSET]
4848

49-
mrs r2, apsr
50-
str r2, [r1, #___cpu_context_t_apsr_OFFSET]
51-
52-
mrs r2, ipsr
53-
str r2, [r1, #___cpu_context_t_ipsr_OFFSET]
54-
55-
mrs r2, epsr
56-
str r2, [r1, #___cpu_context_t_epsr_OFFSET]
57-
5849
mrs r2, primask
5950
str r2, [r1, #___cpu_context_t_primask_OFFSET]
6051

@@ -129,15 +120,6 @@ resume:
129120
ldr r1, [r0, #___cpu_context_t_psplim_OFFSET]
130121
msr psplim, r1
131122

132-
ldr r1, [r0, #___cpu_context_t_apsr_OFFSET]
133-
msr apsr_nzcvq, r1
134-
135-
ldr r1, [r0, #___cpu_context_t_ipsr_OFFSET]
136-
msr ipsr, r1
137-
138-
ldr r1, [r0, #___cpu_context_t_epsr_OFFSET]
139-
msr epsr, r1
140-
141123
ldr r1, [r0, #___cpu_context_t_primask_OFFSET]
142124
msr primask, r1
143125

arch/arm/core/offsets/offsets_aarch32.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ GEN_OFFSET_SYM(_cpu_context_t, msp);
8686
GEN_OFFSET_SYM(_cpu_context_t, msplim);
8787
GEN_OFFSET_SYM(_cpu_context_t, psp);
8888
GEN_OFFSET_SYM(_cpu_context_t, psplim);
89-
GEN_OFFSET_SYM(_cpu_context_t, apsr);
90-
GEN_OFFSET_SYM(_cpu_context_t, ipsr);
91-
GEN_OFFSET_SYM(_cpu_context_t, epsr);
9289

9390
GEN_OFFSET_SYM(_cpu_context_t, primask);
9491
GEN_OFFSET_SYM(_cpu_context_t, faultmask);

include/zephyr/arch/arm/cortex_m/cpu.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ struct __cpu_context {
5757
uint32_t msplim;
5858
uint32_t psp;
5959
uint32_t psplim;
60-
uint32_t apsr;
61-
uint32_t ipsr;
62-
uint32_t epsr;
6360
uint32_t primask;
6461
uint32_t faultmask;
6562
uint32_t basepri;

0 commit comments

Comments
 (0)