summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S18
1 files changed, 5 insertions, 13 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
index 4919c11fd2..7f608a5974 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,6 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
-#include <structsem.h>
#ifndef UP
# define LOCK lock
@@ -38,26 +37,19 @@
.type sem_post,@function
.align 16
sem_post:
+ movl $1, %edx
LOCK
-#if VALUE == 0
- addl $1, (%rdi)
-#else
- addl $1, VALUE(%rdi)
-#endif
-
- cmpq $0, NWAITERS(%rdi)
- je 2f
+ xaddl %edx, (%rdi)
movl $SYS_futex, %eax
movl $FUTEX_WAKE, %esi
- orl PRIVATE(%rdi), %esi
- movl $1, %edx
+ incl %edx
syscall
testq %rax, %rax
js 1f
-2: xorl %eax, %eax
+ xorl %eax, %eax
retq
1: