diff mbox

[v3,10/17] Use semop syscall for Linux implementation

Message ID 1478637007-31212-11-git-send-email-adhemerval.zanella@linaro.org
State Superseded
Headers show

Commit Message

Adhemerval Zanella Nov. 8, 2016, 8:30 p.m. UTC
Changes from previous version:

  - Remove semop from syscalls.list.

--

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.
---
 ChangeLog                                          | 14 ++++++++++++++
 sysdeps/unix/sysv/linux/alpha/syscalls.list        |  1 -
 sysdeps/unix/sysv/linux/arm/syscalls.list          |  1 -
 sysdeps/unix/sysv/linux/generic/syscalls.list      |  1 -
 sysdeps/unix/sysv/linux/hppa/syscalls.list         |  1 -
 sysdeps/unix/sysv/linux/ia64/syscalls.list         |  1 -
 sysdeps/unix/sysv/linux/microblaze/syscalls.list   |  1 -
 sysdeps/unix/sysv/linux/mips/mips64/syscalls.list  |  1 -
 sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list |  1 -
 sysdeps/unix/sysv/linux/semop.c                    | 10 ++++++----
 sysdeps/unix/sysv/linux/x86_64/syscalls.list       |  1 -
 11 files changed, 20 insertions(+), 13 deletions(-)

-- 
2.7.4
diff mbox

Patch

diff --git a/ChangeLog b/ChangeLog
index 6544bfd..d7a8b00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@ 
 2016-11-08  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 2533263..c20543a 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 ef5bd01..3014db8 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 485f6fe..54e1778 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 685ab93..8fbcaba 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 56200ba..b9271cc 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 a0b8ebf..3da653d 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 facae19..308e9f8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
@@ -8,5 +8,4 @@  truncate	-	truncate	i:si	truncate	truncate64
 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 288e080..924d182 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 593eb4c..bd57009 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_SYSVIPC_SYSCALL
+  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 a6d2636..0a333a4 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -6,7 +6,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