From: Andrew Morton Date: Mon, 30 Dec 2002 05:40:25 +0000 (-0800) Subject: [PATCH] Enable semtimedop for ia64 32-bit emulation. X-Git-Tag: v2.5.54~20^2~6^2~13 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=6aa1fff30fda814e22dec6b85050136673d7ce58;p=history.git [PATCH] Enable semtimedop for ia64 32-bit emulation. Patch from Mark Fasheh 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. --- diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index a7ca7341a90a..d7ffb0124d77 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -2396,6 +2396,17 @@ shmctl32 (int first, int second, void *uptr) 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 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) { case SEMOP: /* 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: return sys_semget(first, second, third); case SEMCTL: