patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / include / asm-ppc64 / compat.h
index 4e33b67..09c28d2 100644 (file)
@@ -25,6 +25,7 @@ typedef u16           compat_ipc_pid_t;
 typedef s32            compat_daddr_t;
 typedef u32            compat_caddr_t;
 typedef __kernel_fsid_t        compat_fsid_t;
+typedef s32            compat_key_t;
 
 typedef s32            compat_int_t;
 typedef s32            compat_long_t;
@@ -116,12 +117,12 @@ typedef u32               compat_sigset_word;
  */
 typedef        u32             compat_uptr_t;
 
-static inline void *compat_ptr(compat_uptr_t uptr)
+static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
-       return (void *)(unsigned long)uptr;
+       return (void __user *)(unsigned long)uptr;
 }
 
-static inline void *compat_alloc_user_space(long len)
+static inline void __user *compat_alloc_user_space(long len)
 {
        struct pt_regs *regs = current->thread.regs;
        unsigned long usp = regs->gpr[1];
@@ -133,7 +134,69 @@ static inline void *compat_alloc_user_space(long len)
        if (!(test_thread_flag(TIF_32BIT)))
                usp -= 288;
 
-       return (void *) (usp - len);
+       return (void __user *) (usp - len);
 }
 
+/*
+ * ipc64_perm is actually 32/64bit clean but since the compat layer refers to
+ * it we may as well define it.
+ */
+struct compat_ipc64_perm {
+       compat_key_t key;
+       compat_uid_t uid;
+       compat_gid_t gid;
+       compat_uid_t cuid;
+       compat_gid_t cgid;
+       compat_mode_t mode;
+       unsigned int seq;
+       unsigned int __pad2;
+       unsigned long __unused1;        /* yes they really are 64bit pads */
+       unsigned long __unused2;
+};
+
+struct compat_semid64_ds {
+       struct compat_ipc64_perm sem_perm;
+       unsigned int __unused1;
+       compat_time_t sem_otime;
+       unsigned int __unused2;
+       compat_time_t sem_ctime;
+       compat_ulong_t sem_nsems;
+       compat_ulong_t __unused3;
+       compat_ulong_t __unused4;
+};
+
+struct compat_msqid64_ds {
+       struct compat_ipc64_perm msg_perm;
+       unsigned int __unused1;
+       compat_time_t msg_stime;
+       unsigned int __unused2;
+       compat_time_t msg_rtime;
+       unsigned int __unused3;
+       compat_time_t msg_ctime;
+       compat_ulong_t msg_cbytes;
+       compat_ulong_t msg_qnum;
+       compat_ulong_t msg_qbytes;
+       compat_pid_t msg_lspid;
+       compat_pid_t msg_lrpid;
+       compat_ulong_t __unused4;
+       compat_ulong_t __unused5;
+};
+
+struct compat_shmid64_ds {
+       struct compat_ipc64_perm shm_perm;
+       unsigned int __unused1;
+       compat_time_t shm_atime;
+       unsigned int __unused2;
+       compat_time_t shm_dtime;
+       unsigned int __unused3;
+       compat_time_t shm_ctime;
+       unsigned int __unused4;
+       compat_size_t shm_segsz;
+       compat_pid_t shm_cpid;
+       compat_pid_t shm_lpid;
+       compat_ulong_t shm_nattch;
+       compat_ulong_t __unused5;
+       compat_ulong_t __unused6;
+};
+
 #endif /* _ASM_PPC64_COMPAT_H */