diff options
author | andrew <andrew@FreeBSD.org> | 2012-04-16 09:38:20 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2012-04-16 09:38:20 +0000 |
commit | f784792ea971fea03f2cc953b0a8c0c521648696 (patch) | |
tree | 75b2b5c6b4bfff9017ff33d83926a3dab51dca1c /lib/libc/arm/gen | |
parent | 1e792bf1e77de0b17153d089d5af10adc2ebf82e (diff) | |
download | FreeBSD-src-f784792ea971fea03f2cc953b0a8c0c521648696.zip FreeBSD-src-f784792ea971fea03f2cc953b0a8c0c521648696.tar.gz |
Replace the C implementation of __aeabi_read_tp with an assembly version.
This ensures we follow the ABI by preserving registers r1-r3.
Reviewed by: jmallett, imp
Diffstat (limited to 'lib/libc/arm/gen')
-rw-r--r-- | lib/libc/arm/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/arm/gen/__aeabi_read_tp.S (renamed from lib/libc/arm/gen/__aeabi_read_tp.c) | 21 |
2 files changed, 9 insertions, 14 deletions
diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc index e0ebd98..a78cbb9 100644 --- a/lib/libc/arm/gen/Makefile.inc +++ b/lib/libc/arm/gen/Makefile.inc @@ -3,4 +3,4 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ getcontextx.c infinity.c ldexp.c makecontext.c \ - __aeabi_read_tp.c setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c + __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c diff --git a/lib/libc/arm/gen/__aeabi_read_tp.c b/lib/libc/arm/gen/__aeabi_read_tp.S index c2dd978..228acff 100644 --- a/lib/libc/arm/gen/__aeabi_read_tp.c +++ b/lib/libc/arm/gen/__aeabi_read_tp.S @@ -23,23 +23,18 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ -#include <sys/cdefs.h> +#include <machine/asm.h> __FBSDID("$FreeBSD$"); -#include <sys/types.h> - -#include "machine/sysarch.h" +#include <machine/sysarch.h> -void * -__aeabi_read_tp() -{ - void *_tp; +ENTRY(__aeabi_read_tp) + ldr r0, .Larm_tp_address + ldr r0, [r0] + RET - asm("ldr %0, [%1]\n" : "=r"(_tp) : "r"(ARM_TP_ADDRESS)); +.Larm_tp_address: + .word ARM_TP_ADDRESS - return _tp; -} |