mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
ipc: rename old-style shmctl/semctl/msgctl syscalls
The behavior of these system calls is slightly different between architectures, as determined by the CONFIG_ARCH_WANT_IPC_PARSE_VERSION symbol. Most architectures that implement the split IPC syscalls don't set that symbol and only get the modern version, but alpha, arm, microblaze, mips-n32, mips-n64 and xtensa expect the caller to pass the IPC_64 flag. For the architectures that so far only implement sys_ipc(), i.e. m68k, mips-o32, powerpc, s390, sh, sparc, and x86-32, we want the new behavior when adding the split syscalls, so we need to distinguish between the two groups of architectures. The method I picked for this distinction is to have a separate system call entry point: sys_old_*ctl() now uses ipc_parse_version, while sys_*ctl() does not. The system call tables of the five architectures are changed accordingly. As an additional benefit, we no longer need the configuration specific definition for ipc_parse_version(), it always does the same thing now, but simply won't get called on architectures with the modern interface. A small downside is that on architectures that do set ARCH_WANT_IPC_PARSE_VERSION, we now have an extra set of entry points that are never called. They only add a few bytes of bloat, so it seems better to keep them compared to adding yet another Kconfig symbol. I considered adding new syscall numbers for the IPC_64 variants for consistency, but decided against that for now. Signed-off-by: Arnd Bergmann <[email protected]>
This commit is contained in:
parent
73a66023c9
commit
275f22148e
14 changed files with 137 additions and 62 deletions
|
|
@ -47,7 +47,7 @@ int ksys_ipc(unsigned int call, int first, unsigned long second,
|
|||
return -EINVAL;
|
||||
if (get_user(arg, (unsigned long __user *) ptr))
|
||||
return -EFAULT;
|
||||
return ksys_semctl(first, second, third, arg);
|
||||
return ksys_old_semctl(first, second, third, arg);
|
||||
}
|
||||
|
||||
case MSGSND:
|
||||
|
|
@ -75,7 +75,7 @@ int ksys_ipc(unsigned int call, int first, unsigned long second,
|
|||
case MSGGET:
|
||||
return ksys_msgget((key_t) first, second);
|
||||
case MSGCTL:
|
||||
return ksys_msgctl(first, second,
|
||||
return ksys_old_msgctl(first, second,
|
||||
(struct msqid_ds __user *)ptr);
|
||||
|
||||
case SHMAT:
|
||||
|
|
@ -100,7 +100,7 @@ int ksys_ipc(unsigned int call, int first, unsigned long second,
|
|||
case SHMGET:
|
||||
return ksys_shmget(first, second, third);
|
||||
case SHMCTL:
|
||||
return ksys_shmctl(first, second,
|
||||
return ksys_old_shmctl(first, second,
|
||||
(struct shmid_ds __user *) ptr);
|
||||
default:
|
||||
return -ENOSYS;
|
||||
|
|
@ -152,7 +152,7 @@ int compat_ksys_ipc(u32 call, int first, int second,
|
|||
return -EINVAL;
|
||||
if (get_user(pad, (u32 __user *) compat_ptr(ptr)))
|
||||
return -EFAULT;
|
||||
return compat_ksys_semctl(first, second, third, pad);
|
||||
return compat_ksys_old_semctl(first, second, third, pad);
|
||||
|
||||
case MSGSND:
|
||||
return compat_ksys_msgsnd(first, ptr, second, third);
|
||||
|
|
@ -177,7 +177,7 @@ int compat_ksys_ipc(u32 call, int first, int second,
|
|||
case MSGGET:
|
||||
return ksys_msgget(first, second);
|
||||
case MSGCTL:
|
||||
return compat_ksys_msgctl(first, second, compat_ptr(ptr));
|
||||
return compat_ksys_old_msgctl(first, second, compat_ptr(ptr));
|
||||
|
||||
case SHMAT: {
|
||||
int err;
|
||||
|
|
@ -196,7 +196,7 @@ int compat_ksys_ipc(u32 call, int first, int second,
|
|||
case SHMGET:
|
||||
return ksys_shmget(first, (unsigned int)second, third);
|
||||
case SHMCTL:
|
||||
return compat_ksys_shmctl(first, second, compat_ptr(ptr));
|
||||
return compat_ksys_old_shmctl(first, second, compat_ptr(ptr));
|
||||
}
|
||||
|
||||
return -ENOSYS;
|
||||
|
|
|
|||
Loading…
Reference in a new issue