arm64: isr_wrapper.S: tiny assembly optimization

Save one instruction in the ISR hot path.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2022-03-11 21:25:57 -05:00 committed by Anas Nashif
commit 9d0bcfa884

View file

@ -35,12 +35,11 @@ SECTION_FUNC(TEXT, _isr_wrapper)
/* ++_current_cpu->nested to be checked by arch_is_in_isr() */ /* ++_current_cpu->nested to be checked by arch_is_in_isr() */
get_cpu x0 get_cpu x0
ldr w1, [x0, #___cpu_t_nested_OFFSET] ldr w1, [x0, #___cpu_t_nested_OFFSET]
add w1, w1, #1 add w2, w1, #1
str w1, [x0, #___cpu_t_nested_OFFSET] str w2, [x0, #___cpu_t_nested_OFFSET]
/* If not nested: switch to IRQ stack and save current sp on it. */ /* If not nested: switch to IRQ stack and save current sp on it. */
cmp w1, #1 cbnz w1, 1f
bne 1f
ldr x1, [x0, #___cpu_t_irq_stack_OFFSET] ldr x1, [x0, #___cpu_t_irq_stack_OFFSET]
mov x2, sp mov x2, sp
mov sp, x1 mov sp, x1