Skip to content

Commit b444de8

Browse files
Wayne Rengalak
authored andcommitted
arch: arc: optimize the push and pop of fast irq
use macro to replace pop/push instructions Signed-off-by: Wayne Ren <[email protected]>
1 parent 378ef0b commit b444de8

File tree

2 files changed

+6
-65
lines changed

2 files changed

+6
-65
lines changed

arch/arc/core/fast_irq.S

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -175,37 +175,8 @@ _firq_no_reschedule:
175175
* instruction instead of a pair of cmp and bxx
176176
*/
177177
#if CONFIG_RGF_NUM_BANKS == 1
178-
add sp,sp,4 /* don't need r0 from stack */
179-
pop_s r1
180-
pop_s r2
181-
pop_s r3
182-
pop r4
183-
pop r5
184-
pop r6
185-
pop r7
186-
pop r8
187-
pop r9
188-
pop r10
189-
pop r11
190-
pop_s r12
191-
pop_s r13
192-
pop_s blink
193-
pop_s r0
194-
sr r0, [_ARC_V2_LP_END]
195-
pop_s r0
196-
sr r0, [_ARC_V2_LP_START]
197-
pop_s r0
198-
mov lp_count,r0
199-
#ifdef CONFIG_CODE_DENSITY
200-
pop_s r0
201-
sr r0, [_ARC_V2_EI_BASE]
202-
pop_s r0
203-
sr r0, [_ARC_V2_LDI_BASE]
204-
pop_s r0
205-
sr r0, [_ARC_V2_JLI_BASE]
206-
#endif
178+
_pop_irq_stack_frame
207179
ld r0,[saved_r0]
208-
add sp,sp,8 /* don't need ilink & status32_po from stack */
209180
#endif
210181
rtie
211182

arch/arc/core/isr_wrapper.S

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ IRQ stack frame layout:
8181
low address
8282

8383
Registers not taken into account in the current implementation.
84-
jli_base
85-
ldi_base
86-
ei_base
8784
accl
8885
acch
8986

@@ -240,40 +237,13 @@ SECTION_FUNC(TEXT, _isr_wrapper)
240237
#if CONFIG_RGF_NUM_BANKS == 1
241238
bnz rirq_path
242239
/* 1-register bank FIRQ handling must save registers on stack */
243-
lr r0,[_ARC_V2_STATUS32_P0]
244-
push_s r0
240+
_create_irq_stack_frame
241+
lr r0, [_ARC_V2_STATUS32_P0]
242+
st_s r0, [sp, ___isf_t_status32_OFFSET]
245243
mov r0,ilink
246-
push_s r0
247-
#ifdef CONFIG_CODE_DENSITY
248-
lr r0, [_ARC_V2_JLI_BASE]
249-
push_s r0
250-
lr r0, [_ARC_V2_LDI_BASE]
251-
push_s r0
252-
lr r0, [_ARC_V2_EI_BASE]
253-
push_s r0
254-
#endif
255-
mov r0,lp_count
256-
push_s r0
257-
lr r0, [_ARC_V2_LP_START]
258-
push_s r0
259-
lr r0, [_ARC_V2_LP_END]
260-
push_s r0
261-
push_s blink
262-
push_s r13
263-
push_s r12
264-
push r11
265-
push r10
266-
push r9
267-
push r8
268-
push r7
269-
push r6
270-
push r5
271-
push r4
272-
push_s r3
273-
push_s r2
274-
push_s r1
244+
st_s r0, [sp, ___isf_t_pc_OFFSET]
275245
ld r0,[saved_r0]
276-
push_s r0
246+
st_s r0, [sp, ___isf_t_r0_OFFSET]
277247
mov r3, _firq_exit
278248
mov r2, _firq_enter
279249
j_s [r2]

0 commit comments

Comments
 (0)