Skip to content

Commit 6b08206

Browse files
dcpleungcfriedt
authored andcommitted
xtensa: move saved FPU and HIFI registers to end of BSA
This moves the block of FPU and HIFI registers in the Base Save Area (BSA), used during interrupts and exceptions, to the end of the block. This is done to minimize code usage in the vector text section. During interrupt entrance, the code stores a small set of registers first before jumping to the long handler. When the offset to these registers from the beginning of BSA is small enough, the compiler will emit S32I.N instead of S32I. This saves us one byte per store (2 vs 3 bytes). This is mainly done to avoid overflowing the vector text area. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
1 parent 6877bc8 commit 6b08206

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

arch/xtensa/include/xtensa_asm2_context.h

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,31 @@
152152
* are saved after the BSA.
153153
*/
154154
struct xtensa_irq_base_save_area {
155+
#if XCHAL_HAVE_THREADPTR
156+
uintptr_t threadptr;
157+
#endif
158+
159+
#if XCHAL_HAVE_S32C1I
160+
uintptr_t scompare1;
161+
#endif
162+
163+
uintptr_t exccause;
164+
uintptr_t excvaddr;
165+
166+
#if XCHAL_HAVE_LOOPS
167+
uintptr_t lcount;
168+
uintptr_t lend;
169+
uintptr_t lbeg;
170+
#endif
171+
172+
uintptr_t sar;
173+
uintptr_t ps;
174+
uintptr_t pc;
175+
uintptr_t a0;
176+
uintptr_t scratch;
177+
uintptr_t a2;
178+
uintptr_t a3;
179+
155180
#if XCHAL_HAVE_FP && defined(CONFIG_CPU_HAS_FPU) && defined(CONFIG_FPU_SHARING)
156181
uintptr_t fcr;
157182
uintptr_t fsr;
@@ -185,31 +210,6 @@ struct xtensa_irq_base_save_area {
185210
uint8_t hifi[XCHAL_CP1_SA_SIZE + XCHAL_CP1_SA_ALIGN];
186211
#endif
187212

188-
#if XCHAL_HAVE_THREADPTR
189-
uintptr_t threadptr;
190-
#endif
191-
192-
#if XCHAL_HAVE_S32C1I
193-
uintptr_t scompare1;
194-
#endif
195-
196-
uintptr_t exccause;
197-
uintptr_t excvaddr;
198-
199-
#if XCHAL_HAVE_LOOPS
200-
uintptr_t lcount;
201-
uintptr_t lend;
202-
uintptr_t lbeg;
203-
#endif
204-
205-
uintptr_t sar;
206-
uintptr_t ps;
207-
uintptr_t pc;
208-
uintptr_t a0;
209-
uintptr_t scratch;
210-
uintptr_t a2;
211-
uintptr_t a3;
212-
213213
uintptr_t padding[_BSA_PADDING_NEEDED / sizeof(uintptr_t)];
214214

215215
uintptr_t caller_a0;

0 commit comments

Comments
 (0)