#define SYS_RECVMSG 17
#endif
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
#include <sysdep-cancel.h>
#include <pthreadP.h>
#else
args[0] = s;
args[1] = (unsigned long) addr;
args[2] = (unsigned long) addrlen;
-
+
if (SINGLE_THREAD_P)
return __socketcall(SYS_ACCEPT, args);
int result = __socketcall(SYS_ACCEPT, args);
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
-
+#endif
+
}
#endif
weak_alias(__libc_accept,accept)
args[1] = (unsigned long) saddr;
args[2] = addrlen;
-if (SINGLE_THREAD_P)
- return __socketcall(SYS_CONNECT, args);
-
+ if (SINGLE_THREAD_P)
+ return __socketcall(SYS_CONNECT, args);
+
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __socketcall(SYS_CONNECT, args);
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
#endif
weak_alias(__libc_connect,connect)
args[1] = (unsigned long) buffer;
args[2] = len;
args[3] = flags;
-
+
if (SINGLE_THREAD_P)
return (__socketcall(SYS_RECV, args));
-
+
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __socketcall(SYS_RECV, args);
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
#elif defined(__NR_recvfrom)
ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags)
args[4] = (unsigned long) to;
args[5] = (unsigned long) tolen;
-if (SINGLE_THREAD_P)
- return (__socketcall(SYS_RECVFROM, args));
-
+ if (SINGLE_THREAD_P)
+ return (__socketcall(SYS_RECVFROM, args));
+
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __socketcall(SYS_RECVFROM, args);
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
#endif
weak_alias(__libc_recvfrom,recvfrom)
args[0] = sockfd;
args[1] = (unsigned long) msg;
args[2] = flags;
-
-if (SINGLE_THREAD_P)
- return (__socketcall(SYS_RECVMSG, args));
-
+
+ if (SINGLE_THREAD_P)
+ return (__socketcall(SYS_RECVMSG, args));
+
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __socketcall(SYS_RECVMSG, args);
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
#endif
weak_alias(__libc_recvmsg,recvmsg)
args[1] = (unsigned long) buffer;
args[2] = len;
args[3] = flags;
-
-if (SINGLE_THREAD_P)
- return (__socketcall(SYS_SEND, args));
-
+
+ if (SINGLE_THREAD_P)
+ return (__socketcall(SYS_SEND, args));
+
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __socketcall(SYS_SEND, args);
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
#elif defined(__NR_sendto)
ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags)
args[0] = sockfd;
args[1] = (unsigned long) msg;
args[2] = flags;
-
-if (SINGLE_THREAD_P)
- return (__socketcall(SYS_SENDMSG, args));
-
+
+ if (SINGLE_THREAD_P)
+ return (__socketcall(SYS_SENDMSG, args));
+
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __socketcall(SYS_SENDMSG, args);
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
#endif
weak_alias(__libc_sendmsg,sendmsg)
args[3] = flags;
args[4] = (unsigned long) to;
args[5] = tolen;
-
-if (SINGLE_THREAD_P)
- return (__socketcall(SYS_SENDTO, args));
-
+
+ if (SINGLE_THREAD_P)
+ return (__socketcall(SYS_SENDTO, args));
+
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __socketcall(SYS_SENDTO, args);
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
#endif
weak_alias(__libc_sendto,sendto)
/*
* Needed to initialize _dl_phdr when statically linked
*/
-
+
void internal_function _dl_aux_init (ElfW(auxv_t) *av);
#endif /* !SHARED */
static __thread void *data __attribute__ ((tls_model ("initial-exec")));
return &data;
}
-
libc_hidden_proto(sigaction)
libc_hidden_proto(waitpid)
-
+
#if defined __ia64__
# define FORK() \
INLINE_SYSCALL (clone2, 6, CLONE_PARENT_SETTID | SIGCHLD, NULL, 0, \
splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \
sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c,$(CSRC))
endif
-
+
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
CSRC := $(filter-out fork.c getpid.c raise.c open.c close.c read.c write.c, $(CSRC))
ifneq ($(TARGET_ARCH),arm)
libc_hidden_proto(sigwaitinfo)
weak_alias (__sigwaitinfo, sigwaitinfo)
libc_hidden_weak(sigwaitinfo)
-
#include <bits/wordsize.h>
extern __typeof(fcntl) __libc_fcntl;
-libc_hidden_proto(__libc_fcntl)
+libc_hidden_proto(__libc_fcntl)
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
int __fcntl_nocancel (int fd, int cmd, ...)
-{
+{
va_list ap;
void *arg;
#include <sys/syscall.h>
#include <time.h>
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
#include <sysdep-cancel.h>
#include <pthreadP.h>
#else
#include <sysdep-cancel.h>
#else
#define SINGLE_THREAD_P 1
-#endif
+#endif
libc_hidden_proto(poll)
#endif
.end __thread_start
weak_alias(clone, __clone)
-
-/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2002, 2003
+/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
RAOFF= FRAMESZ-(1*SZREG)
GPOFF= FRAMESZ-(2*SZREG)
V0OFF= FRAMESZ-(3*SZREG)
-
+
ENTRY(__syscall_error)
#ifdef __PIC__
.set noat
SETUP_GPX (AT)
#endif
SETUP_GPX64 (t9, AT)
-
+
/* Store it in errno... */
sw v0, errno
#define __arch_bit_set_32_int(mem, value) \
__arch_operate_new_n(mem, 1<<(value), l, or)
-
+
#define __arch_bit_set_64_int(mem, value) \
(abort (), 0)
not r1, r1 // r1=0 means r0 = -1 to -4095
tst r1, r1 // i.e. error in linux
bf .Lclone_end
-.Lsyscall_error:
+.Lsyscall_error:
SYSCALL_ERROR_HANDLER
.Lclone_end:
tst r0, r0
stc gbr, r1
mov.w .Lpidoff, r2
add r1, r2
- mov.l r0, @r2
+ mov.l r0, @r2
mov.w .Ltidoff, r2
add r1, r2
- mov.l r0, @r2
+ mov.l r0, @r2
4:
#endif
/* thread starts */
size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
-{
+{
if (SINGLE_THREAD_P)
return(__syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset)));
ssize_t result = __syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset));
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
weak_alias(__libc_pread,pread)
# ifdef __UCLIBC_HAS_LFS__
extern __typeof(pread64) __libc_pread64;
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
-{
+{
uint32_t low = offset & 0xffffffff;
uint32_t high = offset >> 32;
ssize_t result = __syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR (high, low));
LIBC_CANCEL_RESET (oldtype);
return result;
-#endif
+#endif
}
weak_alias(__libc_pread64,pread64)
# endif /* __UCLIBC_HAS_LFS__ */
size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
-{
+{
if (SINGLE_THREAD_P)
return __syscall_pwrite(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset));
# ifdef __UCLIBC_HAS_LFS__
extern __typeof(pwrite64) __libc_pwrite64;
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
-{
+{
uint32_t low = offset & 0xffffffff;
uint32_t high = offset >> 32;
mov.l r9, @-r4
mov.l r8, @-r4
-#ifdef __HAVE_SHARED__
+#ifdef __HAVE_SHARED__
mov.l .LG, r2
mova .LG, r0
add r0, r2
/* Call errno_location, store '-r4' in errno and return -1 */
mov.l r12, @-r15
sts.l pr, @-r15
-#ifdef SHARED
+#ifdef SHARED
mova .LG, r0
mov.l .LG, r12
add r0, r12
extern void *__tls_get_addr (tls_index *ti);
-
/* We use the normal longjmp for unwinding. */
#define __libc_unwind_longjmp(buf, val) longjmp (buf, val)
-
mov r0, #0
PSEUDO_RET_NOERRNO
END (pthread_spin_lock)
-
movne r0, #EBUSY
PSEUDO_RET_NOERRNO
END (pthread_spin_trylock)
-
/* XXX Until we have a better place keep the definitions here. */
#define __exit_thread_inline(val) \
INLINE_SYSCALL (exit, 1, (val))
-
#endif
#endif /* __ASSEMBLER__ */
-
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
PID_OFFSET thread_offsetof (pid)
TID_OFFSET thread_offsetof (tid)
-
#endif /* __ASSEMBLER__ */
#endif /* tls.h */
-
* not be inlined as much as possible.
*/
-
+
void
internal_function __attribute_noinline__
_dl_allocate_static_tls (struct link_map *map)
#include <sys/fpregdef.h>
#endif /* _REGDEF_H */
-
set of thread-specific `void *' data used only internally by libc.
__libc_tsd_define(CLASS, KEY) -- Define or declare a `void *' datum
- for KEY. CLASS can be `static' for
+ for KEY. CLASS can be `static' for
keys used in only one source file,
empty for global definitions, or
`extern' for global declarations.
__libc_tsd_address(KEY) -- Return the `void **' pointing to
- the current thread's datum for KEY.
+ the current thread's datum for KEY.
__libc_tsd_get(KEY) -- Return the `void *' datum for KEY.
__libc_tsd_set(KEY, VALUE) -- Set the datum for KEY to VALUE.
#else
#include "sparc32/jmpbuf-unwind.h"
#endif
-
#else
#include "sparc32/pthreaddef.h"
#endif
-
register-atfork.c unregister-atfork.c getpid.c \
raise.c sleep.c jmp-unwind.c
-# These provide both a cancellable and a not cancellable implementation
+# These provide both a cancellable and a not cancellable implementation
libc_SSRC = close.S open.S write.S read.S
ifneq ($(TARGET_ARCH),arm)
ifeq ($(TARGET_ARCH),powerpc)
libpthread_CSRC += lowlevellock.c
libc_CSRC += libc-lowlevellock.c
-librt_CSRC := mq_notify.c
+librt_CSRC := mq_notify.c
endif
ifeq ($(TARGET_ARCH),sparc)
ifeq ($(TARGET_ARCH),x86_64)
-librt_CSRC := mq_notify.c
+librt_CSRC := mq_notify.c
endif
CFLAGS-pthread_getcpuclockid.c = -I$(top_srcdir)librt
$(ALL_HEADERS_BITS_PTHREAD):
$(do_ln) ../../$(PTHREAD_LINUX_DIR)/bits/$(@F) $(top_builddir)$@
-
+
nptl_linux_headers_clean:
$(do_rm) $(addprefix $(PTHREAD_LINUX_OUT)/lowlevelbarrier., c h s) \
$(addprefix $(PTHREAD_LINUX_OUT)/lowlevelcond., c h s) \
({ __arm_link_error (); oldval; })
#endif /* __thumb__ */
-
#endif /* bits/pthreadtypes.h */
-
char __size[__SIZEOF_SEM_T];
long int __align;
} sem_t;
-
/* Get the real implementation. */
#include <sysdeps/pthread/createthread.c>
-
NULL, NULL, NULL, &THREAD_SELF->tid)
#include "../fork.c"
-
__lll_cond_broadcast (cond)
#endif /* lowlevellock.h */
-
strne r3, [r2, #PID_OFFSET] /* ... restore the saved PID. */
#INCLUDE <../../../../../../../LIBC/SYSDEPS/LINUX/ARM/VFORK.S>
-
const void *include_pthread_setspecific attribute_hidden = pthread_setspecific;
const void *include_pthread_key_create attribute_hidden = pthread_key_create;
#endif
-
# define NO_CANCELLATION 1
#endif
-
The compiler is going to form a call by coming here, through PSEUDO, with
arguments
- syscall number in the DO_CALL macro
- arg 1 r0
- arg 2 r1
- arg 3 r2
- arg 4 r3
- arg 5 [sp]
+ syscall number in the DO_CALL macro
+ arg 1 r0
+ arg 2 r1
+ arg 3 r2
+ arg 4 r3
+ arg 5 [sp]
arg 6 [sp+4]
arg 7 [sp+8]
#endif /* __ASSEMBLER__ */
#endif /* linux/arm/sysdep.h */
-
pthread_cancel_init ();
return libgcc_s_getcfa (context);
}
-
init ();
return libgcc_s_personality (state, ue_header, context);
}
-
#endif
#endif /* defined UNWIND_ARM_H */
-
strne r3, [r2, #PID_OFFSET] /* ... restore the saved PID. */
#include "../../../../../../../libc/sysdeps/linux/arm/vfork.S"
-
LINUX_ARCH_OUT:=$(top_builddir)libpthread/nptl/sysdeps/unix/sysv/linux/i386
-libpthread_SSRC = pt-vfork.S clone.S pthread_spin_unlock.S pthread_once.S
+libpthread_SSRC = pt-vfork.S clone.S pthread_spin_unlock.S pthread_once.S
libpthread_CSRC = pthread_spin_init.c pt-__syscall_error.c
libc_a_CSRC = fork.c
hlt
.LENDCODE:
.size __condvar_tw_cleanup, .-__condvar_tw_cleanup
-
hlt
.LENDCODE:
.size __condvar_w_cleanup, .-__condvar_w_cleanup
-
/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007
- Free Software Foundation, Inc.
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
trapa #0x14
SYSCALL_INST_PAD
-1:
+1:
rts
nop
.size lll_unlock_wake_cb,.-lll_unlock_wake_cb
# define waitpid_not_cancel(pid, stat_loc, options) \
INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
#endif
-
bra 7b
mov r9, r6
-9:
+9:
mov r6, r9
mov r8, r4
mov.l .Lwake2, r1
.long __lll_mutex_unlock_wake-.Lmwake4b
.size __pthread_cond_signal, .-__pthread_cond_signal
weak_alias (__pthread_cond_signal, pthread_cond_signal)
-
bt 17f
mov.l r9, @(dep_mutex,r8)
-17:
+17:
/* Unlock the mutex. */
mov.l .Lmunlock1, r1
mov #0, r5
mov.l @(cond_nwaiters,r8), r0
add r2, r0
mov.l r0, @(cond_nwaiters,r8)
-
+
/* Get and store current wakeup_seq value. */
mov.l @(wakeup_seq,r8), r10
mov.l @(wakeup_seq+4,r8), r11
mov.l @(broadcast_seq,r8), r0
mov.l r0, @(4,r15)
-8:
+8:
/* Get current time. */
#ifdef __NR_clock_gettime
/* Get the clock number. */
.word __NR_clock_gettime
# ifndef __ASSUME_POSIX_TIMERS
-19:
+19:
mov r15, r4
add #16, r4
mov #0, r5
mov.l @(16,r15), r0
sts macl, r1
#endif
-0:
+0:
#else
mov r15, r4
add #16, r4
extu.b r3, r3
trapa #0x14
SYSCALL_INST_PAD
-
-25:
+
+25:
#if cond_lock != 0
DEC (@(cond_lock,r8), r2)
#else
bf 18f
mov.l @(24,r15), r0
-18:
+18:
add #64, r15
lds.l @r15+, pr
mov.l @r15+, r13
.long _GLOBAL_OFFSET_TABLE_
#endif
-2:
+2:
/* Store the reference to the mutex. If there is already a
different value in there this is a bad user bug. */
mov.l @(dep_mutex,r8),r0
bt 15f
mov.l r9, @(dep_mutex,r8)
-15:
+15:
/* Unlock the mutex. */
mov.l .Lmunlock0, r1
mov #0, r5
mov.l .Ldisable0, r1
bsrf r1
mov.l @r15, r4
-.Ldisable0b:
+.Ldisable0b:
.LcleanupEND:
/* Lock. */
add r12, r2
#endif
mov.l @r2, r3
- or r3, r0
+ or r3, r0
or #1, r0
mov r0, r3
mov r1, r5
.Lgot:
.long _GLOBAL_OFFSET_TABLE_
#ifdef PIC
-.Lfgen:
+.Lfgen:
.long __fork_generation@GOTOFF
#else
-.Lfgen:
+.Lfgen:
.long __fork_generation
#endif
.Ltidoff:
.word TID - TLS_PRE_TCB_SIZE
-
+
6:
mov r8, r4
#if MUTEX != 0
mov.l @r15+, r4
.align 2
-.Lwait8:
+.Lwait8:
.long __lll_mutex_lock_wait-.Lwait8b
.Lwake8:
.long __lll_mutex_unlock_wake-.Lwake8b
mov r10, r4
bsrf r1
mov r0, r10
-.Ldisable0b:
+.Ldisable0b:
mov r10, r0
tst r0, r0
mov r10, r4
bsrf r1
mov r0, r10
-.Ldisable0b:
+.Ldisable0b:
mov r10, r0
tst r0, r0
"je 0f\n\t" \
"lock; cmpxchgl %0, %2\n\t" \
"jnz 1f\n\t" \
- "jmp 2f\n" \
+ "jmp 2f\n" \
"0:\tcmpxchgl %0, %2\n\t" \
"jnz 1f\n\t" \
".subsection 1\n" \
"je 0f\n\t" \
"lock; decl %0\n\t" \
"jne 1f\n\t" \
- "jmp 2f\n" \
+ "jmp 2f\n" \
"0:\tdecl %0\n\t" \
"jne 1f\n\t" \
".subsection 1\n" \
{
err = ps_pdread (ta->ph, howto,
&ta->ta_howto_data.const_thread_area,
- sizeof ta->ta_howto_data.const_thread_area);
+ sizeof ta->ta_howto_data.const_thread_area);
if (err != PS_OK)
return TD_ERR;
ta->ta_howto = ta_howto_const_thread_area;
if ((st.st_mode & mask) != 0)
{
printf ("mask not successful after %s: %x still set\n",
- fcts[i].name, (unsigned int) (st.st_mode & mask));
+ fcts[i].name, (unsigned int) (st.st_mode & mask));
result = 1;
}
}
modid);
result = 1;
}
-#else
+#else
if (modid == -1)
modid = ((struct link_map *) h)->l_tls_modid;
else if (((struct link_map *) h)->l_tls_modid != modid)