ARC: ABI Implementation
PATCH 1/13 ARC: ABI Implementation
This code deals with the ARC ABI.
--- sysdeps/arc/__longjmp.S | 49 ++++++++++++++++++++++++ sysdeps/arc/abort-instr.h | 2 + sysdeps/arc/bits/endianness.h | 15 ++++++++ sysdeps/arc/bits/setjmp.h | 26 +++++++++++++ sysdeps/arc/bsd-_setjmp.S | 1 + sysdeps/arc/bsd-setjmp.S | 1 + sysdeps/arc/dl-runtime.h | 42 ++++++++++++++++++++ sysdeps/arc/dl-sysdep.h | 25 ++++++++++++ sysdeps/arc/dl-trampoline.S | 72 +++++++++++++++++++++++++++++++++++ sysdeps/arc/gccframe.h | 21 ++++++++++ sysdeps/arc/jmpbuf-offsets.h | 22 +++++++++++ sysdeps/arc/jmpbuf-unwind.h | 47 +++++++++++++++++++++++ sysdeps/arc/machine-gmon.h | 35 +++++++++++++++++ sysdeps/arc/memusage.h | 23 +++++++++++ sysdeps/arc/setjmp.S | 66 ++++++++++++++++++++++++++++++++ sysdeps/arc/sysdep.h | 53 ++++++++++++++++++++++++++ sysdeps/arc/tls-macros.h | 47 +++++++++++++++++++++++ 17 files changed, 547 insertions(+) create mode 100644 sysdeps/arc/__longjmp.S create mode 100644 sysdeps/arc/abort-instr.h create mode 100644 sysdeps/arc/bits/endianness.h create mode 100644 sysdeps/arc/bits/setjmp.h create mode 100644 sysdeps/arc/bsd-_setjmp.S create mode 100644 sysdeps/arc/bsd-setjmp.S create mode 100644 sysdeps/arc/dl-runtime.h create mode 100644 sysdeps/arc/dl-sysdep.h create mode 100644 sysdeps/arc/dl-trampoline.S create mode 100644 sysdeps/arc/gccframe.h create mode 100644 sysdeps/arc/jmpbuf-offsets.h create mode 100644 sysdeps/arc/jmpbuf-unwind.h create mode 100644 sysdeps/arc/machine-gmon.h create mode 100644 sysdeps/arc/memusage.h create mode 100644 sysdeps/arc/setjmp.S create mode 100644 sysdeps/arc/sysdep.h create mode 100644 sysdeps/arc/tls-macros.h
sysdeps/arc/__longjmp.S new file +49 -0
@@ -0,0 +1,49 @@ +/* longjmp for ARC. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <jmpbuf-offsets.h> + +/* @ r0 = jump buffer from which regs will be restored + @ r1 = value that setjmp( ) will return due to this longjmp. */ + +ENTRY (__longjmp) + + LDR (blink, r0, 0) + LDR (sp, r0, 1) + LDR (fp, r0, 2) + LDR (gp, r0, 3) + + LDR (r13, r0, 4) + LDR (r14, r0, 5) + LDR (r15, r0, 6) + LDR (r16, r0, 7) + LDR (r17, r0, 8) + LDR (r18, r0, 9) + LDR (r19, r0, 10) + LDR (r20, r0, 11) + LDR (r21, r0, 12) + LDR (r22, r0, 13) + LDR (r23, r0, 14) + LDR (r24, r0, 15) + + mov.f r0, r1 + j.d [blink] + mov.z r0, 1 /* don't return 0 to setjmp callsite from longjmp. */ + +END (__longjmp)
sysdeps/arc/abort-instr.h new file +2 -0
@@ -0,0 +1,2 @@ +/* FLAG 1 is privilege mode only instruction, hence will crash any program. */ +#define ABORT_INSTRUCTION asm ("flag 1")
sysdeps/arc/bits/endianness.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef _BITS_ENDIANNESS_H +#define _BITS_ENDIANNESS_H 1 + +#ifndef _BITS_ENDIAN_H +# error "Never use <bits/endian.h> directly; include <endian.h> instead." +#endif + +/* ARC has selectable endianness. */ +#ifdef __BIG_ENDIAN__ +# define __BYTE_ORDER __BIG_ENDIAN +#else +# define __BYTE_ORDER __LITTLE_ENDIAN +#endif + +#endif /* bits/endianness.h */
sysdeps/arc/bits/setjmp.h new file +26 -0
@@ -0,0 +1,26 @@ +/* Define the machine-dependent type 'jmp_buf'. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _ARC_BITS_SETJMP_H +#define _ARC_BITS_SETJMP_H 1 + +/* Saves r13-r25 (callee-saved), fp (frame pointer), sp (stack pointer), +blink (branch-n-link). */ +typedef long int __jmp_buf [32 ]; + +#endif
sysdeps/arc/bsd-_setjmp.S new file +1 -0
@@ -0,0 +1 @@ +/* _setjmp is in setjmp.S. */
sysdeps/arc/bsd-setjmp.S new file +1 -0
@@ -0,0 +1 @@ +/* setjmp is in setjmp.S. */
sysdeps/arc/dl-runtime.h new file +42 -0
42 lines not on this page · raw message
sysdeps/arc/dl-sysdep.h new file +25 -0
@@ -0,0 +1,25 @@ +/* System-specific settings for dynamic linker code. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include_next <dl-sysdep.h> + +/* _dl_argv cannot be attribute_relro, because _dl_start_user +might write into it after _dl_start returns. */ +#define DL_ARGV_NOT_RELRO 1 + +#define DL_EXTERN_PROTECTED_DATA
sysdeps/arc/dl-trampoline.S new file +72 -0
72 lines not on this page · raw message
sysdeps/arc/gccframe.h new file +21 -0
@@ -0,0 +1,21 @@ +/* Definition of object in frame unwind info. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#define FIRST_PSEUDO_REGISTER 40 + +#include <sysdeps/generic/gccframe.h>
sysdeps/arc/jmpbuf-offsets.h new file +22 -0
@@ -0,0 +1,22 @@ +/* Private macros for accessing __jmp_buf contents. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#define JB_SP 1 + +/* Helper for generic ____longjmp_chk. */ +#define JB_FRAME_ADDRESS (buf) ((void *) (unsigned long int) (buf[JB_SP]))
sysdeps/arc/jmpbuf-unwind.h new file +47 -0
47 lines not on this page · raw message
sysdeps/arc/machine-gmon.h new file +35 -0
@@ -0,0 +1,35 @@ +/* Machine-dependent definitions for profiling support. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#define _MCOUNT_DECL (frompc, selfpc) \ +static void \ +__mcount_internal (unsigned long int frompc, unsigned long int selfpc) + +/* This is very simple as gcc does all the heavy lifting at _mcount call site +- sets up caller's blink in r0, so frompc is setup correctly +- preserve argument registers for original call. */ + +#define MCOUNT \ +void \ +_mcount (void *frompc) \ +{ \ + __mcount_internal ((unsigned long int) frompc, \ + (unsigned long int) __builtin_return_address (0)); \ +}
sysdeps/arc/memusage.h new file +23 -0
@@ -0,0 +1,23 @@ +/* Machine-specific definitions for memory usage profiling, ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#define GETSP () ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; }) + +#define uatomic32_t unsigned int + +#include <sysdeps/generic/memusage.h>
sysdeps/arc/setjmp.S new file +66 -0
66 lines not on this page · raw message
sysdeps/arc/sysdep.h new file +53 -0
53 lines not on this page · raw message
sysdeps/arc/tls-macros.h new file +47 -0
47 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 2/13 ARC: startup and dynamic linking code
Code for C runtime startup and dynamic loading including PLT layout.
--- sysdeps/arc/bits/link.h | 52 ++++++ sysdeps/arc/dl-machine.h | 344 ++++++++++++++++++++++++++++++++++++++ sysdeps/arc/entry.h | 5 + sysdeps/arc/ldsodefs.h | 43 +++++ sysdeps/arc/sotruss-lib.c | 50 ++++++ sysdeps/arc/start.S | 74 ++++++++ sysdeps/arc/tst-audit.h | 23 +++ 7 files changed, 591 insertions(+) create mode 100644 sysdeps/arc/bits/link.h create mode 100644 sysdeps/arc/dl-machine.h create mode 100644 sysdeps/arc/entry.h create mode 100644 sysdeps/arc/ldsodefs.h create mode 100644 sysdeps/arc/sotruss-lib.c create mode 100644 sysdeps/arc/start.S create mode 100644 sysdeps/arc/tst-audit.h
sysdeps/arc/bits/link.h new file +52 -0
@@ -0,0 +1,52 @@ +/* Machine-specific declarations for dynamic linker interface, ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _LINK_H +# error "Never include <bits/link.h> directly; use <link.h> instead." +#endif + +/* Registers for entry into PLT on ARC. */ +typedef struct La_arc_regs +{ +uint32_t lr_reg[8 ];/* r0 through r7 (upto 8 args). */ +}La_arc_regs ; + +/* Return values for calls from PLT on ARC. */ +typedef struct La_arc_retval +{ +/* For ARCv2, a 64-bit integer return value can use 2 regs. */ +uint32_t lrv_reg[2 ]; +}La_arc_retval ; + +__BEGIN_DECLS + +extern ElfW(Addr) la_arc_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_arc_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_arc_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx, +uintptr_t *__refcook, +uintptr_t *__defcook, +const La_arc_regs *__inregs, +La_arc_retval *__outregs, +const char *symname); + +__END_DECLS
sysdeps/arc/dl-machine.h new file +344 -0
344 lines not on this page · raw message
sysdeps/arc/entry.h new file +5 -0
@@ -0,0 +1,5 @@ +#ifndef __ASSEMBLY__ +extern void __start (void) attribute_hidden; +#endif + +#define ENTRY_POINT __start
sysdeps/arc/ldsodefs.h new file +43 -0
43 lines not on this page · raw message
sysdeps/arc/sotruss-lib.c new file +50 -0
50 lines not on this page · raw message
sysdeps/arc/start.S new file +74 -0
74 lines not on this page · raw message
sysdeps/arc/tst-audit.h new file +23 -0
@@ -0,0 +1,23 @@ +/* Definitions for testing PLT entry/exit auditing. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#define pltenter la_arc_gnu_pltenter +#define pltexit la_arc_gnu_pltexit +#define La_regs La_arc_regs +#define La_retval La_arc_retval +#define int_retval lrv_reg[0]
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 3/13 ARC: Thread Local Storage support
In reply to Vineet GuptaThis includes all 4 TLS addressing models
--- sysdeps/arc/dl-tls.h | 30 +++++++ sysdeps/arc/libc-tls.c | 27 ++++++ sysdeps/arc/nptl/tcb-offsets.sym | 11 +++ sysdeps/arc/nptl/tls.h | 139 +++++++++++++++++++++++++++++++ sysdeps/arc/stackinfo.h | 33 ++++++++ 5 files changed, 240 insertions(+) create mode 100644 sysdeps/arc/dl-tls.h create mode 100644 sysdeps/arc/libc-tls.c create mode 100644 sysdeps/arc/nptl/tcb-offsets.sym create mode 100644 sysdeps/arc/nptl/tls.h create mode 100644 sysdeps/arc/stackinfo.h
sysdeps/arc/dl-tls.h new file +30 -0
@@ -0,0 +1,30 @@ +/* Thread-local storage handling in the ELF dynamic linker. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + + +/* Type used for the representation of TLS information in the GOT. */ +typedef struct +{ +unsigned long int ti_module; +unsigned long int ti_offset; +}tls_index ; + +extern void *__tls_get_addr (tls_index *ti); + +/* Value used for dtv entries for which the allocation is delayed. */ +#define TLS_DTV_UNALLOCATED ((void *) -1l)
sysdeps/arc/libc-tls.c new file +27 -0
@@ -0,0 +1,27 @@ +/* Thread-local storage handling in the ELF dynamic linker. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <csu/libc-tls.c> +#include <dl-tls.h> + +void * +__tls_get_addr (tls_index *ti) +{ +dtv_t *dtv =THREAD_DTV (); +return (char *) dtv[1 ].pointer.val + ti->ti_offset; +}
sysdeps/arc/nptl/tcb-offsets.sym new file +11 -0
@@ -0,0 +1,11 @@ +#include <sysdep.h> +#include <tls.h> + +-- Derive offsets relative to the thread register. +#define thread_offsetof(mem) (long)(offsetof (struct pthread, mem) - sizeof (struct pthread)) + +MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) +TLS_PRE_TCB_SIZE sizeof (struct pthread) +TLS_TCB_SIZE sizeof (tcbhead_t) + +PTHREAD_TID offsetof (struct pthread, tid)
sysdeps/arc/nptl/tls.h new file +139 -0
139 lines not on this page · raw message
sysdeps/arc/stackinfo.h new file +33 -0
@@ -0,0 +1,33 @@ +/* Stack environment definitions for ARC. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +/* This file contains a bit of information about the stack allocation +of the processor. */ + +#ifndef _STACKINFO_H +#define _STACKINFO_H 1 + +#include <elf.h> + +/* On ARC the stack grows down. */ +#define _STACK_GROWS_DOWN 1 + +/* Default to a non-executable stack. */ +#define DEFAULT_STACK_PERMS (PF_R|PF_W) + +#endif /* stackinfo.h */
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 4/13 ARC: Atomics and Locking primitives
In reply to Vineet Gupta--- sysdeps/arc/atomic-machine.h | 69 ++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sysdeps/arc/atomic-machine.h
sysdeps/arc/atomic-machine.h new file +69 -0
@@ -0,0 +1,69 @@ +/* Low-level functions for atomic operations. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _ARC_BITS_ATOMIC_H +#define _ARC_BITS_ATOMIC_H 1 + +#include <stdint.h> + +typedef int32_t atomic32_t ; +typedef uint32_t uatomic32_t ; +typedef int_fast32_t atomic_fast32_t ; +typedef uint_fast32_t uatomic_fast32_t ; + +typedef intptr_t atomicptr_t ; +typedef uintptr_t uatomicptr_t ; +typedef intmax_t atomic_max_t ; +typedef uintmax_t uatomic_max_t ; + +#define __HAVE_64B_ATOMICS 0 +#define USE_ATOMIC_COMPILER_BUILTINS 1 + +/* ARC does have legacy atomic EX reg, [mem] instruction but the micro-arch +is not as optimal as LLOCK/SCOND specially for SMP. */ +#define ATOMIC_EXCHANGE_USES_CAS 1 + +#define __arch_compare_and_exchange_bool_8_acq (mem, newval, oldval) \ + (abort (), 0) +#define __arch_compare_and_exchange_bool_16_acq (mem, newval, oldval) \ + (abort (), 0) +#define __arch_compare_and_exchange_bool_64_acq (mem, newval, oldval) \ + (abort (), 0) + +#define __arch_compare_and_exchange_val_8_int (mem, newval, oldval, model) \ + (abort (), (__typeof (*mem)) 0) +#define __arch_compare_and_exchange_val_16_int (mem, newval, oldval, model) \ + (abort (), (__typeof (*mem)) 0) +#define __arch_compare_and_exchange_val_64_int (mem, newval, oldval, model) \ + (abort (), (__typeof (*mem)) 0) + +#define __arch_compare_and_exchange_val_32_int (mem, newval, oldval, model) \ + ({ \ + typeof (*mem) __oldval = (oldval); \ + __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \ + model, __ATOMIC_RELAXED); \ + __oldval; \ + }) + +#define atomic_compare_and_exchange_val_acq (mem, new, old) \ + __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ + mem, new, old, __ATOMIC_ACQUIRE) + +#define atomic_full_barrier () ({ asm volatile ("dmb 3":::"memory"); }) + +#endif /* _ARC_BITS_ATOMIC_H */
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 5/13 ARC: math soft float support
In reply to Vineet Gupta--- sysdeps/arc/bits/fenv.h | 78 +++++++++++++++++++++++ sysdeps/arc/nofpu/Implies | 1 + sysdeps/arc/nofpu/math-tests-exceptions.h | 27 ++++++++ sysdeps/arc/nofpu/math-tests-rounding.h | 27 ++++++++ sysdeps/arc/sfp-machine.h | 70 ++++++++++++++++++++ 5 files changed, 203 insertions(+) create mode 100644 sysdeps/arc/bits/fenv.h create mode 100644 sysdeps/arc/nofpu/Implies create mode 100644 sysdeps/arc/nofpu/math-tests-exceptions.h create mode 100644 sysdeps/arc/nofpu/math-tests-rounding.h create mode 100644 sysdeps/arc/sfp-machine.h
sysdeps/arc/bits/fenv.h new file +78 -0
@@ -0,0 +1,78 @@ +/* Floating point environment. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _FENV_H +# error "Never use <bits/fenv.h> directly; include <fenv.h> instead." +#endif + +enum + { +FE_INVALID = +# define FE_INVALID (0x01) +FE_INVALID , +FE_DIVBYZERO = +# define FE_DIVBYZERO (0x02) +FE_DIVBYZERO , +FE_OVERFLOW = +# define FE_OVERFLOW (0x04) +FE_OVERFLOW , +FE_UNDERFLOW = +# define FE_UNDERFLOW (0x08) +FE_UNDERFLOW , +FE_INEXACT = +# define FE_INEXACT (0x10) +FE_INEXACT + }; + +# define FE_ALL_EXCEPT \ + (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) + +enum + { +FE_TOWARDZERO = +# define FE_TOWARDZERO (0x0) +FE_TOWARDZERO , +FE_TONEAREST = +# define FE_TONEAREST (0x1) /* default */ +FE_TONEAREST , +FE_UPWARD = +# define FE_UPWARD (0x2) +FE_UPWARD , +FE_DOWNWARD = +# define FE_DOWNWARD (0x3) +FE_DOWNWARD + }; + +typedef unsigned int fexcept_t ; + +typedef struct +{ +unsigned int __fpcr; +unsigned int __fpsr; +}fenv_t ; + +/* If the default argument is used we use this value. */ +#define FE_DFL_ENV ((const fenv_t *) -1) + +#if __GLIBC_USE (IEC_60559_BFP_EXT ) +/* Type representing floating-point control modes. */ +typedef unsigned int femode_t ; + +/* Default floating-point control modes. */ +# define FE_DFL_MODE ((const femode_t *) -1L) +#endif
sysdeps/arc/nofpu/Implies new file +1 -0
@@ -0,0 +1 @@ +ieee754/soft-fp
sysdeps/arc/nofpu/math-tests-exceptions.h new file +27 -0
@@ -0,0 +1,27 @@ +/* Configuration for math tests. Exceptions support ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef ARC_NOFPU_MATH_TESTS_EXCEPTIONS_H +#define ARC_NOFPU_MATH_TESTS_EXCEPTIONS_H 1 + +/* Soft-float does not support exceptions. */ +#define EXCEPTION_TESTS_float 0 +#define EXCEPTION_TESTS_double 0 +#define EXCEPTION_TESTS_long_double 0 + +#endif
sysdeps/arc/nofpu/math-tests-rounding.h new file +27 -0
@@ -0,0 +1,27 @@ +/* Configuration for math tests: rounding mode support. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef ARC_NOFPU_MATH_TESTS_ROUNDING_H +#define ARC_NOFPU_MATH_TESTS_ROUNDING_H 1 + +/* Soft-float only supports to-nearest rounding mode. */ +#define ROUNDING_TESTS_float (MODE ) ((MODE) == FE_TONEAREST) +#define ROUNDING_TESTS_double (MODE ) ((MODE) == FE_TONEAREST) +#define ROUNDING_TESTS_long_double (MODE ) ((MODE) == FE_TONEAREST) + +#endif
sysdeps/arc/sfp-machine.h new file +70 -0
70 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 6/13 ARC: hardware floating point support
In reply to Vineet Gupta--- sysdeps/arc/fpu/fclrexcpt.c | 36 ++++++++ sysdeps/arc/fpu/fegetenv.c | 37 ++++++++ sysdeps/arc/fpu/fegetmode.c | 31 +++++++ sysdeps/arc/fpu/fegetround.c | 32 +++++++ sysdeps/arc/fpu/feholdexcpt.c | 43 +++++++++ sysdeps/arc/fpu/fesetenv.c | 48 ++++++++++ sysdeps/arc/fpu/fesetexcept.c | 32 +++++++ sysdeps/arc/fpu/fesetmode.c | 40 +++++++++ sysdeps/arc/fpu/fesetround.c | 40 +++++++++ sysdeps/arc/fpu/feupdateenv.c | 51 +++++++++++ sysdeps/arc/fpu/fgetexcptflg.c | 31 +++++++ sysdeps/arc/fpu/fraiseexcpt.c | 39 +++++++++ sysdeps/arc/fpu/fsetexcptflg.c | 38 ++++++++ sysdeps/arc/fpu/ftestexcept.c | 33 +++++++ sysdeps/arc/fpu/math-use-builtins-fma.h | 4 + sysdeps/arc/fpu/math-use-builtins-sqrt.h | 4 + sysdeps/arc/fpu_control.h | 106 +++++++++++++++++++++++ sysdeps/arc/get-rounding-mode.h | 38 ++++++++ sysdeps/arc/math-tests-trap.h | 27 ++++++ sysdeps/arc/tininess.h | 1 + 20 files changed, 711 insertions(+) create mode 100644 sysdeps/arc/fpu/fclrexcpt.c create mode 100644 sysdeps/arc/fpu/fegetenv.c create mode 100644 sysdeps/arc/fpu/fegetmode.c create mode 100644 sysdeps/arc/fpu/fegetround.c create mode 100644 sysdeps/arc/fpu/feholdexcpt.c create mode 100644 sysdeps/arc/fpu/fesetenv.c create mode 100644 sysdeps/arc/fpu/fesetexcept.c create mode 100644 sysdeps/arc/fpu/fesetmode.c create mode 100644 sysdeps/arc/fpu/fesetround.c create mode 100644 sysdeps/arc/fpu/feupdateenv.c create mode 100644 sysdeps/arc/fpu/fgetexcptflg.c create mode 100644 sysdeps/arc/fpu/fraiseexcpt.c create mode 100644 sysdeps/arc/fpu/fsetexcptflg.c create mode 100644 sysdeps/arc/fpu/ftestexcept.c create mode 100644 sysdeps/arc/fpu/math-use-builtins-fma.h create mode 100644 sysdeps/arc/fpu/math-use-builtins-sqrt.h create mode 100644 sysdeps/arc/fpu_control.h create mode 100644 sysdeps/arc/get-rounding-mode.h create mode 100644 sysdeps/arc/math-tests-trap.h create mode 100644 sysdeps/arc/tininess.h
sysdeps/arc/fpu/fclrexcpt.c new file +36 -0
@@ -0,0 +1,36 @@ +/* Clear given exceptions in current floating-point environment. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> + +int +feclearexcept (int excepts) +{ +unsigned int fpsr; + +_FPU_GETS (fpsr); + +/* Clear the relevant bits, FWE is preserved. */ + fpsr &= ~excepts; + +_FPU_SETS (fpsr); + +return 0 ; +} +libm_hidden_def (feclearexcept)
sysdeps/arc/fpu/fegetenv.c new file +37 -0
@@ -0,0 +1,37 @@ +/* Store current floating-point environment. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> + +int +__fegetenv (fenv_t *envp) +{ +unsigned int fpcr; +unsigned int fpsr; + +_FPU_GETCW (fpcr); +_FPU_GETS (fpsr); + envp->__fpcr = fpcr; + envp->__fpsr = fpsr; + +return 0 ; +} +libm_hidden_def (__fegetenv) +weak_alias (__fegetenv, fegetenv) +libm_hidden_weak (fegetenv)
sysdeps/arc/fpu/fegetmode.c new file +31 -0
@@ -0,0 +1,31 @@ +/* Store current floating-point control modes. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> + +int +fegetmode (femode_t *modep) +{ +unsigned int fpcr; + +_FPU_GETCW (fpcr); + *modep = fpcr; + +return 0 ; +}
sysdeps/arc/fpu/fegetround.c new file +32 -0
@@ -0,0 +1,32 @@ +/* Return current rounding direction. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fenv_private.h> + +int +__fegetround (void ) +{ +unsigned int fpcr; +_FPU_GETCW (fpcr); + +return (fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK; +} +libm_hidden_def (__fegetround) +weak_alias (__fegetround, fegetround) +libm_hidden_weak (fegetround)
sysdeps/arc/fpu/feholdexcpt.c new file +43 -0
43 lines not on this page · raw message
sysdeps/arc/fpu/fesetenv.c new file +48 -0
48 lines not on this page · raw message
sysdeps/arc/fpu/fesetexcept.c new file +32 -0
@@ -0,0 +1,32 @@ +/* Set given exception flags. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> + +int +fesetexcept (int excepts) +{ +unsigned int fpsr; + +_FPU_GETS (fpsr); + fpsr |= excepts; +_FPU_SETS (fpsr); + +return 0 ; +}
sysdeps/arc/fpu/fesetmode.c new file +40 -0
@@ -0,0 +1,40 @@ +/* Install given floating-point control modes. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> + +int +fesetmode (const femode_t *modep) +{ +unsigned int fpcr; + +if (modep ==FE_DFL_MODE ) + { + fpcr = _FPU_DEFAULT; + } +else + { +/* No need to mask out reserved bits as they are IoW. */ + fpcr = *modep; + } + +_FPU_SETCW (fpcr); + +return 0 ; +}
sysdeps/arc/fpu/fesetround.c new file +40 -0
@@ -0,0 +1,40 @@ +/* Set current rounding direction. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fenv_private.h> + +int +__fesetround (int round) +{ +unsigned int fpcr; + +_FPU_GETCW (fpcr); + +if (((fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK) != round) + { + fpcr &= ~(__FPU_RND_MASK << __FPU_RND_SHIFT); + fpcr |= (round & __FPU_RND_MASK) << __FPU_RND_SHIFT; +_FPU_SETCW (fpcr); + } + +return 0 ; +} +libm_hidden_def (__fesetround) +weak_alias (__fesetround, fesetround) +libm_hidden_weak (fesetround)
sysdeps/arc/fpu/feupdateenv.c new file +51 -0
51 lines not on this page · raw message
sysdeps/arc/fpu/fgetexcptflg.c new file +31 -0
@@ -0,0 +1,31 @@ +/* Store current representation for exceptions, ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fenv_private.h> + +int +fegetexceptflag (fexcept_t *flagp,int excepts) +{ +unsigned int fpsr; + +_FPU_GETS (fpsr); + *flagp = fpsr & excepts; + +return 0 ; +}
sysdeps/arc/fpu/fraiseexcpt.c new file +39 -0
@@ -0,0 +1,39 @@ +/* Raise given exceptions. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> +#include <float.h> +#include <math.h> + +int +__feraiseexcept (int excepts) +{ +unsigned int fpsr; + +/* currently raised exceptions are not cleared. */ +_FPU_GETS (fpsr); + fpsr |= excepts; + +_FPU_SETS (fpsr); + +return 0 ; +} +libm_hidden_def (__feraiseexcept) +weak_alias (__feraiseexcept, feraiseexcept) +libm_hidden_weak (feraiseexcept)
sysdeps/arc/fpu/fsetexcptflg.c new file +38 -0
@@ -0,0 +1,38 @@ +/* Set floating-point environment exception handling, ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> + +int +fesetexceptflag (const fexcept_t *flagp,int excepts) +{ +unsigned int fpsr; + +_FPU_GETS (fpsr); + +/* Clear the bits first. */ + fpsr &= ~excepts; + +/* Now set those bits, copying them over from @flagp. */ + fpsr |= *flagp & excepts; + +_FPU_SETS (fpsr); + +return 0 ; +}
sysdeps/arc/fpu/ftestexcept.c new file +33 -0
@@ -0,0 +1,33 @@ +/* Test exception in current environment. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> +#include <fenv_private.h> +#include <stdio.h> + +int +fetestexcept (int excepts) +{ +unsigned int fpsr; + +_FPU_GETS (fpsr); + +return fpsr & excepts; +} +libm_hidden_def (fetestexcept)
sysdeps/arc/fpu/math-use-builtins-fma.h new file +4 -0
@@ -0,0 +1,4 @@ +#define USE_FMA_BUILTIN 1 +#define USE_FMAF_BUILTIN 1 +#define USE_FMAL_BUILTIN 0 +#define USE_FMAF128_BUILTIN 0
sysdeps/arc/fpu/math-use-builtins-sqrt.h new file +4 -0
@@ -0,0 +1,4 @@ +#define USE_SQRT_BUILTIN 1 +#define USE_SQRTF_BUILTIN 1 +#define USE_SQRTL_BUILTIN 0 +#define USE_SQRTF128_BUILTIN 0
sysdeps/arc/fpu_control.h new file +106 -0
106 lines not on this page · raw message
sysdeps/arc/get-rounding-mode.h new file +38 -0
@@ -0,0 +1,38 @@ +/* Determine floating-point rounding mode within libc. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _ARC_GET_ROUNDING_MODE_H +#define _ARC_GET_ROUNDING_MODE_H 1 + +#include <fenv.h> +#include <fpu_control.h> + +static inline int +get_rounding_mode (void ) +{ +#if defined(__ARC_FPU_SP__) || defined(__ARC_FPU_DP__) +unsigned int fpcr; +_FPU_GETCW (fpcr); + +return (fpcr >> __FPU_RND_SHIFT) & __FPU_RND_MASK; +#else +return FE_TONEAREST ; +#endif +} + +#endif /* get-rounding-mode.h */
sysdeps/arc/math-tests-trap.h new file +27 -0
@@ -0,0 +1,27 @@ +/* Configuration for math tests: support for enabling exception traps. +ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef ARC_MATH_TESTS_TRAP_H +#define ARC_MATH_TESTS_TRAP_H 1 + +/* Trapping exceptions are optional on ARC +and not supported in Linux kernel just yet. */ +#define EXCEPTION_ENABLE_SUPPORTED (EXCEPT ) ((EXCEPT) == 0) + +#endif /* math-tests-trap.h. */
sysdeps/arc/tininess.h new file +1 -0
@@ -0,0 +1 @@ +#define TININESS_AFTER_ROUNDING 1
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 7/13 ARC: Linux Syscall Interface
In reply to Vineet Gupta--- sysdeps/unix/sysv/linux/arc/arch-syscall.h | 298 ++++++++++++++++++ sysdeps/unix/sysv/linux/arc/bits/timesize.h | 21 ++ sysdeps/unix/sysv/linux/arc/clone.S | 93 ++++++ .../unix/sysv/linux/arc/fixup-asm-unistd.h | 46 +++ sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h | 6 + sysdeps/unix/sysv/linux/arc/kernel-features.h | 27 ++ sysdeps/unix/sysv/linux/arc/kernel_stat.h | 26 ++ sysdeps/unix/sysv/linux/arc/mmap_internal.h | 27 ++ sysdeps/unix/sysv/linux/arc/sigaction.c | 31 ++ sysdeps/unix/sysv/linux/arc/sigrestorer.S | 29 ++ sysdeps/unix/sysv/linux/arc/syscall.S | 33 ++ sysdeps/unix/sysv/linux/arc/syscalls.list | 3 + sysdeps/unix/sysv/linux/arc/sysdep.c | 33 ++ sysdeps/unix/sysv/linux/arc/sysdep.h | 226 +++++++++++++ sysdeps/unix/sysv/linux/arc/vfork.S | 42 +++ 15 files changed, 941 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/arc/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/arc/bits/timesize.h create mode 100644 sysdeps/unix/sysv/linux/arc/clone.S create mode 100644 sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h create mode 100644 sysdeps/unix/sysv/linux/arc/kernel_stat.h create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h create mode 100644 sysdeps/unix/sysv/linux/arc/sigaction.c create mode 100644 sysdeps/unix/sysv/linux/arc/sigrestorer.S create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S create mode 100644 sysdeps/unix/sysv/linux/arc/syscalls.list create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.c create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.h create mode 100644 sysdeps/unix/sysv/linux/arc/vfork.S
sysdeps/unix/sysv/linux/arc/arch-syscall.h new file +298 -0
@@ -0,0 +1,298 @@ +/* AUTOGENERATED by update-syscall-lists.py. */ +#define __NR_accept 202 +#define __NR_accept4 242 +#define __NR_acct 89 +#define __NR_add_key 217 +#define __NR_adjtimex 171 +#define __NR_arc_gettls 246 +#define __NR_arc_settls 245 +#define __NR_arc_usr_cmpxchg 248 +#define __NR_bind 200 +#define __NR_bpf 280 +#define __NR_brk 214 +#define __NR_cacheflush 244 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_chdir 49 +#define __NR_chroot 51 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime64 404 +#define __NR_clone 220 +#define __NR_clone3 435 +#define __NR_close 57 +#define __NR_connect 203 +#define __NR_copy_file_range 285 +#define __NR_delete_module 106 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_eventfd2 19 +#define __NR_execve 221 +#define __NR_execveat 281 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_faccessat 48 +#define __NR_fadvise64_64 223 +#define __NR_fallocate 47 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_fchdir 50 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchown 55 +#define __NR_fchownat 54 +#define __NR_fcntl64 25 +#define __NR_fdatasync 83 +#define __NR_fgetxattr 10 +#define __NR_finit_module 273 +#define __NR_flistxattr 13 +#define __NR_flock 32 +#define __NR_fremovexattr 16 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 7 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstatfs64 44 +#define __NR_fsync 82 +#define __NR_ftruncate64 46 +#define __NR_futex_time64 422 +#define __NR_get_mempolicy 236 +#define __NR_get_robust_list 100 +#define __NR_getcpu 168 +#define __NR_getcwd 17 +#define __NR_getdents64 61 +#define __NR_getegid 177 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getgroups 158 +#define __NR_getitimer 102 +#define __NR_getpeername 205 +#define __NR_getpgid 155 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getpriority 141 +#define __NR_getrandom 278 +#define __NR_getresgid 150 +#define __NR_getresuid 148 +#define __NR_getrlimit 163 +#define __NR_getrusage 165 +#define __NR_getsid 156 +#define __NR_getsockname 204 +#define __NR_getsockopt 209 +#define __NR_gettid 178 +#define __NR_gettimeofday 169 +#define __NR_getuid 174 +#define __NR_getxattr 8 +#define __NR_init_module 105 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_init1 26 +#define __NR_inotify_rm_watch 28 +#define __NR_io_cancel 3 +#define __NR_io_destroy 1 +#define __NR_io_getevents 4 +#define __NR_io_pgetevents 292 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 0 +#define __NR_io_submit 2 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 29 +#define __NR_ioprio_get 31 +#define __NR_ioprio_set 30 +#define __NR_kcmp 272 +#define __NR_kexec_file_load 294 +#define __NR_kexec_load 104 +#define __NR_keyctl 219 +#define __NR_kill 129 +#define __NR_lgetxattr 9 +#define __NR_linkat 37 +#define __NR_listen 201 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_llseek 62 +#define __NR_lookup_dcookie 18 +#define __NR_lremovexattr 15 +#define __NR_lsetxattr 6 +#define __NR_madvise 233 +#define __NR_mbind 235 +#define __NR_membarrier 283 +#define __NR_memfd_create 279 +#define __NR_migrate_pages 238 +#define __NR_mincore 232 +#define __NR_mkdirat 34 +#define __NR_mknodat 33 +#define __NR_mlock 228 +#define __NR_mlock2 284 +#define __NR_mlockall 230 +#define __NR_mmap2 222 +#define __NR_mount 40 +#define __NR_move_mount 429 +#define __NR_move_pages 239 +#define __NR_mprotect 226 +#define __NR_mq_getsetattr 185 +#define __NR_mq_notify 184 +#define __NR_mq_open 180 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 181 +#define __NR_mremap 216 +#define __NR_msgctl 187 +#define __NR_msgget 186 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_msync 227 +#define __NR_munlock 229 +#define __NR_munlockall 231 +#define __NR_munmap 215 +#define __NR_name_to_handle_at 264 +#define __NR_nanosleep 101 +#define __NR_nfsservctl 42 +#define __NR_open_by_handle_at 265 +#define __NR_open_tree 428 +#define __NR_openat 56 +#define __NR_openat2 437 +#define __NR_perf_event_open 241 +#define __NR_personality 92 +#define __NR_pidfd_getfd 438 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe2 59 +#define __NR_pivot_root 41 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_pkey_mprotect 288 +#define __NR_ppoll_time64 414 +#define __NR_prctl 167 +#define __NR_pread64 67 +#define __NR_preadv 69 +#define __NR_preadv2 286 +#define __NR_prlimit64 261 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 117 +#define __NR_pwrite64 68 +#define __NR_pwritev 70 +#define __NR_pwritev2 287 +#define __NR_quotactl 60 +#define __NR_read 63 +#define __NR_readahead 213 +#define __NR_readlinkat 78 +#define __NR_readv 65 +#define __NR_reboot 142 +#define __NR_recvfrom 207 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 212 +#define __NR_remap_file_pages 234 +#define __NR_removexattr 14 +#define __NR_renameat 38 +#define __NR_renameat2 276 +#define __NR_request_key 218 +#define __NR_restart_syscall 128 +#define __NR_rseq 293 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_getaffinity 123 +#define __NR_sched_getattr 275 +#define __NR_sched_getparam 121 +#define __NR_sched_getscheduler 120 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 122 +#define __NR_sched_setattr 274 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_yield 124 +#define __NR_seccomp 277 +#define __NR_semctl 191 +#define __NR_semget 190 +#define __NR_semop 193 +#define __NR_semtimedop_time64 420 +#define __NR_sendfile64 71 +#define __NR_sendmmsg 269 +#define __NR_sendmsg 211 +#define __NR_sendto 206 +#define __NR_set_mempolicy 237 +#define __NR_set_robust_list 99 +#define __NR_set_tid_address 96 +#define __NR_setdomainname 162 +#define __NR_setfsgid 152 +#define __NR_setfsuid 151 +#define __NR_setgid 144 +#define __NR_setgroups 159 +#define __NR_sethostname 161 +#define __NR_setitimer 103 +#define __NR_setns 268 +#define __NR_setpgid 154 +#define __NR_setpriority 140 +#define __NR_setregid 143 +#define __NR_setresgid 149 +#define __NR_setresuid 147 +#define __NR_setreuid 145 +#define __NR_setrlimit 164 +#define __NR_setsid 157 +#define __NR_setsockopt 208 +#define __NR_settimeofday 170 +#define __NR_setuid 146 +#define __NR_setxattr 5 +#define __NR_shmat 196 +#define __NR_shmctl 195 +#define __NR_shmdt 197 +#define __NR_shmget 194 +#define __NR_shutdown 210 +#define __NR_sigaltstack 132 +#define __NR_signalfd4 74 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_splice 76 +#define __NR_statfs64 43 +#define __NR_statx 291 +#define __NR_swapoff 225 +#define __NR_swapon 224 +#define __NR_symlinkat 36 +#define __NR_sync 81 +#define __NR_sync_file_range 84 +#define __NR_syncfs 267 +#define __NR_sysfs 247 +#define __NR_sysinfo 179 +#define __NR_syslog 116 +#define __NR_tee 77 +#define __NR_tgkill 131 +#define __NR_timer_create 107 +#define __NR_timer_delete 111 +#define __NR_timer_getoverrun 109 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 85 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime64 411 +#define __NR_times 153 +#define __NR_tkill 130 +#define __NR_truncate64 45 +#define __NR_umask 166 +#define __NR_umount2 39 +#define __NR_uname 160 +#define __NR_unlinkat 35 +#define __NR_unshare 97 +#define __NR_userfaultfd 282 +#define __NR_utimensat_time64 412 +#define __NR_vhangup 58 +#define __NR_vmsplice 75 +#define __NR_wait4 260 +#define __NR_waitid 95 +#define __NR_write 64 +#define __NR_writev 66
sysdeps/unix/sysv/linux/arc/bits/timesize.h new file +21 -0
@@ -0,0 +1,21 @@ +/* Bit size of the time_t type at glibc build time, general case. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<http://www.gnu.org/licenses/>. */ + +#include <bits/wordsize.h> + +#define __TIMESIZE 64
sysdeps/unix/sysv/linux/arc/clone.S new file +93 -0
93 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h new file +46 -0
46 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h new file +6 -0
@@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE (32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int) +#define SIGJMP_BUF_SIZE (32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int) +#define JMP_BUF_ALIGN __alignof__ (unsigned long int) +#define SIGJMP_BUF_ALIGN __alignof__ (unsigned long int) +#define MASK_WAS_SAVED_OFFSET (32 * sizeof (unsigned long int)) +#define SAVED_MASK_OFFSET (33 * sizeof (unsigned long int))
sysdeps/unix/sysv/linux/arc/kernel-features.h new file +27 -0
@@ -0,0 +1,27 @@ +/* Set flags signalling availability of kernel features based on given +kernel version number. + +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +/* The minimum supported kernel version for ARC is 5.1 (64-bit time, offsets), +although the asm-generic ABI is from 3.9 (when Linux port was merged). */ + +#include_next <kernel-features.h> + +#undef __ASSUME_CLONE_DEFAULT +#define __ASSUME_CLONE_BACKWARDS 1
sysdeps/unix/sysv/linux/arc/kernel_stat.h new file +26 -0
@@ -0,0 +1,26 @@ +/* Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <bits/wordsize.h> + +/* Needed to elide the itemized copy code in common xstatconv.c. */ +#define STAT_IS_KERNEL_STAT 1 + +/* Nice side-effect of 64-bit time_t switch is these are same. */ +#define XSTAT_IS_XSTAT64 1 + +#define STATFS_IS_STATFS64 0
sysdeps/unix/sysv/linux/arc/mmap_internal.h new file +27 -0
@@ -0,0 +1,27 @@ +/* mmap - map files or devices into memory. Linux/ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef MMAP_ARC_INTERNAL_H +#define MMAP_ARC_INTERNAL_H + +/* 8K is default but determine the shift dynamically with getpagesize. */ +#define MMAP2_PAGE_UNIT -1 + +#include_next <mmap_internal.h> + +#endif
sysdeps/unix/sysv/linux/arc/sigaction.c new file +31 -0
@@ -0,0 +1,31 @@ +/* ARC specific sigaction. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#define SA_RESTORER 0x04000000 + +extern void __default_rt_sa_restorer (void ); + +#define SET_SA_RESTORER (kact, act) \ + ({ \ + (kact)->sa_restorer = __default_rt_sa_restorer; \ + (kact)->sa_flags |= SA_RESTORER; \ + }) + +#define RESET_SA_RESTORER (act, kact) + +#include <sysdeps/unix/sysv/linux/sigaction.c>
sysdeps/unix/sysv/linux/arc/sigrestorer.S new file +29 -0
@@ -0,0 +1,29 @@ +/* Default sigreturn stub for ARC Linux. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <sys/syscall.h> +#include <sysdep.h> +#include <tcb-offsets.h> + +/* Note the NOP has to be outside body. */ + nop +ENTRY (__default_rt_sa_restorer) + mov r8, __NR_rt_sigreturn + ARC_TRAP_INSN + j_s [blink] +PSEUDO_END_NOERRNO (__default_rt_sa_restorer)
sysdeps/unix/sysv/linux/arc/syscall.S new file +33 -0
@@ -0,0 +1,33 @@ +/* syscall - indirect system call. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +ENTRY (syscall) + mov_s r8, r0 + mov_s r0, r1 + mov_s r1, r2 + mov_s r2, r3 + mov_s r3, r4 + mov_s r4, r5 + mov_s r5, r6 + + ARC_TRAP_INSN + brhi r0, -4096, L (call_syscall_err) + j [blink] +PSEUDO_END (syscall)
sysdeps/unix/sysv/linux/arc/syscalls.list new file +3 -0
@@ -0,0 +1,3 @@ +# File name Caller Syscall name Args Strong name Weak names + +cacheflush - cacheflush i:pii _flush_cache cacheflush
sysdeps/unix/sysv/linux/arc/sysdep.c new file +33 -0
@@ -0,0 +1,33 @@ +/* ARC wrapper for setting errno. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <errno.h> + +/* All syscall handlers land here to avoid generated code bloat due to +GOT reference to errno_location or it's equivalent. */ +long int +__syscall_error (long int err_no) +{ +__set_errno (-err_no); +return -1 ; +} + +#if IS_IN (libc) +hidden_def (__syscall_error) +#endif
sysdeps/unix/sysv/linux/arc/sysdep.h new file +226 -0
226 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/vfork.S new file +42 -0
42 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 8/13 ARC: Linux ABI
In reply to Vineet Gupta--- sysdeps/arc/nptl/pthreaddef.h | 32 +++++++ sysdeps/unix/sysv/linux/arc/bits/procfs.h | 35 +++++++ .../sysv/linux/arc/bits/types/__sigset_t.h | 12 +++ sysdeps/unix/sysv/linux/arc/getcontext.S | 64 +++++++++++++ sysdeps/unix/sysv/linux/arc/makecontext.c | 73 ++++++++++++++ sysdeps/unix/sysv/linux/arc/setcontext.S | 93 ++++++++++++++++++ sysdeps/unix/sysv/linux/arc/sigcontextinfo.h | 28 ++++++ sysdeps/unix/sysv/linux/arc/swapcontext.S | 94 +++++++++++++++++++ sysdeps/unix/sysv/linux/arc/sys/cachectl.h | 35 +++++++ sysdeps/unix/sysv/linux/arc/sys/ucontext.h | 57 +++++++++++ sysdeps/unix/sysv/linux/arc/sys/user.h | 32 +++++++ sysdeps/unix/sysv/linux/arc/ucontext-macros.h | 25 +++++ sysdeps/unix/sysv/linux/arc/ucontext_i.sym | 20 ++++ 13 files changed, 600 insertions(+) create mode 100644 sysdeps/arc/nptl/pthreaddef.h create mode 100644 sysdeps/unix/sysv/linux/arc/bits/procfs.h create mode 100644 sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h create mode 100644 sysdeps/unix/sysv/linux/arc/getcontext.S create mode 100644 sysdeps/unix/sysv/linux/arc/makecontext.c create mode 100644 sysdeps/unix/sysv/linux/arc/setcontext.S create mode 100644 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h create mode 100644 sysdeps/unix/sysv/linux/arc/swapcontext.S create mode 100644 sysdeps/unix/sysv/linux/arc/sys/cachectl.h create mode 100644 sysdeps/unix/sysv/linux/arc/sys/ucontext.h create mode 100644 sysdeps/unix/sysv/linux/arc/sys/user.h create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext-macros.h create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext_i.sym
sysdeps/arc/nptl/pthreaddef.h new file +32 -0
@@ -0,0 +1,32 @@ +/* pthread machine parameter definitions, ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +/* Default stack size. */ +#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) + +/* Required stack pointer alignment at beginning. */ +#define STACK_ALIGN 4 + +/* Minimal stack size after allocating thread descriptor and guard size. */ +#define MINIMAL_REST_STACK 2048 + +/* Alignment requirement for TCB. */ +#define TCB_ALIGNMENT 4 + +/* Location of current stack frame. */ +#define CURRENT_STACK_FRAME __builtin_frame_address (0)
sysdeps/unix/sysv/linux/arc/bits/procfs.h new file +35 -0
@@ -0,0 +1,35 @@ +/* Types for registers for sys/procfs.h. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead." +#endif + +#include <sys/ucontext.h> + +/* And the whole bunch of them. We could have used `struct +user_regs' directly in the typedef, but tradition says that +the register set is an array, which does have some peculiar +semantics, so leave it that way. */ +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t)) + +typedef unsigned long int elf_greg_t ; +typedef unsigned long int elf_gregset_t [ELF_NGREG ]; + +/* There's no seperate floating point reg file in ARCv2. */ +typedef struct { }elf_fpregset_t ;
sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h new file +12 -0
@@ -0,0 +1,12 @@ +/* Architecture-specific __sigset_t definition. ARC version. */ +#ifndef ____sigset_t_defined +#define ____sigset_t_defined + +/* Linux asm-generic syscall ABI expects sigset_t to hold 64 signals. */ +#define _SIGSET_NWORDS (64 / (8 * sizeof (unsigned long int))) +typedef struct +{ +unsigned long int __val[_SIGSET_NWORDS]; +}__sigset_t ; + +#endif
sysdeps/unix/sysv/linux/arc/getcontext.S new file +64 -0
64 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/makecontext.c new file +73 -0
73 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/setcontext.S new file +93 -0
93 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/sigcontextinfo.h new file +28 -0
@@ -0,0 +1,28 @@ +/* ARC definitions for signal handling calling conventions. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _SIGCONTEXTINFO_H +#define _SIGCONTEXTINFO_H + +static inline uintptr_t +sigcontext_get_pc (const ucontext_t *ctx) +{ +return ctx->uc_mcontext.__ret; +} + +#endif
sysdeps/unix/sysv/linux/arc/swapcontext.S new file +94 -0
94 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/sys/cachectl.h new file +35 -0
@@ -0,0 +1,35 @@ +/* cacheflush - flush contents of instruction and/or data cache. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_CACHECTL_H +#define _SYS_CACHECTL_H 1 + +#include <features.h> + +/* Get the kernel definition for the op bits. */ +#include <asm/cachectl.h> + +__BEGIN_DECLS + +#ifdef __USE_MISC +extern int cacheflush (void *__addr, int __nbytes, int __op) __THROW; +#endif + +__END_DECLS + +#endif
sysdeps/unix/sysv/linux/arc/sys/ucontext.h new file +57 -0
57 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/sys/user.h new file +32 -0
@@ -0,0 +1,32 @@ +/* ptrace register data format definitions. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_USER_H +#define _SYS_USER_H 1 + +/* Struct user_regs_struct is exported by kernel header +However apps like strace also expect a struct user, so it's better to +have a dummy implementation. */ +#include <asm/ptrace.h> + +struct user +{ +long int dummy; +}; + +#endif
sysdeps/unix/sysv/linux/arc/ucontext-macros.h new file +25 -0
@@ -0,0 +1,25 @@ +/* Macros for ucontext routines, ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_ARC_UCONTEXT_MACROS_H +#define _LINUX_ARC_UCONTEXT_MACROS_H + +#include <sysdep.h> +#include "ucontext_i.h" + +#endif
sysdeps/unix/sysv/linux/arc/ucontext_i.sym new file +20 -0
@@ -0,0 +1,20 @@ +#include <inttypes.h> +#include <signal.h> +#include <stddef.h> +#include <sys/ucontext.h> + +SIG_BLOCK +SIG_SETMASK + +-- sizeof(sigset_t) expected by kernel: see comment in ARC sigaction.c for details +_NSIG8 (_NSIG / 8) + +-- Offsets of the fields in the ucontext_t structure. +#define ucontext(member) offsetof (ucontext_t, member) + +UCONTEXT_FLAGS ucontext (__uc_flags) +UCONTEXT_LINK ucontext (uc_link) +UCONTEXT_STACK ucontext (uc_stack) +UCONTEXT_MCONTEXT ucontext (uc_mcontext) +UCONTEXT_SIGMASK ucontext (uc_sigmask) +UCONTEXT_SIZE sizeof (ucontext_t)
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 9/13 ARC: Linux Startup and Dynamic Loading
In reply to Vineet GuptaA big shoutout to Cupertino Miranda <[email protected]> for his valuable contribution in initial bringup and debugging on Linux and later in solving pesky unwinding/cancelation failures in testsuite.
--- sysdeps/unix/sysv/linux/arc/dl-static.c | 84 +++++++++++++++++++++++++ sysdeps/unix/sysv/linux/arc/ldsodefs.h | 32 ++++++++++ 2 files changed, 116 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/arc/dl-static.c create mode 100644 sysdeps/unix/sysv/linux/arc/ldsodefs.h
sysdeps/unix/sysv/linux/arc/dl-static.c new file +84 -0
@@ -0,0 +1,84 @@ +/* Variable initialization. ARC version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <ldsodefs.h> + +#ifdef SHARED + +void +_dl_var_init (void *array[]) +{ +/* It has to match "variables" below. */ +enum + { +DL_PAGESIZE =0 + }; + +GLRO (dl_pagesize) = *((size_t *) array[DL_PAGESIZE ]); +} + +#else + +static void *variables[] = +{ + &GLRO (dl_pagesize) +}; + +static void +_dl_unprotect_relro (struct link_map *l) +{ +ElfW (Addr) start = ((l->l_addr + l->l_relro_addr) + & ~(GLRO (dl_pagesize) -1 )); +ElfW (Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size) + & ~(GLRO (dl_pagesize) -1 )); + +if (start != end) +__mprotect ((void *) start, end - start,PROT_READ |PROT_WRITE ); +} + +void +_dl_static_init (struct link_map *l) +{ +struct link_map *rtld_map = l; +struct r_scope_elem **scope; +const ElfW (Sym) *ref =NULL ; +lookup_t loadbase; +void (*f) (void *[]); +size_t i; + + loadbase =_dl_lookup_symbol_x ("_dl_var_init" , l, &ref, l->l_local_scope, +NULL ,0 ,1 ,NULL ); + +for (scope = l->l_local_scope; *scope !=NULL ; scope++) +for (i =0 ; i < (*scope)->r_nlist; i++) +if ((*scope)->r_list[i] == loadbase) + { + rtld_map = (*scope)->r_list[i]; +break ; + } + +if (ref !=NULL ) + { + f = (void (*) (void *[]))DL_SYMBOL_ADDRESS (loadbase, ref); +_dl_unprotect_relro (rtld_map); +f (variables); +_dl_protect_relro (rtld_map); + } +} + +#endif
sysdeps/unix/sysv/linux/arc/ldsodefs.h new file +32 -0
@@ -0,0 +1,32 @@ +/* Run-time dynamic linker data structures for loaded ELF shared objects. ARC +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library; if not, see +<https://www.gnu.org/licenses/>. */ + +#ifndef _LDSODEFS_H + +/* Get the real definitions. */ +#include_next <ldsodefs.h> + +/* Now define our stuff. */ + +/* We need special support to initialize DSO loaded for statically linked +binaries. */ +extern void _dl_static_init (struct link_map *map); +#undef DL_STATIC_INIT +#define DL_STATIC_INIT (map) _dl_static_init (map) + +#endif /* ldsodefs.h */
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 10/13 ARC: ABI lists
In reply to Vineet Gupta--- sysdeps/arc/fpu/libm-test-ulps | 1142 +++++++++ sysdeps/arc/fpu/libm-test-ulps-name | 1 + sysdeps/arc/nofpu/libm-test-ulps | 270 +++ sysdeps/arc/nofpu/libm-test-ulps-name | 1 + sysdeps/unix/sysv/linux/arc/c++-types.data | 67 + sysdeps/unix/sysv/linux/arc/ld.abilist | 5 + .../sysv/linux/arc/libBrokenLocale.abilist | 1 + sysdeps/unix/sysv/linux/arc/libanl.abilist | 4 + sysdeps/unix/sysv/linux/arc/libc.abilist | 2085 +++++++++++++++++ sysdeps/unix/sysv/linux/arc/libcrypt.abilist | 2 + sysdeps/unix/sysv/linux/arc/libdl.abilist | 9 + sysdeps/unix/sysv/linux/arc/libm.abilist | 699 ++++++ .../unix/sysv/linux/arc/libpthread.abilist | 213 ++ sysdeps/unix/sysv/linux/arc/libresolv.abilist | 79 + sysdeps/unix/sysv/linux/arc/librt.abilist | 35 + .../unix/sysv/linux/arc/libthread_db.abilist | 40 + sysdeps/unix/sysv/linux/arc/libutil.abilist | 6 + sysdeps/unix/sysv/linux/arc/localplt.data | 12 + 18 files changed, 4671 insertions(+) create mode 100644 sysdeps/arc/fpu/libm-test-ulps create mode 100644 sysdeps/arc/fpu/libm-test-ulps-name create mode 100644 sysdeps/arc/nofpu/libm-test-ulps create mode 100644 sysdeps/arc/nofpu/libm-test-ulps-name create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data create mode 100644 sysdeps/unix/sysv/linux/arc/ld.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libanl.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libc.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libcrypt.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libdl.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libm.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libpthread.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libresolv.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/librt.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libthread_db.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/libutil.abilist create mode 100644 sysdeps/unix/sysv/linux/arc/localplt.data
sysdeps/arc/fpu/libm-test-ulps new file +1142 -0
@@ -0,0 +1,1142 @@ +# Begin of automatic generation + +# Maximal error of functions: +Function: "acos": +double: 1 +float: 1 + +Function: "acos_downward": +double: 1 +float: 1 + +Function: "acos_towardzero": +double: 1 +float: 1 + +Function: "acos_upward": +double: 1 +float: 1 + +Function: "acosh": +double: 3 +float: 2 + +Function: "acosh_downward": +double: 2 +float: 2 + +Function: "acosh_towardzero": +double: 2 +float: 2 + +Function: "acosh_upward": +double: 3 +float: 3 + +Function: "asin": +double: 1 +float: 1 + +Function: "asin_downward": +double: 1 +float: 1 + +Function: "asin_towardzero": +double: 1 +float: 1 + +Function: "asin_upward": +double: 1 +float: 1 + +Function: "asinh": +double: 3 +float: 2 + +Function: "asinh_downward": +double: 3 +float: 3 + +Function: "asinh_towardzero": +double: 2 +float: 2 + +Function: "asinh_upward": +double: 3 +float: 3 + +Function: "atan": +double: 1 +float: 1 + +Function: "atan2": +double: 7 +float: 2 + +Function: "atan2_downward": +double: 5 +float: 2 + +Function: "atan2_towardzero": +double: 5 +float: 2 + +Function: "atan2_upward": +double: 8 +float: 2 + +Function: "atan_downward": +double: 1 +float: 2 + +Function: "atan_towardzero": +double: 1 +float: 1 + +Function: "atan_upward": +double: 2 +float: 2 + +Function: "atanh": +double: 2 +float: 2 + +Function: "atanh_downward": +double: 3 +float: 3 + +Function: "atanh_towardzero": +double: 2 +float: 2 + +Function: "atanh_upward": +double: 3 +float: 3 + +Function: "cabs": +double: 1 +float: 1 + +Function: "cabs_downward": +double: 1 + +Function: "cabs_towardzero": +double: 1 + +Function: "cabs_upward": +double: 2 +float: 1 + +Function: Real part of "cacos": +double: 2 +float: 2 + +Function: Imaginary part of "cacos": +double: 5 +float: 3 + +Function: Real part of "cacos_downward": +double: 3 +float: 2 + +Function: Imaginary part of "cacos_downward": +double: 5 +float: 3 + +Function: Real part of "cacos_towardzero": +double: 3 +float: 2 + +Function: Imaginary part of "cacos_towardzero": +double: 4 +float: 2 + +Function: Real part of "cacos_upward": +double: 2 +float: 3 + +Function: Imaginary part of "cacos_upward": +double: 5 +float: 5 + +Function: Real part of "cacosh": +double: 5 +float: 4 + +Function: Imaginary part of "cacosh": +double: 2 +float: 2 + +Function: Real part of "cacosh_downward": +double: 4 +float: 2 + +Function: Imaginary part of "cacosh_downward": +double: 3 +float: 3 + +Function: Real part of "cacosh_towardzero": +double: 4 +float: 2 + +Function: Imaginary part of "cacosh_towardzero": +double: 3 +float: 2 + +Function: Real part of "cacosh_upward": +double: 5 +float: 3 + +Function: Imaginary part of "cacosh_upward": +double: 3 +float: 3 + +Function: "carg": +double: 7 +float: 2 + +Function: "carg_downward": +double: 5 +float: 2 + +Function: "carg_towardzero": +double: 5 +float: 2 + +Function: "carg_upward": +double: 8 +float: 2 + +Function: Real part of "casin": +double: 3 +float: 1 + +Function: Imaginary part of "casin": +double: 5 +float: 4 + +Function: Real part of "casin_downward": +double: 3 +float: 2 + +Function: Imaginary part of "casin_downward": +double: 5 +float: 3 + +Function: Real part of "casin_towardzero": +double: 3 +float: 1 + +Function: Imaginary part of "casin_towardzero": +double: 4 +float: 2 + +Function: Real part of "casin_upward": +double: 3 +float: 2 + +Function: Imaginary part of "casin_upward": +double: 5 +float: 5 + +Function: Real part of "casinh": +double: 5 +float: 4 + +Function: Imaginary part of "casinh": +double: 3 +float: 2 + +Function: Real part of "casinh_downward": +double: 5 +float: 3 + +Function: Imaginary part of "casinh_downward": +double: 3 +float: 2 + +Function: Real part of "casinh_towardzero": +double: 4 +float: 2 + +Function: Imaginary part of "casinh_towardzero": +double: 3 +float: 1 + +Function: Real part of "casinh_upward": +double: 5 +float: 5 + +Function: Imaginary part of "casinh_upward": +double: 3 +float: 2 + +Function: Real part of "catan": +double: 1 +float: 1 + +Function: Imaginary part of "catan": +double: 3 +float: 3 + +Function: Real part of "catan_downward": +double: 1 +float: 2 + +Function: Imaginary part of "catan_downward": +double: 2 +float: 2 + +Function: Real part of "catan_towardzero": +double: 1 +float: 2 + +Function: Imaginary part of "catan_towardzero": +double: 3 +float: 3 + +Function: Real part of "catan_upward": +double: 2 +float: 2 + +Function: Imaginary part of "catan_upward": +double: 3 +float: 3 + +Function: Real part of "catanh": +double: 4 +float: 4 + +Function: Imaginary part of "catanh": +double: 1 +float: 2 + +Function: Real part of "catanh_downward": +double: 2 +float: 2 + +Function: Imaginary part of "catanh_downward": +double: 1 +float: 2 + +Function: Real part of "catanh_towardzero": +double: 3 +float: 3 + +Function: Imaginary part of "catanh_towardzero": +double: 1 +float: 2 + +Function: Real part of "catanh_upward": +double: 4 +float: 4 + +Function: Imaginary part of "catanh_upward": +double: 2 +float: 2 + +Function: "cbrt": +double: 4 +float: 1 + +Function: "cbrt_downward": +double: 4 +float: 1 + +Function: "cbrt_towardzero": +double: 3 +float: 1 + +Function: "cbrt_upward": +double: 5 +float: 1 + +Function: Real part of "ccos": +double: 3 +float: 3 + +Function: Imaginary part of "ccos": +double: 3 +float: 3 + +Function: Real part of "ccos_downward": +double: 3 +float: 1 + +Function: Imaginary part of "ccos_downward": +double: 3 +float: 3 + +Function: Real part of "ccos_towardzero": +double: 3 +float: 2 + +Function: Imaginary part of "ccos_towardzero": +double: 3 +float: 3 + +Function: Real part of "ccos_upward": +double: 4 +float: 2 + +Function: Imaginary part of "ccos_upward": +double: 4 +float: 4 + +Function: Real part of "ccosh": +double: 3 +float: 3 + +Function: Imaginary part of "ccosh": +double: 3 +float: 3 + +Function: Real part of "ccosh_downward": +double: 3 +float: 2 + +Function: Imaginary part of "ccosh_downward": +double: 3 +float: 3 + +Function: Real part of "ccosh_towardzero": +double: 3 +float: 3 + +Function: Imaginary part of "ccosh_towardzero": +double: 3 +float: 3 + +Function: Real part of "ccosh_upward": +double: 4 +float: 3 + +Function: Imaginary part of "ccosh_upward": +double: 4 +float: 4 + +Function: Real part of "cexp": +double: 4 +float: 3 + +Function: Imaginary part of "cexp": +double: 4 +float: 3 + +Function: Real part of "cexp_downward": +double: 4 +float: 2 + +Function: Imaginary part of "cexp_downward": +double: 3 +float: 3 + +Function: Real part of "cexp_towardzero": +double: 4 +float: 2 + +Function: Imaginary part of "cexp_towardzero": +double: 3 +float: 3 + +Function: Real part of "cexp_upward": +double: 5 +float: 3 + +Function: Imaginary part of "cexp_upward": +double: 4 +float: 4 + +Function: Real part of "clog": +double: 5 +float: 4 + +Function: Imaginary part of "clog": +double: 7 +float: 2 + +Function: Real part of "clog10": +double: 6 +float: 5 + +Function: Imaginary part of "clog10": +double: 8 +float: 4 + +Function: Real part of "clog10_downward": +double: 5 +float: 5 + +Function: Imaginary part of "clog10_downward": +double: 8 +float: 4 + +Function: Real part of "clog10_towardzero": +double: 6 +float: 6 + +Function: Imaginary part of "clog10_towardzero": +double: 9 +float: 4 + +Function: Real part of "clog10_upward": +double: 6 +float: 6 + +Function: Imaginary part of "clog10_upward": +double: 9 +float: 5 + +Function: Real part of "clog_downward": +double: 4 +float: 3 + +Function: Imaginary part of "clog_downward": +double: 5 +float: 2 + +Function: Real part of "clog_towardzero": +double: 5 +float: 4 + +Function: Imaginary part of "clog_towardzero": +double: 5 +float: 3 + +Function: Real part of "clog_upward": +double: 5 +float: 4 + +Function: Imaginary part of "clog_upward": +double: 8 +float: 2 + +Function: "cos": +double: 4 +float: 1 + +Function: "cos_downward": +double: 1 +float: 1 + +Function: "cos_towardzero": +double: 4 +float: 2 + +Function: "cos_upward": +double: 4 +float: 2 + +Function: "cosh": +double: 3 +float: 3 + +Function: "cosh_downward": +double: 2 +float: 1 + +Function: "cosh_towardzero": +double: 2 +float: 1 + +Function: "cosh_upward": +double: 3 +float: 2 + +Function: Real part of "cpow": +double: 9 +float: 8 + +Function: Imaginary part of "cpow": +double: 3 +float: 6 + +Function: Real part of "cpow_downward": +double: 5 +float: 8 + +Function: Imaginary part of "cpow_downward": +double: 2 +float: 2 + +Function: Real part of "cpow_towardzero": +double: 5 +float: 8 + +Function: Imaginary part of "cpow_towardzero": +double: 2 +float: 2 + +Function: Real part of "cpow_upward": +double: 5 +float: 8 + +Function: Imaginary part of "cpow_upward": +double: 2 +float: 2 + +Function: Real part of "csin": +double: 3 +float: 3 + +Function: Imaginary part of "csin": +double: 3 +float: 3 + +Function: Real part of "csin_downward": +double: 3 +float: 3 + +Function: Imaginary part of "csin_downward": +double: 3 +float: 1 + +Function: Real part of "csin_towardzero": +double: 3 +float: 3 + +Function: Imaginary part of "csin_towardzero": +double: 3 +float: 1 + +Function: Real part of "csin_upward": +double: 4 +float: 4 + +Function: Imaginary part of "csin_upward": +double: 4 +float: 2 + +Function: Real part of "csinh": +double: 3 +float: 3 + +Function: Imaginary part of "csinh": +double: 3 +float: 3 + +Function: Real part of "csinh_downward": +double: 3 +float: 1 + +Function: Imaginary part of "csinh_downward": +double: 3 +float: 3 + +Function: Real part of "csinh_towardzero": +double: 3 +float: 2 + +Function: Imaginary part of "csinh_towardzero": +double: 3 +float: 3 + +Function: Real part of "csinh_upward": +double: 4 +float: 2 + +Function: Imaginary part of "csinh_upward": +double: 4 +float: 4 + +Function: Real part of "csqrt": +double: 4 +float: 3 + +Function: Imaginary part of "csqrt": +double: 4 +float: 3 + +Function: Real part of "csqrt_downward": +double: 5 +float: 4 + +Function: Imaginary part of "csqrt_downward": +double: 4 +float: 3 + +Function: Real part of "csqrt_towardzero": +double: 5 +float: 4 + +Function: Imaginary part of "csqrt_towardzero": +double: 4 +float: 4 + +Function: Real part of "csqrt_upward": +double: 5 +float: 4 + +Function: Imaginary part of "csqrt_upward": +double: 4 +float: 4 + +Function: Real part of "ctan": +double: 4 +float: 6 + +Function: Imaginary part of "ctan": +double: 3 +float: 2 + +Function: Real part of "ctan_downward": +double: 6 +float: 5 + +Function: Imaginary part of "ctan_downward": +double: 3 +float: 2 + +Function: Real part of "ctan_towardzero": +double: 5 +float: 6 + +Function: Imaginary part of "ctan_towardzero": +double: 3 +float: 2 + +Function: Real part of "ctan_upward": +double: 5 +float: 6 + +Function: Imaginary part of "ctan_upward": +double: 2 +float: 2 + +Function: Real part of "ctanh": +double: 3 +float: 2 + +Function: Imaginary part of "ctanh": +double: 4 +float: 6 + +Function: Real part of "ctanh_downward": +double: 3 +float: 2 + +Function: Imaginary part of "ctanh_downward": +double: 6 +float: 5 + +Function: Real part of "ctanh_towardzero": +double: 3 +float: 2 + +Function: Imaginary part of "ctanh_towardzero": +double: 5 +float: 6 + +Function: Real part of "ctanh_upward": +double: 3 +float: 2 + +Function: Imaginary part of "ctanh_upward": +double: 5 +float: 6 + +Function: "erf": +double: 1 +float: 1 + +Function: "erf_downward": +double: 1 +float: 1 + +Function: "erf_towardzero": +double: 1 +float: 2 + +Function: "erf_upward": +double: 2 +float: 2 + +Function: "erfc": +double: 5 +float: 5 + +Function: "erfc_downward": +double: 4 +float: 4 + +Function: "erfc_towardzero": +double: 4 +float: 4 + +Function: "erfc_upward": +double: 5 +float: 5 + +Function: "exp": +double: 1 +float: 1 + +Function: "exp10": +double: 4 +float: 1 + +Function: "exp10_downward": +double: 3 +float: 1 + +Function: "exp10_towardzero": +double: 3 +float: 1 + +Function: "exp10_upward": +double: 4 +float: 1 + +Function: "exp2": +double: 1 +float: 1 + +Function: "exp2_downward": +double: 1 + +Function: "exp2_towardzero": +double: 1 + +Function: "exp2_upward": +double: 2 +float: 1 + +Function: "exp_downward": +double: 1 +float: 1 + +Function: "exp_towardzero": +double: 1 +float: 1 + +Function: "exp_upward": +double: 2 +float: 2 + +Function: "expm1": +double: 2 +float: 2 + +Function: "expm1_downward": +double: 1 +float: 1 + +Function: "expm1_towardzero": +double: 1 +float: 2 + +Function: "expm1_upward": +double: 2 +float: 2 + +Function: "gamma": +double: 7 +float: 6 + +Function: "gamma_downward": +double: 6 +float: 5 + +Function: "gamma_towardzero": +double: 7 +float: 6 + +Function: "gamma_upward": +double: 7 +float: 6 + +Function: "hypot": +double: 2 +float: 1 + +Function: "hypot_downward": +double: 1 + +Function: "hypot_towardzero": +double: 1 + +Function: "hypot_upward": +double: 2 +float: 1 + +Function: "j0": +double: 4 +float: 6 + +Function: "j0_downward": +double: 2 +float: 4 + +Function: "j0_towardzero": +double: 4 +float: 5 + +Function: "j0_upward": +double: 3 +float: 5 + +Function: "j1": +double: 5 +float: 9 + +Function: "j1_downward": +double: 4 +float: 6 + +Function: "j1_towardzero": +double: 4 +float: 3 + +Function: "j1_upward": +double: 5 +float: 5 + +Function: "jn": +double: 9 +float: 8 + +Function: "jn_downward": +double: 7 +float: 9 + +Function: "jn_towardzero": +double: 7 +float: 9 + +Function: "jn_upward": +double: 9 +float: 9 + +Function: "lgamma": +double: 7 +float: 6 + +Function: "lgamma_downward": +double: 6 +float: 5 + +Function: "lgamma_towardzero": +double: 7 +float: 6 + +Function: "lgamma_upward": +double: 7 +float: 6 + +Function: "log": +double: 1 +float: 1 + +Function: "log10": +double: 2 +float: 3 + +Function: "log10_downward": +double: 2 +float: 3 + +Function: "log10_towardzero": +double: 2 +float: 4 + +Function: "log10_upward": +double: 3 +float: 4 + +Function: "log1p": +double: 1 +float: 1 + +Function: "log1p_downward": +double: 1 +float: 2 + +Function: "log1p_towardzero": +double: 2 +float: 2 + +Function: "log1p_upward": +double: 2 +float: 2 + +Function: "log2": +double: 2 +float: 1 + +Function: "log2_towardzero": +double: 1 +float: 1 + +Function: "log2_upward": +double: 1 +float: 1 + +Function: "log_towardzero": +double: 1 +float: 1 + +Function: "log_upward": +double: 1 +float: 1 + +Function: "pow": +double: 1 +float: 1 + +Function: "pow_downward": +double: 1 +float: 1 + +Function: "pow_towardzero": +double: 1 +float: 1 + +Function: "pow_upward": +double: 2 +float: 2 + +Function: "sin": +double: 7 +float: 1 + +Function: "sin_downward": +double: 4 +float: 1 + +Function: "sin_towardzero": +double: 3 +float: 1 + +Function: "sin_upward": +double: 7 +float: 1 + +Function: "sincos": +double: 1 +float: 1 + +Function: "sincos_downward": +double: 1 +float: 1 + +Function: "sincos_towardzero": +double: 4 +float: 1 + +Function: "sincos_upward": +double: 2 +float: 1 + +Function: "sinh": +double: 3 +float: 3 + +Function: "sinh_downward": +double: 3 +float: 3 + +Function: "sinh_towardzero": +double: 2 +float: 2 + +Function: "sinh_upward": +double: 3 +float: 3 + +Function: "tan": +double: 1 +float: 1 + +Function: "tan_downward": +double: 1 +float: 2 + +Function: "tan_towardzero": +double: 1 +float: 2 + +Function: "tan_upward": +double: 1 +float: 2 + +Function: "tanh": +double: 3 +float: 2 + +Function: "tanh_downward": +double: 3 +float: 3 + +Function: "tanh_towardzero": +double: 3 +float: 3 + +Function: "tanh_upward": +double: 3 +float: 3 + +Function: "tgamma": +double: 9 +float: 9 + +Function: "tgamma_downward": +double: 9 +float: 9 + +Function: "tgamma_towardzero": +double: 9 +float: 8 + +Function: "tgamma_upward": +double: 9 +float: 9 + +Function: "y0": +double: 3 +float: 6 + +Function: "y0_downward": +double: 3 +float: 4 + +Function: "y0_towardzero": +double: 3 +float: 4 + +Function: "y0_upward": +double: 4 +float: 5 + +Function: "y1": +double: 7 +float: 6 + +Function: "y1_downward": +double: 6 +float: 6 + +Function: "y1_towardzero": +double: 7 +float: 7 + +Function: "y1_upward": +double: 7 +float: 7 + +Function: "yn": +double: 9 +float: 9 + +Function: "yn_downward": +double: 8 +float: 8 + +Function: "yn_towardzero": +double: 9 +float: 9 + +Function: "yn_upward": +double: 9 +float: 9 + +# end of automatic generation
sysdeps/arc/fpu/libm-test-ulps-name new file +1 -0
@@ -0,0 +1 @@ +ARC
sysdeps/arc/nofpu/libm-test-ulps new file +270 -0
270 lines not on this page · raw message
sysdeps/arc/nofpu/libm-test-ulps-name new file +1 -0
@@ -0,0 +1 @@ +ARC soft-float
sysdeps/unix/sysv/linux/arc/c++-types.data new file +67 -0
67 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/ld.abilist new file +5 -0
@@ -0,0 +1,5 @@ +GLIBC_2.32 __libc_stack_end D 0x4 +GLIBC_2.32 __stack_chk_guard D 0x4 +GLIBC_2.32 __tls_get_addr F +GLIBC_2.32 _dl_mcount F +GLIBC_2.32 _r_debug D 0x14
sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist new file +1 -0
@@ -0,0 +1 @@ +GLIBC_2.32 __ctype_get_mb_cur_max F
sysdeps/unix/sysv/linux/arc/libanl.abilist new file +4 -0
@@ -0,0 +1,4 @@ +GLIBC_2.32 gai_cancel F +GLIBC_2.32 gai_error F +GLIBC_2.32 gai_suspend F +GLIBC_2.32 getaddrinfo_a F
sysdeps/unix/sysv/linux/arc/libc.abilist new file +2085 -0
1,509 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/libcrypt.abilist new file +2 -0
Lines of this file are not shown. View the raw message.
sysdeps/unix/sysv/linux/arc/libdl.abilist new file +9 -0
Lines of this file are not shown. View the raw message.
sysdeps/unix/sysv/linux/arc/libm.abilist new file +699 -0
699 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/libpthread.abilist new file +213 -0
213 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/libresolv.abilist new file +79 -0
79 lines not on this page · raw message
sysdeps/unix/sysv/linux/arc/librt.abilist new file +35 -0
Lines of this file are not shown. View the raw message.
sysdeps/unix/sysv/linux/arc/libthread_db.abilist new file +40 -0
Lines of this file are not shown. View the raw message.
sysdeps/unix/sysv/linux/arc/libutil.abilist new file +6 -0
Lines of this file are not shown. View the raw message.
sysdeps/unix/sysv/linux/arc/localplt.data new file +12 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Part of the diff is not shown here. View the raw message.
PATCH 11/13 ARC: Build Infrastructure
In reply to Vineet Gupta--- config.h.in | 3 + sysdeps/arc/Implies | 3 + sysdeps/arc/Makefile | 21 +++ sysdeps/arc/Versions | 8 + sysdeps/arc/configure | 182 +++++++++++++++++++++ sysdeps/arc/configure.ac | 26 +++ sysdeps/arc/nptl/Makefile | 22 +++ sysdeps/arc/preconfigure | 14 ++ sysdeps/unix/sysv/linux/arc/Implies | 3 + sysdeps/unix/sysv/linux/arc/Makefile | 29 ++++ sysdeps/unix/sysv/linux/arc/Versions | 16 ++ sysdeps/unix/sysv/linux/arc/configure | 4 + sysdeps/unix/sysv/linux/arc/configure.ac | 4 + sysdeps/unix/sysv/linux/arc/ldconfig.h | 27 +++ sysdeps/unix/sysv/linux/arc/shlib-versions | 7 + 15 files changed, 369 insertions(+) create mode 100644 sysdeps/arc/Implies create mode 100644 sysdeps/arc/Makefile create mode 100644 sysdeps/arc/Versions create mode 100644 sysdeps/arc/configure create mode 100644 sysdeps/arc/configure.ac create mode 100644 sysdeps/arc/nptl/Makefile create mode 100644 sysdeps/arc/preconfigure create mode 100644 sysdeps/unix/sysv/linux/arc/Implies create mode 100644 sysdeps/unix/sysv/linux/arc/Makefile create mode 100644 sysdeps/unix/sysv/linux/arc/Versions create mode 100644 sysdeps/unix/sysv/linux/arc/configure create mode 100644 sysdeps/unix/sysv/linux/arc/configure.ac create mode 100644 sysdeps/unix/sysv/linux/arc/ldconfig.h create mode 100644 sysdeps/unix/sysv/linux/arc/shlib-versions
config.h.in +3 -0
@@ -118,6 +118,9 @@ /* AArch64 PAC-RET code generation is enabled. */ #define HAVE_AARCH64_PAC_RET 0 +/* ARC big endian ABI */ +#undef HAVE_ARC_BE + /* C-SKY ABI version. */ #undef CSKYABI
sysdeps/arc/Implies new file +3 -0
@@ -0,0 +1,3 @@ +wordsize-32 +ieee754/flt-32 +ieee754/dbl-64
sysdeps/arc/Makefile new file +21 -0
@@ -0,0 +1,21 @@ +# ARC Makefile +# Copyright (C) 2020 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library. If not, see +# <https://www.gnu.org/licenses/>. + +# We don't support long doubles as a distinct type. We don't need to set +# this variable; it's here mostly for documentational purposes. +long-double-fcts = no
sysdeps/arc/Versions new file +8 -0
@@ -0,0 +1,8 @@ +libc { + GLIBC_2.32 { + __mcount; + } + GLIBC_PRIVATE { + __syscall_error; + } +}
sysdeps/arc/configure new file +182 -0
182 lines not on this page · raw message
sysdeps/arc/configure.ac new file +26 -0
@@ -0,0 +1,26 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/arc. + +AC_DEFINE(PI_STATIC_AND_HIDDEN) +libc_cv_have_sdata_section=no + +# For ARC, historically ; was used for comments and not newline +# Later # also got added to comment list, but ; couldn't be switched to +# canonical newline as there's lots of code out there which will break +libc_cv_asm_line_sep='`' +AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep) + +# For big endian ABI, generate a symbol for selecting right dynamic linker +AC_CACHE_CHECK([for big endian], + [libc_cv_arc_be], + [AC_EGREP_CPP(yes,[#ifdef __BIG_ENDIAN__ + yes + #endif + ], libc_cv_arc_be=yes, libc_cv_arc_be=no)]) +if test $libc_cv_arc_be = yes; then + # For shlib-versions. + AC_DEFINE(HAVE_ARC_BE) + LIBC_CONFIG_VAR([default-abi], [arcbe]) +else + LIBC_CONFIG_VAR([default-abi], [arcle]) +fi
sysdeps/arc/nptl/Makefile new file +22 -0
@@ -0,0 +1,22 @@ +# NPTL makefile fragment for ARC. +# Copyright (C) 2020 Free Software Foundation, Inc. +# +# This file is part of the GNU C Library. +# +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library. If not, see +# <https://www.gnu.org/licenses/>. + +ifeq ($(subdir),csu) +gen-as-const-headers += tcb-offsets.sym +endif
sysdeps/arc/preconfigure new file +14 -0
@@ -0,0 +1,14 @@ +case "$machine" in +arc*) + base_machine=arc + machine=arc + + gccfloat=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep __ARC_FPU_| wc -l` + if test "$gccfloat" != "0"; then + with_fp_cond=1 + else + with_fp_cond=0 + fi + ;; + +esac
sysdeps/unix/sysv/linux/arc/Implies new file +3 -0
@@ -0,0 +1,3 @@ +arc/nptl +unix/sysv/linux/generic/wordsize-32 +unix/sysv/linux/generic
sysdeps/unix/sysv/linux/arc/Makefile new file +29 -0
@@ -0,0 +1,29 @@ +ifeq ($(subdir),stdlib) +gen-as-const-headers += ucontext_i.sym +endif + +ifeq ($(subdir),signal) +sysdep_routines += sigrestorer +endif + +ifeq ($(subdir),misc) +# MIPS/Tile-style cacheflush routine +sysdep_headers += sys/cachectl.h +sysdep_routines += cacheflush +endif + +ifeq ($(subdir),elf) +ifeq ($(build-shared),yes) +# This is needed for DSO loading from static binaries. +sysdep-dl-routines += dl-static +endif +endif + +abi-variants := arcle arcbe + +ifeq (,$(filter $(default-abi),$(abi-variants))) +$(error Unknown ABI $(default-abi), must be one of $(abi-variants)) +endif + +abi-arcle-condition := !defined __BIG_ENDIAN__ +abi-arcbe-condition := defined __BIG_ENDIAN__
sysdeps/unix/sysv/linux/arc/Versions new file +16 -0
@@ -0,0 +1,16 @@ +ld { + GLIBC_PRIVATE { + # used for loading by static libraries + _dl_var_init; + } +} +libc { + GLIBC_2.32 { + _flush_cache; + cacheflush; + } + GLIBC_PRIVATE { + # A copy of sigaction lives in libpthread, and needs these. + __default_rt_sa_restorer; + } +}
sysdeps/unix/sysv/linux/arc/configure new file +4 -0
@@ -0,0 +1,4 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/arc. + +arch_minimum_kernel=5.1.0
sysdeps/unix/sysv/linux/arc/configure.ac new file +4 -0
@@ -0,0 +1,4 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/arc. + +arch_minimum_kernel=5.1.0
sysdeps/unix/sysv/linux/arc/ldconfig.h new file +27 -0
@@ -0,0 +1,27 @@ +/* ldconfig default paths and libraries. Linux/RISC-V version. +Copyright (C) 2020 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with the GNU C Library. If not, see +<https://www.gnu.org/licenses/>. */ + +#include <sysdeps/generic/ldconfig.h> + +#define SYSDEP_KNOWN_INTERPRETER_NAMES \ + { "/lib/ld-linux-arc.so.2", FLAG_ELF_LIBC6 }, \ + { "/lib/ld-linux-arceb.so.2", FLAG_ELF_LIBC6 }, + +#define SYSDEP_KNOWN_LIBRARY_NAMES \ + { "libc.so.6", FLAG_ELF_LIBC6 }, \ + { "libm.so.6", FLAG_ELF_LIBC6 },
sysdeps/unix/sysv/linux/arc/shlib-versions new file +7 -0
@@ -0,0 +1,7 @@ +DEFAULT GLIBC_2.32 + +%ifdef HAVE_ARC_BE +ld=ld-linux-arceb.so.2 +%else +ld=ld-linux-arc.so.2 +%endif
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 12/13 build-many-glibcs.py: Enable ARC builds
In reply to Vineet Gupta--- scripts/build-many-glibcs.py | 10 ++++++++++ 1 file changed, 10 insertions(+)
scripts/build-many-glibcs.py +10 -0
@@ -162,6 +162,15 @@ class Context(object): 'cfg': ['--disable-multi-arch']}]) self.add_config(arch='aarch64_be', os_name='linux-gnu') + self.add_config(arch='arc', + os_name='linux-gnu', + gcc_cfg=['--disable-multilib', '--with-cpu=hs38']) + self.add_config(arch='arc', + os_name='linux-gnuhf', + gcc_cfg=['--disable-multilib', '--with-cpu=hs38_linux']) + self.add_config(arch='arceb', + os_name='linux-gnu', + gcc_cfg=['--disable-multilib', '--with-cpu=hs38']) self.add_config(arch='alpha', os_name='linux-gnu') self.add_config(arch='arm',
@@ -1221,6 +1230,7 @@ def install_linux_headers(policy, cmdlist): """Install Linux kernel headers.""" arch_map = {'aarch64': 'arm64', 'alpha': 'alpha', + 'arc': 'arc', 'arm': 'arm', 'csky': 'csky', 'hppa': 'parisc',
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 13/13 Documentation for ARC port
In reply to Vineet Gupta(a) ABI doc:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/wiki/files/ARCv2_ABI.pdf
(b) Programmer's Reference Manual (PRM) : needs a download request to be filled
https://www.synopsys.com/dw/ipdir.php?ds=arc-hs44-hs46-hs48 https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-HS.pdf
As of port merge (and Florian's patch to fix static TLS), glibc testsuite (cross-test setup) has following failures:
FAIL: elf/tst-audit14
FAIL: elf/tst-audit15
FAIL: elf/tst-audit16
FAIL: elf/tst-ldconfig-ld_so_conf-update
FAIL: elf/tst-libc_dlvsym
FAIL: elf/tst-libc_dlvsym-static
FAIL: iconv/test-iconvconfig # Needs gconv installed
FAIL: io/ftwtest # Requires execution by non-root
FAIL: io/tst-lockf
FAIL: libio/tst-wfile-sync
FAIL: locale/tst-localedef-path-norm
FAIL: nptl/test-cond-printers # needs Python3 and target GDB on target
FAIL: nptl/test-condattr-printers # ditto
FAIL: nptl/test-mutex-printers # ditto
FAIL: nptl/test-mutexattr-printers # ditto
FAIL: nptl/test-rwlock-printers # ditto
FAIL: nptl/test-rwlockattr-printers # ditto
FAIL: nptl/tst-umask1 # passes if run natively on target (NFS ACLv3 support needed)
FAIL: nss/bug-erange
FAIL: nss/tst-nss-files-hosts-getent
FAIL: nss/tst-nss-files-hosts-multi
FAIL: posix/bug-ga2
FAIL: posix/globtest # require same user on target and host
FAIL: posix/tst-getaddrinfo5
FAIL: stdio-common/tst-vfprintf-width-prec
FAIL: stdio-common/tst-vfprintf-width-prec-alloc
FAIL: stdio-common/tst-vfprintf-width-prec-mem
FAIL: string/tst-strerror
FAIL: string/tst-strsignal
FAIL: sunrpc/bug20790 # missing cpp on target
FAIL: timezone/tst-tzset
--- NEWS | 11 +++++++++++ README | 1 + manual/install.texi | 4 ++++ 3 files changed, 16 insertions(+)
NEWS +11 -0
@@ -15,6 +15,17 @@ Major new features: * New locale added: ckb_IQ (Kurdish/Sorani spoken in Iraq) +* Support for Synopsys ARC HS cores (ARCv2 ISA) running Linux has been + added. This port requires at least binutils-2.32, gcc-8.3 and Linux-5.1. + Three ABIs are supported: + + - arc-linux-gnu + - arc-linux-gnuhf + - arceb-linux-gnu + + The arc* ABI is little-endian while arceb is big-endian. All ABIs use + 64-bit time (y2038 safe) and 64-bit file offsets (LFS default). + * The GNU C Library now loads audit modules listed in the DT_AUDIT and DT_DEPAUDIT dynamic section entries of the main executable.
README +1 -0
@@ -24,6 +24,7 @@ The GNU C Library supports these configurations for using Linux kernels: aarch64*-*-linux-gnu alpha*-*-linux-gnu + arc*-*-linux-gnu arm-*-linux-gnueabi csky-*-linux-gnuabiv2 hppa-*-linux-gnu
manual/install.texi +4 -0
@@ -512,6 +512,8 @@ Library with support for IEEE long double. @c powerpc64le performs an autoconf test to verify the compiler compiles with @c commands like "$CC -c foo.c -mabi=ibmlongdouble -mlong-double-128". +For ARC architecture builds, GCC 8.3 or higher is needed. + For multi-arch support it is recommended to use a GCC which has been built with support for GNU indirect functions. This ensures that correct debugging information is generated for functions selected by IFUNC resolvers. This
@@ -537,6 +539,8 @@ For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required to support @option{--update-section}. This option requires binutils 2.26 or newer. +ARC architecture needs @code{binutils} 2.32 or higher for TLS related fixes. + @item GNU @code{texinfo} 4.7 or later
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc