Commit 4c3f6ea5 authored by Wilfried Chauveau's avatar Wilfried Chauveau Committed by Carles Cufi
Browse files

arch: arm: cortex_m: Document why __aeabi_read_tp impl requires ASM impl



This method has special ABI requirement that requires the use of ASM.
This change documents why this is required & adds reference to the
related specification.

Signed-off-by: default avatarWilfried Chauveau <wilfried.chauveau@arm.com>
parent a2ed8162
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -12,8 +12,14 @@ GTEXT(__aeabi_read_tp)

GDATA(z_arm_tls_ptr)

/* Grab the TLS pointer and store in R0.
 * According to the Run-Time ABI for the Arm® Architecture section 5.3.5, this
 * function may only clobber r0, ip, lr & CPSR.
 *
 * This can only be guaranteed by either implementing a naked C function with
 * inline assembly, or plain assembly.
 */
SECTION_FUNC(TEXT, __aeabi_read_tp)
	/* Grab the TLS pointer and store in R0 */
	ldr r0, =z_arm_tls_ptr
	ldr r0, [r0]
	bx lr