Commit 6aa1fff3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Enable semtimedop for ia64 32-bit emulation.

Patch from Mark Fasheh <mark.fasheh@oracle.com>

A missing chunk from the semtimedop() implementation.  It enables
semtimedop() for 32-bit ia32 applications running on ia64.

It also changes semop() to go direct to sys_semtimedop(), bypassing a
function call.
parent db8f4c7e
...@@ -2396,6 +2396,17 @@ shmctl32 (int first, int second, void *uptr) ...@@ -2396,6 +2396,17 @@ shmctl32 (int first, int second, void *uptr)
return err; return err;
} }
static long
semtimedop32(int semid, struct sembuf *tsems, int nsems,
const struct timespec32 *timeout32)
{
struct timespec t;
if (get_user (t.tv_sec, &timeout32->tv_sec) ||
get_user (t.tv_nsec, &timeout32->tv_nsec))
return -EFAULT;
return sys_semtimedop(semid, tsems, nsems, &t);
}
asmlinkage long asmlinkage long
sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
{ {
...@@ -2407,7 +2418,10 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) ...@@ -2407,7 +2418,10 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
switch (call) { switch (call) {
case SEMOP: case SEMOP:
/* struct sembuf is the same on 32 and 64bit :)) */ /* struct sembuf is the same on 32 and 64bit :)) */
return sys_semop(first, (struct sembuf *)AA(ptr), second); return sys_semtimedop(first, (struct sembuf *)AA(ptr), second, NULL);
case SEMTIMEDOP:
return semtimedop32(first, (struct sembuf *)AA(ptr), second,
(const struct timespec32 *)AA(fifth));
case SEMGET: case SEMGET:
return sys_semget(first, second, third); return sys_semget(first, second, third);
case SEMCTL: case SEMCTL:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment