Re: SysV IPC in mips64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Are there any comments about this problem?  glibc does not use this
old-style interfaces but uClibc does.

>>>>> On Tue, 26 Aug 2003 21:06:12 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> said:

anemo> Some SysV IPC using old-style (without IPC_64 flag) does not
anemo> work on mips64 kernel.

anemo> I think SysV IPC conversion routine should set/clear IPC_64
anemo> flag when calling native system-call routine if the conversion
anemo> routine pass their own data structures.

anemo> * should set IPC_64 for semid64_ds, msqid64_ds, shmid64_ds.
anemo> * should clear IPC_64 for shmid_ds.

Here is a patch against current 2.4 CVS.  Can be applied for 2.6 with
some offsets.

diff -u linux-mips-cvs/arch/mips64/kernel/linux32.c linux.new/arch/mips64/kernel/linux32.c
--- linux-mips-cvs/arch/mips64/kernel/linux32.c	Fri Oct 24 00:01:35 2003
+++ linux.new/arch/mips64/kernel/linux32.c	Tue Oct 28 22:56:54 2003
@@ -1802,7 +1802,7 @@
 		fourth.__pad = &s;
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
-		err = sys_semctl (first, second, third, fourth);
+		err = sys_semctl (first, second, third | IPC_64, fourth);
 		set_fs (old_fs);
 
 		if (third & IPC_64) {
@@ -1967,7 +1967,7 @@
 			break;
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
-		err = sys_msgctl (first, second, (struct msqid_ds *)&m);
+		err = sys_msgctl (first, second | IPC_64, (struct msqid_ds *)&m);
 		set_fs (old_fs);
 		break;
 
@@ -1975,7 +1975,7 @@
 	case MSG_STAT:
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
-		err = sys_msgctl (first, second, (struct msqid_ds *)&m);
+		err = sys_msgctl (first, second | IPC_64, (struct msqid_ds *)&m);
 		set_fs (old_fs);
 		if (second & IPC_64) {
 			if (!access_ok(VERIFY_WRITE, up64, sizeof(*up64))) {
@@ -2082,7 +2082,7 @@
 			break;
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
-		err = sys_shmctl (first, second, &s);
+		err = sys_shmctl (first, second & ~IPC_64, &s);
 		set_fs (old_fs);
 		break;
 
@@ -2090,7 +2090,7 @@
 	case SHM_STAT:
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
-		err = sys_shmctl (first, second, (void *) &s64);
+		err = sys_shmctl (first, second | IPC_64, (void *) &s64);
 		set_fs (old_fs);
 		if (err < 0)
 			break;
---
Atsushi Nemoto


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux