1 /* $NetBSD: __aeabi_read_tp.S,v 1.5 2013/08/19 22:10:51 matt Exp $ */
7 * Implementations of this function should corrupt only the result register
8 * (r0) and the non-parameter integer core registers allowed to be corrupted
9 * by the [AAPCS] (ip, lr, and CPSR).
11 ARM_ENTRY(__aeabi_read_tp)
12 mrc p15, 0, r0, c13, c0, 3
14 cmp r0, #0 /* was it zero? */
15 RETc(ne) /* return it's not zero */
16 mov ip, r1 /* syscall zeroes r1 */
17 SYSTRAP(_lwp_getprivate) /* can't fail */
18 mov r1, ip /* restore r1 */