about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-10-26 17:01:43 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-12-28 20:31:04 -0200
commit0f971840201bcb27247a8d8f53621197396262cd (patch)
treeced9fa9e7bc895a7dcd02493696aa0f6b7134858
parentd29f6bcdcc11d81e20c5880f5e1d7588cef950f7 (diff)
downloadglibc-0f971840201bcb27247a8d8f53621197396262cd.tar.gz
glibc-0f971840201bcb27247a8d8f53621197396262cd.tar.xz
glibc-0f971840201bcb27247a8d8f53621197396262cd.zip
Use semop syscall for Linux implementation
This patch add a direct call to semop syscall if it is supported by
kernel headers.

Checked on x86_64, i686, powerpc64le, aarch64, and armhf.

	* sysdeps/unix/sysv/linux/alpha/syscalls.list (semop): Remove.
	* sysdeps/unix/sysv/linux/arm/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/generic/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/ia64/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (semop):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (semop):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/semop.c (semop): Use semop syscall if it is
	defined.
-rw-r--r--ChangeLog14
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/arm/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/generic/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/semop.c10
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/syscalls.list1
11 files changed, 20 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index f4de0e318a..76ad37da1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2016-12-28  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+	* sysdeps/unix/sysv/linux/alpha/syscalls.list (semop): Remove.
+	* sysdeps/unix/sysv/linux/arm/syscalls.list (semop): Likewise.
+	* sysdeps/unix/sysv/linux/generic/syscalls.list (semop): Likewise.
+	* sysdeps/unix/sysv/linux/hppa/syscalls.list (semop): Likewise.
+	* sysdeps/unix/sysv/linux/ia64/syscalls.list (semop): Likewise.
+	* sysdeps/unix/sysv/linux/microblaze/syscalls.list (semop): Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (semop):
+	Likewise.
+	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (semop):
+	Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (semop): Likewise.
+	* sysdeps/unix/sysv/linux/semop.c (semop): Use semop syscall if it is
+	defined.
+
 	* sysdeps/unix/sysv/linux/alpha/syscalls.list (semget): Remove.
 	* sysdeps/unix/sysv/linux/arm/syscalls.list (semget): Likewise.
 	* sysdeps/unix/sysv/linux/generic/syscalls.list (semget): Likewise.
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 2533263114..c20543a6ad 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -4,7 +4,6 @@ shmat		-	osf_shmat	i:ipi	__shmat		shmat
 oldshmctl	EXTRA	shmctl		i:iip	__old_shmctl	shmctl@GLIBC_2.0
 shmdt		-	shmdt		i:s	__shmdt		shmdt
 shmget		-	shmget		i:iii	__shmget	shmget
-semop		-	semop		i:ipi	__semop		semop
 semtimedop	-	semtimedop	i:ipip	semtimedop
 
 sigstack	-	sigstack	2	sigstack
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
index ef5bd0152c..3014db836b 100644
--- a/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -26,7 +26,6 @@ personality	EXTRA	personality	Ei:i	__personality	personality
 shmat		-	shmat		i:ipi	__shmat		shmat
 shmdt		-	shmdt		i:s	__shmdt		shmdt
 shmget		-	shmget		i:iii	__shmget	shmget
-semop		-	semop		i:ipi	__semop		semop
 semtimedop	-	semtimedop	i:ipip	semtimedop
 
 # proper socket implementations:
diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
index 485f6fe4c8..54e1778748 100644
--- a/sysdeps/unix/sysv/linux/generic/syscalls.list
+++ b/sysdeps/unix/sysv/linux/generic/syscalls.list
@@ -2,7 +2,6 @@
 
 # SysV APIs
 semtimedop	-	semtimedop	i:ipip	semtimedop
