diff options
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S | 72 |
1 files changed, 27 insertions, 45 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S index 3d694d8376..02af56b4c7 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004 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 @@ -18,13 +18,11 @@ #include <unwindbuf.h> #include <sysdep.h> -#include <kernel-features.h> #include "lowlevel-atomic.h" -#define SYS_futex 240 -#define FUTEX_WAIT 0 -#define FUTEX_WAKE 1 -#define FUTEX_PRIVATE_FLAG 128 +#define SYS_futex 240 +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 .comm __fork_generation, 4, 4 @@ -97,19 +95,7 @@ __pthread_once: bf 3f /* Different for generation -> run initializer. */ /* Somebody else got here first. Wait. */ -#if __ASSUME_PRIVATE_FUTEX - mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAIT), r5 - extu.b r5, r5 -#else - stc gbr, r1 - mov.w .Lpfoff, r2 - add r2, r1 - mov.l @r1, r5 -# if FUTEX_WAIT != 0 - mov #FUTEX_WAIT, r0 - or r0, r5 -# endif -#endif + mov #FUTEX_WAIT, r5 mov r3, r6 mov #0, r7 mov #SYS_futex, r3 @@ -171,17 +157,7 @@ __pthread_once: INC (@r9, r2) /* Wake up all other threads. */ mov r9, r4 -#if __ASSUME_PRIVATE_FUTEX - mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAKE), r5 - extu.b r5, r5 -#else - stc gbr, r1 - mov.w .Lpfoff, r2 - add r2, r1 - mov.l @r1, r5 - mov #FUTEX_WAKE, r0 - or r0, r5 -#endif + mov #FUTEX_WAKE, r5 mov #-1, r6 shlr r6 /* r6 = 0x7fffffff */ mov #0, r7 @@ -216,17 +192,7 @@ __pthread_once: mov #0, r7 mov.l r7, @r9 mov r9, r4 -#if __ASSUME_PRIVATE_FUTEX - mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAKE), r5 -#else - stc gbr, r1 - mov.w .Lpfoff, r2 - add r2, r1 - mov.l @r1, r5 - mov #FUTEX_WAKE, r0 - or r0, r5 -#endif - extu.b r5, r5 + mov #FUTEX_WAKE, r5 mov #-1, r6 shlr r6 /* r6 = 0x7fffffff */ mov #SYS_futex, r3 @@ -242,10 +208,6 @@ __pthread_once: sleep cfi_endproc -#if !__ASSUME_PRIVATE_FUTEX -.Lpfoff: - .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE -#endif .align 2 .Lsigsetjmp: .long __sigsetjmp@PLT-(.Lsigsetjmp0-.) @@ -262,3 +224,23 @@ __pthread_once_internal = __pthread_once .globl pthread_once pthread_once = __pthread_once + + + .type clear_once_control,@function + .align 5 +clear_once_control: + mov #0, r0 + mov.l r0, @r4 + + mov #FUTEX_WAKE, r5 + mov #-1, r6 + shlr r6 /* r6 = 0x7fffffff */ + mov #0, r7 + mov #SYS_futex, r3 + extu.b r3, r3 + trapa #0x14 + SYSCALL_INST_PAD + + rts + nop + .size clear_once_control,.-clear_once_control |