diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-04-01 16:20:56 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-04-11 19:04:06 +0000 |
commit | ed55b93c6cbf9fb327d9945691dfa86c618eb275 (patch) | |
tree | f62e68ab88b1f63892fcdc89fc0284ad8dee0e3a /zephyr/boards | |
parent | cfc6004eb8d2198b5f3a9c56ff6dafb7f984f739 (diff) | |
download | chrome-ec-ed55b93c6cbf9fb327d9945691dfa86c618eb275.tar.gz |
cortex-m/irq_handler: Replace inline asm with C
When building with clang and LTO is enabled, clang optimizes out
"routine" (the interrupt handler) and fails to link. gcc does not
optimize out the routine.
Rewriting IRQ_HANDLER in C makes it compile with both compilers, though
it uses two more instructions.
Before this change the generated assembly for an interrupt handler on
dartmonkey:
arm-none-eabi-objdump -d ./build/dartmonkey/RW/ec.RW.elf
081027a8 <irq_37_handler>:
81027a8: 4670 mov r0, lr
81027aa: b501 push {r0, lr}
81027ac: f7ff ffea bl 8102784 <uart_interrupt>
81027b0: e8bd 4001 ldmia.w sp!, {r0, lr}
81027b4: f009 bbc4 b.w 810bf40 <task_resched_if_needed>
After this change the generated assembly for an interrupt handler on
dartmonkey:
arm-none-eabi-objdump -d ./build/dartmonkey/RW/ec.RW.elf
081027e0 <irq_37_handler>:
81027e0: b507 push {r0, r1, r2, lr}
81027e2: f8cd e004 str.w lr, [sp, #4]
81027e6: f7ff ffe9 bl 81027bc <uart_interrupt>
81027ea: 9801 ldr r0, [sp, #4]
81027ec: b003 add sp, #12
81027ee: f85d eb04 ldr.w lr, [sp], #4
81027f2: f009 bbc5 b.w 810bf80 <task_resched_if_needed>
BRANCH=none
BUG=b:172020503
TEST=make buildall
TEST=./test/run_device_tests.py --board dartmonkey
=> PASS
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I7029556afc4a760e81885d8f84b7d787f48c4036
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3566661
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'zephyr/boards')
0 files changed, 0 insertions, 0 deletions