Adding upstream version 1.65.7.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
5189956325
commit
32b8eb3fd7
4153 changed files with 2487292 additions and 0 deletions
164
internal/overlay/musl/arch/i386/atomic_arch.h
Normal file
164
internal/overlay/musl/arch/i386/atomic_arch.h
Normal file
|
@ -0,0 +1,164 @@
|
|||
#define a_cas a_cas
|
||||
static inline int a_cas(volatile int *p, int t, int s)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__ (
|
||||
"lock ; cmpxchg %3, %1"
|
||||
: "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
|
||||
return t;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_swap a_swap
|
||||
static inline int a_swap(volatile int *p, int v)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"xchg %0, %1"
|
||||
: "=r"(v), "=m"(*p) : "0"(v) : "memory" );
|
||||
return v;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_fetch_add a_fetch_add
|
||||
static inline int a_fetch_add(volatile int *p, int v)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"lock ; xadd %0, %1"
|
||||
: "=r"(v), "=m"(*p) : "0"(v) : "memory" );
|
||||
return v;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_and a_and
|
||||
static inline void a_and(volatile int *p, int v)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"lock ; and %1, %0"
|
||||
: "=m"(*p) : "r"(v) : "memory" );
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_or a_or
|
||||
static inline void a_or(volatile int *p, int v)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"lock ; or %1, %0"
|
||||
: "=m"(*p) : "r"(v) : "memory" );
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_inc a_inc
|
||||
static inline void a_inc(volatile int *p)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"lock ; incl %0"
|
||||
: "=m"(*p) : "m"(*p) : "memory" );
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_dec a_dec
|
||||
static inline void a_dec(volatile int *p)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"lock ; decl %0"
|
||||
: "=m"(*p) : "m"(*p) : "memory" );
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_store a_store
|
||||
static inline void a_store(volatile int *p, int x)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"mov %1, %0 ; lock ; orl $0,(%%esp)"
|
||||
: "=m"(*p) : "r"(x) : "memory" );
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_barrier a_barrier
|
||||
static inline void a_barrier()
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__( "" : : : "memory" );
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_spin a_spin
|
||||
static inline void a_spin()
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__( "pause" : : : "memory" );
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_crash a_crash
|
||||
static inline void a_crash()
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__ __volatile__( "hlt" : : : "memory" );
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_ctz_64 a_ctz_64
|
||||
static inline int a_ctz_64(uint64_t x)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
int r;
|
||||
__asm__( "bsf %1,%0 ; jnz 1f ; bsf %2,%0 ; add $32,%0\n1:"
|
||||
: "=&r"(r) : "r"((unsigned)x), "r"((unsigned)(x>>32)) );
|
||||
return r;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_ctz_32 a_ctz_32
|
||||
static inline int a_ctz_32(uint32_t x)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
int r;
|
||||
__asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
|
||||
return r;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define a_clz_32 a_clz_32
|
||||
static inline int a_clz_32(uint32_t x)
|
||||
#ifndef __CCGO__
|
||||
{
|
||||
__asm__( "bsr %1,%0 ; xor $31,%0" : "=r"(x) : "r"(x) );
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
43
internal/overlay/musl/arch/i386/bits/float.h
Normal file
43
internal/overlay/musl/arch/i386/bits/float.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
#ifndef __CCGO__
|
||||
|
||||
#ifdef __FLT_EVAL_METHOD__
|
||||
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
#else
|
||||
#define FLT_EVAL_METHOD 2
|
||||
#endif
|
||||
|
||||
#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
|
||||
#define LDBL_MIN 3.3621031431120935063e-4932L
|
||||
#define LDBL_MAX 1.1897314953572317650e+4932L
|
||||
#define LDBL_EPSILON 1.0842021724855044340e-19L
|
||||
|
||||
#define LDBL_MANT_DIG 64
|
||||
#define LDBL_MIN_EXP (-16381)
|
||||
#define LDBL_MAX_EXP 16384
|
||||
|
||||
#define LDBL_DIG 18
|
||||
#define LDBL_MIN_10_EXP (-4931)
|
||||
#define LDBL_MAX_10_EXP 4932
|
||||
|
||||
#define DECIMAL_DIG 21
|
||||
|
||||
#else // __CCGO__
|
||||
|
||||
#define FLT_EVAL_METHOD 0
|
||||
|
||||
#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
|
||||
#define LDBL_MIN 2.22507385850720138309e-308L
|
||||
#define LDBL_MAX 1.79769313486231570815e+308L
|
||||
#define LDBL_EPSILON 2.22044604925031308085e-16L
|
||||
|
||||
#define LDBL_MANT_DIG 53
|
||||
#define LDBL_MIN_EXP (-1021)
|
||||
#define LDBL_MAX_EXP 1024
|
||||
|
||||
#define LDBL_DIG 15
|
||||
#define LDBL_MIN_10_EXP (-307)
|
||||
#define LDBL_MAX_10_EXP 308
|
||||
|
||||
#define DECIMAL_DIG 17
|
||||
|
||||
#endif // __CCGO__
|
12
internal/overlay/musl/arch/i386/pthread_arch.h
Normal file
12
internal/overlay/musl/arch/i386/pthread_arch.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
static inline uintptr_t __get_tp();
|
||||
|
||||
#ifndef __CCGO__
|
||||
static inline uintptr_t __get_tp()
|
||||
{
|
||||
uintptr_t tp;
|
||||
__asm__ ("movl %%gs:0,%0" : "=r" (tp) );
|
||||
return tp;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define MC_PC gregs[REG_EIP]
|
106
internal/overlay/musl/arch/i386/syscall_arch.h
Normal file
106
internal/overlay/musl/arch/i386/syscall_arch.h
Normal file
|
@ -0,0 +1,106 @@
|
|||
#ifdef __CCGO__
|
||||
|
||||
static __inline long __syscall0(long n);
|
||||
static __inline long __syscall1(long n, long a1);
|
||||
static __inline long __syscall2(long n, long a1, long a2);
|
||||
static __inline long __syscall3(long n, long a1, long a2, long a3);
|
||||
static __inline long __syscall4(long n, long a1, long a2, long a3, long a4);
|
||||
static __inline long __syscall5(long n, long a1, long a2, long a3, long a4, long a5);
|
||||
static __inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6);
|
||||
|
||||
#define __SYSCALL_LL_E(x) ((int)(x)), ((int)((x)>>32))
|
||||
#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
|
||||
|
||||
#else // __CCGO__
|
||||
|
||||
#define __SYSCALL_LL_E(x) \
|
||||
((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
|
||||
((union { long long ll; long l[2]; }){ .ll = x }).l[1]
|
||||
#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
|
||||
|
||||
#if SYSCALL_NO_TLS
|
||||
#define SYSCALL_INSNS "int $128"
|
||||
#else
|
||||
#define SYSCALL_INSNS "call *%%gs:16"
|
||||
#endif
|
||||
|
||||
#define SYSCALL_INSNS_12 "xchg %%ebx,%%edx ; " SYSCALL_INSNS " ; xchg %%ebx,%%edx"
|
||||
#define SYSCALL_INSNS_34 "xchg %%ebx,%%edi ; " SYSCALL_INSNS " ; xchg %%ebx,%%edi"
|
||||
|
||||
static inline long __syscall0(long n)
|
||||
{
|
||||
unsigned long __ret;
|
||||
__asm__ __volatile__ (SYSCALL_INSNS : "=a"(__ret) : "a"(n) : "memory");
|
||||
return __ret;
|
||||
}
|
||||
|
||||
static inline long __syscall1(long n, long a1)
|
||||
{
|
||||
unsigned long __ret;
|
||||
__asm__ __volatile__ (SYSCALL_INSNS_12 : "=a"(__ret) : "a"(n), "d"(a1) : "memory");
|
||||
return __ret;
|
||||
}
|
||||
|
||||
static inline long __syscall2(long n, long a1, long a2)
|
||||
{
|
||||
unsigned long __ret;
|
||||
__asm__ __volatile__ (SYSCALL_INSNS_12 : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2) : "memory");
|
||||
return __ret;
|
||||
}
|
||||
|
||||
static inline long __syscall3(long n, long a1, long a2, long a3)
|
||||
{
|
||||
unsigned long __ret;
|
||||
#if !defined(__PIC__) || !defined(BROKEN_EBX_ASM)
|
||||
__asm__ __volatile__ (SYSCALL_INSNS : "=a"(__ret) : "a"(n), "b"(a1), "c"(a2), "d"(a3) : "memory");
|
||||
#else
|
||||
__asm__ __volatile__ (SYSCALL_INSNS_34 : "=a"(__ret) : "a"(n), "D"(a1), "c"(a2), "d"(a3) : "memory");
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
|
||||
static inline long __syscall4(long n, long a1, long a2, long a3, long a4)
|
||||
{
|
||||
unsigned long __ret;
|
||||
#if !defined(__PIC__) || !defined(BROKEN_EBX_ASM)
|
||||
__asm__ __volatile__ (SYSCALL_INSNS : "=a"(__ret) : "a"(n), "b"(a1), "c"(a2), "d"(a3), "S"(a4) : "memory");
|
||||
#else
|
||||
__asm__ __volatile__ (SYSCALL_INSNS_34 : "=a"(__ret) : "a"(n), "D"(a1), "c"(a2), "d"(a3), "S"(a4) : "memory");
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
|
||||
static inline long __syscall5(long n, long a1, long a2, long a3, long a4, long a5)
|
||||
{
|
||||
unsigned long __ret;
|
||||
#if !defined(__PIC__) || !defined(BROKEN_EBX_ASM)
|
||||
__asm__ __volatile__ (SYSCALL_INSNS
|
||||
: "=a"(__ret) : "a"(n), "b"(a1), "c"(a2), "d"(a3), "S"(a4), "D"(a5) : "memory");
|
||||
#else
|
||||
__asm__ __volatile__ ("pushl %2 ; push %%ebx ; mov 4(%%esp),%%ebx ; " SYSCALL_INSNS " ; pop %%ebx ; add $4,%%esp"
|
||||
: "=a"(__ret) : "a"(n), "g"(a1), "c"(a2), "d"(a3), "S"(a4), "D"(a5) : "memory");
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
|
||||
static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6)
|
||||
{
|
||||
unsigned long __ret;
|
||||
#if !defined(__PIC__) || !defined(BROKEN_EBX_ASM)
|
||||
__asm__ __volatile__ ("pushl %7 ; push %%ebp ; mov 4(%%esp),%%ebp ; " SYSCALL_INSNS " ; pop %%ebp ; add $4,%%esp"
|
||||
: "=a"(__ret) : "a"(n), "b"(a1), "c"(a2), "d"(a3), "S"(a4), "D"(a5), "g"(a6) : "memory");
|
||||
#else
|
||||
unsigned long a1a6[2] = { a1, a6 };
|
||||
__asm__ __volatile__ ("pushl %1 ; push %%ebx ; push %%ebp ; mov 8(%%esp),%%ebx ; mov 4(%%ebx),%%ebp ; mov (%%ebx),%%ebx ; " SYSCALL_INSNS " ; pop %%ebp ; pop %%ebx ; add $4,%%esp"
|
||||
: "=a"(__ret) : "g"(&a1a6), "a"(n), "c"(a2), "d"(a3), "S"(a4), "D"(a5) : "memory");
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
|
||||
#define VDSO_USEFUL
|
||||
#define VDSO_CGT32_SYM "__vdso_clock_gettime"
|
||||
#define VDSO_CGT32_VER "LINUX_2.6"
|
||||
#define VDSO_CGT_SYM "__vdso_clock_gettime64"
|
||||
#define VDSO_CGT_VER "LINUX_2.6"
|
||||
|
||||
#endif // __CCGO__
|
Loading…
Add table
Add a link
Reference in a new issue