-semop		-	semop		i:ipi	__semop		semop
 shmget		-	shmget		i:iii	__shmget	shmget
 shmctl		-	shmctl		i:iip	__shmctl	shmctl
 shmat		-	shmat		i:ipi	__shmat		shmat
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
index 685ab93a4f..8fbcabaa65 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -5,7 +5,6 @@ shmat		-	shmat		i:ipi	__shmat		shmat
 shmctl		-	shmctl		i:iip	__shmctl	shmctl
 shmdt		-	shmdt		i:s	__shmdt		shmdt
 shmget		-	shmget		i:iii	__shmget	shmget
-semop		-	semop		i:ipi	__semop		semop
 semtimedop      -       semtimedop      i:ipip  semtimedop
 
 # proper socket implementations:
diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list
index 56200ba2d2..b9271cc545 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
@@ -9,7 +9,6 @@ shmat		-	shmat		i:ipi	__shmat		shmat
 shmctl		-	shmctl		i:iip	__shmctl	shmctl
 shmdt		-	shmdt		i:s	__shmdt		shmdt
 shmget		-	shmget		i:iii	__shmget	shmget
-semop		-	semop		i:ipi	__semop		semop
 semtimedop	-	semtimedop	i:ipip	semtimedop
 
 # proper socket implementations:
diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list
index a0b8ebf148..3da653dc70 100644
--- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list
+++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list
@@ -11,5 +11,4 @@ personality	EXTRA	personality	Ei:i	__personality	personality
 shmat           -       shmat           i:ipi   __shmat         shmat
 shmdt           -       shmdt           i:s     __shmdt         shmdt
 shmget          -       shmget          i:iii   __shmget        shmget
-semop           -       semop           i:ipi   __semop         semop
 semtimedop      -       semtimedop      i:ipip  semtimedop
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
index 374fcc2213..720db96d59 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
@@ -5,5 +5,4 @@
 shmat		-	shmat		i:ipi	__shmat		shmat
 shmdt		-	shmdt		i:s	__shmdt		shmdt
 shmget		-	shmget		i:iii	__shmget	shmget
-semop		-	semop		i:ipi	__semop		semop
 semtimedop	-	semtimedop	i:ipip	semtimedop
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
index 288e0808d8..924d182d69 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
@@ -5,4 +5,3 @@ shmat		-	shmat		i:ipi	__shmat		shmat
 shmctl		-	shmctl		i:iip	__shmctl	shmctl
 shmdt		-	shmdt		i:s	__shmdt		shmdt
 shmget		-	shmget		i:iii	__shmget	shmget
-semop		-	semop		i:ipi	__semop		semop
diff --git a/sysdeps/unix/sysv/linux/semop.c b/sysdeps/unix/sysv/linux/semop.c
index 593eb4ce85..c179fccece 100644
--- a/sysdeps/unix/sysv/linux/semop.c
+++ b/sysdeps/unix/sysv/linux/semop.c
@@ -16,17 +16,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
 #include <sys/sem.h>
 #include <ipc_priv.h>
-
 #include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
 
 /* Perform user-defined atomical operation of array of semaphores.  */
 
 int
 semop (int semid, struct sembuf *sops, size_t nsops)
 {
-  return INLINE_SYSCALL (ipc, 5, IPCOP_semop, semid, (int) nsops, 0, sops);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+  return INLINE_SYSCALL_CALL (semop, semid, sops, nsops);
+#else
+  return INLINE_SYSCALL_CALL (ipc, IPCOP_semop, semid, nsops, 0, sops);
+#endif
 }
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index d77a7ca589..d17a1869aa 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -10,7 +10,6 @@ shmat		-	shmat		i:ipi	__shmat		shmat
 shmctl		-	shmctl		i:iip	__shmctl	shmctl
 shmdt		-	shmdt		i:s	__shmdt		shmdt
 shmget		-	shmget		i:iii	__shmget	shmget
-semop		-	semop		i:ipi	__semop		semop
 semtimedop	-	semtimedop	i:ipip	semtimedop
 syscall_clock_gettime	EXTRA	clock_gettime	Ei:ip		__syscall_clock_gettime