]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Enable semtimedop for ia64 32-bit emulation.
authorAndrew Morton <akpm@digeo.com>
Mon, 30 Dec 2002 05:40:25 +0000 (21:40 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 30 Dec 2002 05:40:25 +0000 (21:40 -0800)
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.

arch/ia64/ia32/sys_ia32.c

index a7ca7341a90a544dc4d39987b79ba192a3e87f5f..d7ffb0124d7766b1cbf49589b49ab453a1f59914 100644 (file)
@@ -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: