From 3808db501ff711c8cef278c0c24b3138994ccfa9 Mon Sep 17 00:00:00 2001 From: Yuval Peress Date: Tue, 5 Nov 2024 15:39:27 +0000 Subject: [PATCH] Revert "FROMPULL: arch: arm: cortex_m: move _main in input list" This reverts commit 13074557d2d7215ef518c1f67fd5bd777151be0d. Reason for revert: Commit landed upstream in https://github.com/zephyrproject-rtos/zephyr/commit/7015a0ee3787c61d998c8bdd5ac70b77955d9ea7 Original change's description: > FROMPULL: arch: arm: cortex_m: move _main in input list > > Move the _main argument to the input list rather than the output one on > the asm block and change the spec to "r". The ASM block does not return, > so it does not make sense for it to expect any output. > > https://github.com/zephyrproject-rtos/zephyr/pull/80579 > > BUG=b:376282914 > > Change-Id: Ie6f1ab781bdc8d0de87353bcf48e2c4ade2d4dc1 > Signed-off-by: Wilfried Chauveau > Signed-off-by: Fabio Baltieri > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5975475 > Tested-by: Jeremy Bettis > Commit-Queue: Jeremy Bettis BUG=b:376282914 Change-Id: I189e76cbfed650a98be338f9cd5c1aa79d396b47 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5991739 Auto-Submit: Yuval Peress Commit-Queue: Yuval Peress Reviewed-by: Fabio Baltieri Tested-by: Yuval Peress --- arch/arm/core/cortex_m/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/core/cortex_m/thread.c b/arch/arm/core/cortex_m/thread.c index 4cadc4e72bf..fa500032d3c 100644 --- a/arch/arm/core/cortex_m/thread.c +++ b/arch/arm/core/cortex_m/thread.c @@ -586,8 +586,8 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr, "mov r3, #0\n" "ldr r4, =z_thread_entry\n" "bx r4\n" /* We don’t intend to return, so there is no need to link. */ - : - : "r" (_main), "r" (stack_ptr) + : "+r" (_main) + : "r" (stack_ptr) : "r0", "r1", "r2", "r3", "r4", "ip", "lr"); CODE_UNREACHABLE;