Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_POWERPC_COMPAT_H
0003 #define _ASM_POWERPC_COMPAT_H
0004 #ifdef __KERNEL__
0005 /*
0006  * Architecture specific compatibility types
0007  */
0008 #include <linux/types.h>
0009 #include <linux/sched.h>
0010 
0011 #define compat_ipc_pid_t compat_ipc_pid_t
0012 typedef u16     compat_ipc_pid_t;
0013 
0014 #define compat_ipc64_perm compat_ipc64_perm
0015 
0016 #include <asm-generic/compat.h>
0017 
0018 #ifdef __BIG_ENDIAN__
0019 #define COMPAT_UTS_MACHINE  "ppc\0\0"
0020 #else
0021 #define COMPAT_UTS_MACHINE  "ppcle\0\0"
0022 #endif
0023 
0024 typedef s16     compat_nlink_t;
0025 
0026 struct compat_stat {
0027     compat_dev_t    st_dev;
0028     compat_ino_t    st_ino;
0029     compat_mode_t   st_mode;
0030     compat_nlink_t  st_nlink;
0031     __compat_uid32_t    st_uid;
0032     __compat_gid32_t    st_gid;
0033     compat_dev_t    st_rdev;
0034     compat_off_t    st_size;
0035     compat_off_t    st_blksize;
0036     compat_off_t    st_blocks;
0037     old_time32_t    st_atime;
0038     u32     st_atime_nsec;
0039     old_time32_t    st_mtime;
0040     u32     st_mtime_nsec;
0041     old_time32_t    st_ctime;
0042     u32     st_ctime_nsec;
0043     u32     __unused4[2];
0044 };
0045 
0046 /*
0047  * ipc64_perm is actually 32/64bit clean but since the compat layer refers to
0048  * it we may as well define it.
0049  */
0050 struct compat_ipc64_perm {
0051     compat_key_t key;
0052     __compat_uid_t uid;
0053     __compat_gid_t gid;
0054     __compat_uid_t cuid;
0055     __compat_gid_t cgid;
0056     compat_mode_t mode;
0057     unsigned int seq;
0058     unsigned int __pad2;
0059     unsigned long __unused1;    /* yes they really are 64bit pads */
0060     unsigned long __unused2;
0061 };
0062 
0063 struct compat_semid64_ds {
0064     struct compat_ipc64_perm sem_perm;
0065     unsigned int sem_otime_high;
0066     unsigned int sem_otime;
0067     unsigned int sem_ctime_high;
0068     unsigned int sem_ctime;
0069     compat_ulong_t sem_nsems;
0070     compat_ulong_t __unused3;
0071     compat_ulong_t __unused4;
0072 };
0073 
0074 struct compat_msqid64_ds {
0075     struct compat_ipc64_perm msg_perm;
0076     unsigned int msg_stime_high;
0077     unsigned int msg_stime;
0078     unsigned int msg_rtime_high;
0079     unsigned int msg_rtime;
0080     unsigned int msg_ctime_high;
0081     unsigned int msg_ctime;
0082     compat_ulong_t msg_cbytes;
0083     compat_ulong_t msg_qnum;
0084     compat_ulong_t msg_qbytes;
0085     compat_pid_t msg_lspid;
0086     compat_pid_t msg_lrpid;
0087     compat_ulong_t __unused4;
0088     compat_ulong_t __unused5;
0089 };
0090 
0091 struct compat_shmid64_ds {
0092     struct compat_ipc64_perm shm_perm;
0093     unsigned int shm_atime_high;
0094     unsigned int shm_atime;
0095     unsigned int shm_dtime_high;
0096     unsigned int shm_dtime;
0097     unsigned int shm_ctime_high;
0098     unsigned int shm_ctime;
0099     unsigned int __unused4;
0100     compat_size_t shm_segsz;
0101     compat_pid_t shm_cpid;
0102     compat_pid_t shm_lpid;
0103     compat_ulong_t shm_nattch;
0104     compat_ulong_t __unused5;
0105     compat_ulong_t __unused6;
0106 };
0107 
0108 static inline int is_compat_task(void)
0109 {
0110     return is_32bit_task();
0111 }
0112 
0113 #endif /* __KERNEL__ */
0114 #endif /* _ASM_POWERPC_COMPAT_H */