diff options
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 1 | ||||
-rw-r--r-- | sysdeps/generic/machine-lock.h | 12 | ||||
-rw-r--r-- | sysdeps/generic/machine-sp.h | 4 | ||||
-rw-r--r-- | sysdeps/generic/not-cancel.h | 28 | ||||
-rw-r--r-- | sysdeps/generic/thread_state.h | 1 |
5 files changed, 44 insertions, 2 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index ffeb093887..694e6e7360 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -409,6 +409,7 @@ struct rtld_global size_t count; void *list[50]; } *_dl_scope_free_list; + EXTERN volatile int _dl_thread_gscope_count; #ifdef SHARED }; # define __rtld_global_attribute__ diff --git a/sysdeps/generic/machine-lock.h b/sysdeps/generic/machine-lock.h index 5b9b2145e6..9a30226aba 100644 --- a/sysdeps/generic/machine-lock.h +++ b/sysdeps/generic/machine-lock.h @@ -34,14 +34,21 @@ typedef volatile int __spin_lock_t; /* Unlock LOCK. */ +void __spin_unlock (__spin_lock_t *__lock); + +#ifdef __USE_EXTERN_INLINES _EXTERN_INLINE void __spin_unlock (__spin_lock_t *__lock) { *__lock = 0; } +#endif /* Try to lock LOCK; return nonzero if we locked it, zero if another has. */ +int __spin_try_lock (__spin_lock_t *__lock); + +#ifdef __USE_EXTERN_INLINES _EXTERN_INLINE int __spin_try_lock (__spin_lock_t *__lock) { @@ -50,14 +57,19 @@ __spin_try_lock (__spin_lock_t *__lock) *__lock = 1; return 1; } +#endif /* Return nonzero if LOCK is locked. */ +int __spin_lock_locked (__spin_lock_t *__lock); + +#ifdef __USE_EXTERN_INLINES _EXTERN_INLINE int __spin_lock_locked (__spin_lock_t *__lock) { return *__lock != 0; } +#endif #endif /* machine-lock.h */ diff --git a/sysdeps/generic/machine-sp.h b/sysdeps/generic/machine-sp.h index cc48eac674..e76d382fc4 100644 --- a/sysdeps/generic/machine-sp.h +++ b/sysdeps/generic/machine-sp.h @@ -25,11 +25,15 @@ #define _EXTERN_INLINE __extern_inline #endif +void * __thread_stack_pointer (void); + +#ifdef __USE_EXTERN_INLINES _EXTERN_INLINE void * __thread_stack_pointer (void) { register void *__sp__ ("{STACK-POINTER}"); return __sp__; } +#endif #endif /* machine-sp.h */ diff --git a/sysdeps/generic/not-cancel.h b/sysdeps/generic/not-cancel.h index cc1d606289..062fe17a0a 100644 --- a/sysdeps/generic/not-cancel.h +++ b/sysdeps/generic/not-cancel.h @@ -18,10 +18,22 @@ <http://www.gnu.org/licenses/>. */ /* By default we have none. Map the name to the normal functions. */ -#define open_not_cancel(name, flags, mode) \ + +/* Uncancelable open. */ +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +# define open_not_cancel(name, flags, mode) \ __libc_open (name, flags, mode) -#define open_not_cancel_2(name, flags) \ +# define open_not_cancel_2(name, flags) \ __libc_open (name, flags) +#else +/* In this case, we can't use the libc_* internal functions. */ +# define open_not_cancel(name, flags, mode) \ + __open (name, flags, mode) +# define open_not_cancel_2(name, flags) \ + __open (name, flags) +#endif + +/* Uncancelable openat. */ #define openat_not_cancel(fd, name, flags, mode) \ __openat (fd, name, flags, mode) #define openat_not_cancel_3(fd, name, flags) \ @@ -30,18 +42,30 @@ __openat64 (fd, name, flags, mode) #define openat64_not_cancel_3(fd, name, flags) \ __openat64 (fd, name, flags, 0) + +/* Uncancelable close. */ #define close_not_cancel(fd) \ __close (fd) #define close_not_cancel_no_status(fd) \ (void) __close (fd) + +/* Uncancelable read. */ #define read_not_cancel(fd, buf, n) \ __read (fd, buf, n) + +/* Uncancelable write. */ #define write_not_cancel(fd, buf, n) \ __write (fd, buf, n) + +/* Uncancelable writev. */ #define writev_not_cancel_no_status(fd, iov, n) \ (void) __writev (fd, iov, n) + +/* Uncancelable fcntl. */ #define fcntl_not_cancel(fd, cmd, val) \ __fcntl (fd, cmd, val) + +/* Uncancelable waitpid. */ # define waitpid_not_cancel(pid, stat_loc, options) \ __waitpid (pid, stat_loc, options) #define pause_not_cancel() \ diff --git a/sysdeps/generic/thread_state.h b/sysdeps/generic/thread_state.h index 28d6c9a895..e0a0b2774a 100644 --- a/sysdeps/generic/thread_state.h +++ b/sysdeps/generic/thread_state.h @@ -22,6 +22,7 @@ /* Replace <machine> with "i386" or "mips" or whatever. */ +#define MACHINE_NEW_THREAD_STATE_FLAVOR <machine>_NEW_THREAD_STATE #define MACHINE_THREAD_STATE_FLAVOR <machine>_THREAD_STATE #define MACHINE_THREAD_STATE_COUNT <machine>_THREAD_STATE_COUNT |