Commit c2245332 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: Add semtimedop

parent 4b0466bf
......@@ -1773,6 +1773,22 @@ do_sys32_shmctl(int first, int second, void *uptr)
return err;
}
static int sys32_semtimedop(int semid, struct sembuf *tsems, int nsems,
const struct compat_timespec *timeout32)
{
struct compat_timespec t32;
struct timespec *t64 = compat_alloc_user_space(sizeof(*t64));
if (copy_from_user(&t32, timeout32, sizeof(t32)))
return -EFAULT;
if (put_user(t32.tv_sec, &t64->tv_sec) ||
put_user(t32.tv_nsec, &t64->tv_nsec))
return -EFAULT;
return sys_semtimedop(semid, tsems, nsems, t64);
}
/*
* Note: it is necessary to treat first_parm, second_parm, and
* third_parm as unsigned ints, with the corresponding cast to a
......@@ -1795,8 +1811,12 @@ asmlinkage long sys32_ipc(u32 call, u32 first_parm, u32 second_parm, u32 third_p
case SEMOP:
/* struct sembuf is the same on 32 and 64bit :)) */
err = sys_semop(first, (struct sembuf *)AA(ptr),
second);
err = sys_semtimedop(first, (struct sembuf *)AA(ptr),
second, NULL);
break;
case SEMTIMEDOP:
err = sys32_semtimedop(first, (struct sembuf *)AA(ptr), second,
(const struct compat_timespec *)AA(fifth));
break;
case SEMGET:
err = sys_semget(first, second, third);
......
......@@ -66,7 +66,12 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
ret = -ENOSYS;
switch (call) {
case SEMOP:
ret = sys_semop (first, (struct sembuf *)ptr, second);
ret = sys_semtimedop (first, (struct sembuf *)ptr, second,
NULL);
break;
case SEMTIMEDOP:
ret = sys_semtimedop (first, (struct sembuf *)ptr, second,
(const struct timespec *) fifth);
break;
case SEMGET:
ret = sys_semget (first, second, third);
......
......@@ -19,6 +19,7 @@ struct ipc_kludge {
#define SEMOP 1
#define SEMGET 2
#define SEMCTL 3
#define SEMTIMEDOP 4
#define MSGSND 11
#define MSGRCV 12
#define MSGGET 13
......
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