This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] RE: msgctl() on MIPS, n32 ABI.


On Tue, 09 Jan 2007 20:51:15 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> > MIPS glibc defines __ASSUME_IPC64 so __IPC_64 would be generated on
> > __new_shmctl() or __new_msgctl(), no?
> 
> Sorry, I was confused.  On mips64, neither __new_shmctl() nor
> __new_msgctl() are used.  So indeed someone (kernel or glibc) should set
> __IPC_64.  Hmm...

The __IPC_64 problem on {shm,sem,msg}ctl is not only for N32.  N64
also suffers this problem.  Certainly glibc can provide wrappers for
these system calls, as ARM EABI does.  A patch attached.

And there is one more thing on N32.  The semctl() use "union semun" on
its argument, and there is gcc version dependency in small aggregate
argument (size of the union is smaller than register size on N32).
See http://gcc.gnu.org/gcc-3.4/mips-abi.html.  I think this patch
fixes this problem too.

And as Kaz pointed out, N32 compat routines in kernel need some
wrappers to adjust number or order of arguments.  For this issue,
kernel should be fixed.  I'll post a patch to linux-mips ML soon.


2007-01-10  Atsushi Nemoto <anemo@mba.ocn.ne.jp>

	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list: Remove msgctl,
	shmctl, and semctl.
	* sysdeps/unix/sysv/linux/mips/misp64/semctl.c,
	sysdeps/unix/sysv/linux/mips/mips64/shmctl.c,
	sysdeps/unix/sysv/linux/mips/mips64/msgctl.c: New files.

diff -urNp glibc-ports-2.5.org/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
--- glibc-ports-2.5.org/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c	1970-01-01 09:00:00.000000000 +0900
+++ glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c	2007-01-10 17:28:55.000000000 +0900
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/alpha/msgctl.c>
diff -urNp glibc-ports-2.5.org/sysdeps/unix/sysv/linux/mips/mips64/semctl.c glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
--- glibc-ports-2.5.org/sysdeps/unix/sysv/linux/mips/mips64/semctl.c	1970-01-01 09:00:00.000000000 +0900
+++ glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/mips64/semctl.c	2007-01-10 16:16:58.000000000 +0900
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/alpha/semctl.c>
diff -urNp glibc-ports-2.5.org/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
--- glibc-ports-2.5.org/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c	1970-01-01 09:00:00.000000000 +0900
+++ glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c	2007-01-10 17:29:26.000000000 +0900
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/alpha/shmctl.c>
diff -urNp glibc-ports-2.5.org/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
--- glibc-ports-2.5.org/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list	2006-03-03 10:06:47.000000000 +0900
+++ glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list	2007-01-10 17:27:25.000000000 +0900
@@ -2,16 +2,14 @@
 
 lseek		-	lseek		Ci:iii	__libc_lseek	__lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
 
-# semaphore and shm system calls
-msgctl		-	msgctl		i:iip	__msgctl	msgctl
+# Semaphore and shm system calls.  msgctl, shmctl, and semctl have C
+# wrappers (to set __IPC_64).
 msgget		-	msgget		i:ii	__msgget	msgget
 msgrcv		-	msgrcv		Ci:ibnii __msgrcv	msgrcv
 msgsnd		-	msgsnd		Ci:ibni	__msgsnd	msgsnd
 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
 semget		-	semget		i:iii	__semget	semget
-semctl		-	semctl		i:iiii	__semctl	semctl


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]