From 6af3332a4cbd1ffbc81f74759ef7c5e1a87d2e10 Mon Sep 17 00:00:00 2001 From: Vincent Ren-Wei Chen Date: Tue, 17 Jan 2017 07:31:24 +0100 Subject: nds32: add NPTL/TLS, *context function, libm changes and code cleanup This commit includes following features. 1. Support NPTL/TLS 2. Add libm function which is used to handle FP rounding and excpetions (ex: fclrexcpt,fedisblxcpti,feenablxcpt... ) 3. Add *context function for operating user context (ex: setcontext,getcontext,makecontext... ) 4. Change the return flow from signal handler 5. Cleanup of old code The testsuite only has 2 errors, tst-cpuclock1 and tst-cputimer1, which are related to timing accuracy. (math and locale tests are disabled) Signed-off-by: Vincent Ren-Wei Chen --- libc/string/nds32/memcpy.S | 22 +++++++++++++++++++++- libc/string/nds32/memset.S | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'libc/string/nds32') diff --git a/libc/string/nds32/memcpy.S b/libc/string/nds32/memcpy.S index 4f285b5ee..4da2c83ea 100644 --- a/libc/string/nds32/memcpy.S +++ b/libc/string/nds32/memcpy.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Andes Technology, Inc. + * Copyright (C) 2016-2017 Andes Technology, Inc. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ @@ -54,12 +54,32 @@ ENTRY(memcpy) srli $r3, $r2, #5 beqz $r3, .Lword_copy_entry pushm $r6, $r13 + cfi_adjust_cfa_offset(32) + cfi_rel_offset(r6, 0) + cfi_rel_offset(r7, 4) + cfi_rel_offset(r8, 8) + cfi_rel_offset(r9, 12) + cfi_rel_offset(r10, 16) + cfi_rel_offset(r11, 20) + cfi_rel_offset(r12, 24) + cfi_rel_offset(r13, 28) + .L3: lmw.bim $r6, [$r1], $r13 addi $r3, $r3, #-1 smw.bim $r6, [$r0], $r13 bnez $r3, .L3 popm $r6, $r13 + cfi_adjust_cfa_offset(-32) + cfi_restore(r6) + cfi_restore(r7) + cfi_restore(r8) + cfi_restore(r9) + cfi_restore(r10) + cfi_restore(r11) + cfi_restore(r12) + cfi_restore(r13) + .Lword_copy_entry: andi $r2, $r2, #31 diff --git a/libc/string/nds32/memset.S b/libc/string/nds32/memset.S index edd15a410..ba208f6cf 100644 --- a/libc/string/nds32/memset.S +++ b/libc/string/nds32/memset.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Andes Technology, Inc. + * Copyright (C) 2016-2017 Andes Technology, Inc. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -- cgit v1.2.3