~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm64/include/asm/compat.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright (C) 2012 ARM Ltd.
  4  */
  5 #ifndef __ASM_COMPAT_H
  6 #define __ASM_COMPAT_H
  7 
  8 #define compat_mode_t compat_mode_t
  9 typedef u16             compat_mode_t;
 10 
 11 #define __compat_uid_t  __compat_uid_t
 12 typedef u16             __compat_uid_t;
 13 typedef u16             __compat_gid_t;
 14 
 15 #define compat_ipc_pid_t compat_ipc_pid_t
 16 typedef u16             compat_ipc_pid_t;
 17 
 18 #define compat_statfs   compat_statfs
 19 
 20 #include <asm-generic/compat.h>
 21 
 22 #ifdef CONFIG_COMPAT
 23 
 24 /*
 25  * Architecture specific compatibility types
 26  */
 27 #include <linux/types.h>
 28 #include <linux/sched.h>
 29 #include <linux/sched/task_stack.h>
 30 
 31 #ifdef __AARCH64EB__
 32 #define COMPAT_UTS_MACHINE      "armv8b\0\0"
 33 #else
 34 #define COMPAT_UTS_MACHINE      "armv8l\0\0"
 35 #endif
 36 
 37 typedef u16             __compat_uid16_t;
 38 typedef u16             __compat_gid16_t;
 39 typedef s32             compat_nlink_t;
 40 
 41 struct compat_stat {
 42 #ifdef __AARCH64EB__
 43         short           st_dev;
 44         short           __pad1;
 45 #else
 46         compat_dev_t    st_dev;
 47 #endif
 48         compat_ino_t    st_ino;
 49         compat_mode_t   st_mode;
 50         compat_ushort_t st_nlink;
 51         __compat_uid16_t        st_uid;
 52         __compat_gid16_t        st_gid;
 53 #ifdef __AARCH64EB__
 54         short           st_rdev;
 55         short           __pad2;
 56 #else
 57         compat_dev_t    st_rdev;
 58 #endif
 59         compat_off_t    st_size;
 60         compat_off_t    st_blksize;
 61         compat_off_t    st_blocks;
 62         old_time32_t    st_atime;
 63         compat_ulong_t  st_atime_nsec;
 64         old_time32_t    st_mtime;
 65         compat_ulong_t  st_mtime_nsec;
 66         old_time32_t    st_ctime;
 67         compat_ulong_t  st_ctime_nsec;
 68         compat_ulong_t  __unused4[2];
 69 };
 70 
 71 struct compat_statfs {
 72         int             f_type;
 73         int             f_bsize;
 74         int             f_blocks;
 75         int             f_bfree;
 76         int             f_bavail;
 77         int             f_files;
 78         int             f_ffree;
 79         compat_fsid_t   f_fsid;
 80         int             f_namelen;      /* SunOS ignores this field. */
 81         int             f_frsize;
 82         int             f_flags;
 83         int             f_spare[4];
 84 };
 85 
 86 #define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
 87 #define COMPAT_MINSIGSTKSZ      2048
 88 
 89 static inline int is_compat_task(void)
 90 {
 91         return test_thread_flag(TIF_32BIT);
 92 }
 93 
 94 static inline int is_compat_thread(struct thread_info *thread)
 95 {
 96         return test_ti_thread_flag(thread, TIF_32BIT);
 97 }
 98 
 99 long compat_arm_syscall(struct pt_regs *regs, int scno);
100 
101 #else /* !CONFIG_COMPAT */
102 
103 static inline int is_compat_thread(struct thread_info *thread)
104 {
105         return 0;
106 }
107 
108 #endif /* CONFIG_COMPAT */
109 #endif /* __ASM_COMPAT_H */
110 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php