Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | #ifndef _PPC64_PPC32_H #define _PPC64_PPC32_H #include <asm/siginfo.h> #include <asm/signal.h> /* * Data types and macros for providing 32b PowerPC support. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef __KERNEL_STRICT_NAMES #include <linux/types.h> typedef __kernel_fsid_t __kernel_fsid_t32; #endif /* Use this to get at 32-bit user passed pointers. */ /* Things to consider: the low-level assembly stub does srl x, 0, x for first four arguments, so if you have pointer to something in the first four arguments, just declare it as a pointer, not u32. On the other side, arguments from 5th onwards should be declared as u32 for pointers, and need AA() around each usage. A() macro should be used for places where you e.g. have some internal variable u32 and just want to get rid of a compiler warning. AA() has to be used in places where you want to convert a function argument to 32bit pointer or when you e.g. access pt_regs structure and want to consider 32bit registers only. - */ #define A(__x) ((unsigned long)(__x)) #define AA(__x) \ ({ unsigned long __ret; \ __asm__ ("clrldi %0, %0, 32" \ : "=r" (__ret) \ : "0" (__x)); \ __ret; \ }) /* These are here to support 32-bit syscalls on a 64-bit kernel. */ typedef unsigned int __kernel_size_t32; typedef int __kernel_ssize_t32; typedef int __kernel_ptrdiff_t32; typedef int __kernel_time_t32; typedef int __kernel_clock_t32; typedef int __kernel_pid_t32; typedef unsigned short __kernel_ipc_pid_t32; typedef unsigned int __kernel_uid_t32; typedef unsigned int __kernel_gid_t32; typedef unsigned int __kernel_dev_t32; typedef unsigned int __kernel_ino_t32; typedef unsigned int __kernel_mode_t32; typedef unsigned int __kernel_umode_t32; typedef short __kernel_nlink_t32; typedef int __kernel_daddr_t32; typedef int __kernel_off_t32; typedef unsigned int __kernel_caddr_t32; typedef int __kernel_loff_t32; /* typedef __kernel_fsid_t __kernel_fsid_t32; */ struct statfs32 { int f_type; int f_bsize; int f_blocks; int f_bfree; int f_bavail; int f_files; int f_ffree; __kernel_fsid_t32 f_fsid; int f_namelen; /* SunOS ignores this field. */ int f_spare[6]; }; typedef union sigval32 { int sival_int; unsigned int sival_ptr; } sigval_t32; typedef struct siginfo32 { int si_signo; int si_errno; int si_code; union { int _pad[SI_PAD_SIZE]; /* kill() */ struct { __kernel_pid_t32 _pid; /* sender's pid */ unsigned int _uid; /* sender's uid */ } _kill; /* POSIX.1b timers */ struct { unsigned int _timer1; unsigned int _timer2; } _timer; /* POSIX.1b signals */ struct { __kernel_pid_t32 _pid; /* sender's pid */ unsigned int _uid; /* sender's uid */ sigval_t32 _sigval; } _rt; /* SIGCHLD */ struct { __kernel_pid_t32 _pid; /* which child */ unsigned int _uid; /* sender's uid */ int _status; /* exit code */ __kernel_clock_t32 _utime; __kernel_clock_t32 _stime; } _sigchld; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ struct { u32 _addr; /* faulting insn/memory ref. */ int _trapno; } _sigfault; /* SIGPOLL */ struct { int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ int _fd; } _sigpoll; } _sifields; } siginfo_t32; #define __old_sigset_t32 old_sigset_t32 #define __old_sigaction32 old_sigaction32 typedef unsigned int __old_sigset_t32; struct __old_sigaction32 { unsigned sa_handler; __old_sigset_t32 sa_mask; unsigned int sa_flags; unsigned sa_restorer; /* not used by Linux/SPARC yet */ }; #define _PPC32_NSIG 64 #define _PPC32_NSIG_BPW 32 #define _PPC32_NSIG_WORDS (_PPC32_NSIG / _PPC32_NSIG_BPW) typedef struct { unsigned int sig[_PPC32_NSIG_WORDS]; } sigset32_t; struct sigaction32 { unsigned int sa_handler; /* Really a pointer, but need to deal with 32 bits */ unsigned int sa_flags; unsigned int sa_restorer; /* Another 32 bit pointer */ sigset32_t sa_mask; /* A 32 bit mask */ }; typedef struct sigaltstack_32 { unsigned int ss_sp; int ss_flags; __kernel_size_t32 ss_size; } stack_32_t; struct flock32 { short l_type; short l_whence; __kernel_off_t32 l_start; __kernel_off_t32 l_len; __kernel_pid_t32 l_pid; short __unused; }; struct stat32 { __kernel_dev_t32 st_dev; /* 2 */ /* __kernel_dev_t32 __pad1; */ /* 2 */ __kernel_ino_t32 st_ino; /* 4 */ __kernel_mode_t32 st_mode; /* 2 */ short st_nlink; /* 2 */ __kernel_uid_t32 st_uid; /* 2 */ __kernel_gid_t32 st_gid; /* 2 */ __kernel_dev_t32 st_rdev; /* 2 */ /* __kernel_dev_t32 __pad2; */ /* 2 */ __kernel_off_t32 st_size; /* 4 */ __kernel_off_t32 st_blksize; /* 4 */ __kernel_off_t32 st_blocks; /* 4 */ __kernel_time_t32 st_atime; /* 4 */ unsigned int __unused1; /* 4 */ __kernel_time_t32 st_mtime; /* 4 */ unsigned int __unused2; /* 4 */ __kernel_time_t32 st_ctime; /* 4 */ unsigned int __unused3; /* 4 */ unsigned int __unused4[2]; /* 2*4 */ }; struct __old_kernel_stat32 { unsigned short st_dev; unsigned short st_ino; unsigned short st_mode; unsigned short st_nlink; unsigned short st_uid; unsigned short st_gid; unsigned short st_rdev; unsigned int st_size; unsigned int st_atime; unsigned int st_mtime; unsigned int st_ctime; }; struct sigcontext32_struct { unsigned int _unused[4]; int signal; unsigned int handler; unsigned int oldmask; u32 regs; /* 4 byte pointer to the pt_regs32 structure. */ }; struct ucontext32 { unsigned int uc_flags; unsigned int uc_link; stack_32_t uc_stack; struct sigcontext32_struct uc_mcontext; sigset_t uc_sigmask; /* mask last for extensibility */ }; #endif /* _PPC64_PPC32_H */ |