Skip to content

Commit 57f3fa2

Browse files
committed
nrf_rpc: Simplify loading address to register
The use of a pseudo-instruction allows us to remove some lines of assembly code and local labels. The actual code expands to what we had before. Signed-off-by: Rubin Gerritsen <[email protected]>
1 parent f60d6a9 commit 57f3fa2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

subsys/nrf_rpc/nrf_rpc_cbkproxy.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,16 @@ static void callback_jump_table_start(void)
9393
#endif
9494
".L%=callback_jump_table_end:\n"
9595
"mov r0, lr\n"
96-
"ldr r1, .L%=callback_jump_table_start_addr\n"
96+
"ldr r1, =callback_jump_table_start+8\n"
9797
"sub r0, r1\n"
9898
"asrs r0, r0, #1\n"
99-
"ldr r1, .L%=out_callbacks_addr\n"
99+
"ldr r1, =out_callbacks\n"
100100
"ldr r1, [r1, r0]\n"
101101
"asrs r0, r0, #2\n"
102102
"blx r1\n"
103103
"add sp, #16\n"
104104
"mov lr, r1\n"
105-
"bx lr\n"
106-
".align 2\n"
107-
".L%=callback_jump_table_start_addr:\n"
108-
".word callback_jump_table_start + 8\n"
109-
".L%=out_callbacks_addr:\n"
110-
".word out_callbacks\n":::
105+
"bx lr\n":::
111106
);
112107
}
113108

0 commit comments

Comments
 (0)