66f7aeb3efe53816ffaa449f3969cd94d4cfe3d6
[openwrt/staging/stintel.git] / toolchain / glibc / patches / 300-arc.patch
1 --- a/sysdeps/arc/atomic-machine.h
2 +++ b/sysdeps/arc/atomic-machine.h
3 @@ -64,6 +64,10 @@ typedef uintmax_t uatomic_max_t;
4 __atomic_val_bysize (__arch_compare_and_exchange_val, int, \
5 mem, new, old, __ATOMIC_ACQUIRE)
6
7 +#ifdef __ARC700__
8 +#define atomic_full_barrier() ({ asm volatile ("sync":::"memory"); })
9 +#else
10 #define atomic_full_barrier() ({ asm volatile ("dmb 3":::"memory"); })
11 +#endif
12
13 #endif /* _ARC_BITS_ATOMIC_H */
14 --- a/sysdeps/unix/sysv/linux/arc/syscall.S
15 +++ b/sysdeps/unix/sysv/linux/arc/syscall.S
16 @@ -24,8 +24,13 @@ ENTRY (syscall)
17 mov_s r1, r2
18 mov_s r2, r3
19 mov_s r3, r4
20 +#ifdef __ARC700__
21 + mov r4, r5
22 + mov r5, r6
23 +#else
24 mov_s r4, r5
25 mov_s r5, r6
26 +#endif
27
28 ARC_TRAP_INSN
29 brhi r0, -4096, L (call_syscall_err)
30 --- a/sysdeps/unix/sysv/linux/arc/sysdep.h
31 +++ b/sysdeps/unix/sysv/linux/arc/sysdep.h
32 @@ -128,7 +128,11 @@ L (call_syscall_err): ASM_LINE_SEP \
33 mov r8, __NR_##syscall_name ASM_LINE_SEP \
34 ARC_TRAP_INSN ASM_LINE_SEP
35
36 +# ifdef __ARC700__
37 +# define ARC_TRAP_INSN trap0
38 +# else
39 # define ARC_TRAP_INSN trap_s 0
40 +# endif
41
42 #else /* !__ASSEMBLER__ */
43
44 @@ -139,7 +143,11 @@ extern long int __syscall_error (long in
45 hidden_proto (__syscall_error)
46 # endif
47
48 +# ifdef __ARC700__
49 +# define ARC_TRAP_INSN "trap0 \n\t"
50 +# else
51 # define ARC_TRAP_INSN "trap_s 0 \n\t"
52 +#endif
53
54 # undef INTERNAL_SYSCALL_NCS
55 # define INTERNAL_SYSCALL_NCS(number, nr_args, args...) \