4 #include <linux/compat.h>
5 #include <asm/siginfo.h>
6 #include <asm/signal.h>
9 * Data types and macros for providing 32b PowerPC support.
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
17 /* Use this to get at 32-bit user passed pointers. */
18 /* Things to consider: the low-level assembly stub does
19 srl x, 0, x for first four arguments, so if you have
20 pointer to something in the first four arguments, just
21 declare it as a pointer, not u32. On the other side,
22 arguments from 5th onwards should be declared as u32
23 for pointers, and need AA() around each usage.
24 A() macro should be used for places where you e.g.
25 have some internal variable u32 and just want to get
26 rid of a compiler warning. AA() has to be used in
27 places where you want to convert a function argument
28 to 32bit pointer or when you e.g. access pt_regs
29 structure and want to consider 32bit registers only.
32 #define A(__x) ((unsigned long)(__x))
34 ({ unsigned long __ret; \
35 __asm__ ("clrldi %0, %0, 32" \
41 /* These are here to support 32-bit syscalls on a 64-bit kernel. */
43 typedef struct compat_siginfo {
49 int _pad[SI_PAD_SIZE32];
53 compat_pid_t _pid; /* sender's pid */
54 compat_uid_t _uid; /* sender's uid */
63 /* POSIX.1b signals */
65 compat_pid_t _pid; /* sender's pid */
66 compat_uid_t _uid; /* sender's uid */
67 compat_sigval_t _sigval;
72 compat_pid_t _pid; /* which child */
73 compat_uid_t _uid; /* sender's uid */
74 int _status; /* exit code */
75 compat_clock_t _utime;
76 compat_clock_t _stime;
79 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
81 unsigned int _addr; /* faulting insn/memory ref. */
86 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
92 #define __old_sigaction32 old_sigaction32
94 struct __old_sigaction32 {
96 compat_old_sigset_t sa_mask;
97 unsigned int sa_flags;
98 unsigned sa_restorer; /* not used by Linux/SPARC yet */
104 unsigned int sa_handler; /* Really a pointer, but need to deal with 32 bits */
105 unsigned int sa_flags;
106 unsigned int sa_restorer; /* Another 32 bit pointer */
107 compat_sigset_t sa_mask; /* A 32 bit mask */
110 typedef struct sigaltstack_32 {
113 compat_size_t ss_size;
116 struct sigcontext32 {
117 unsigned int _unused[4];
119 unsigned int handler;
120 unsigned int oldmask;
121 u32 regs; /* 4 byte pointer to the pt_regs32 structure. */
125 elf_gregset_t32 mc_gregs;
126 elf_fpregset_t mc_fregs;
127 unsigned int mc_pad[2];
128 elf_vrregset_t32 mc_vregs __attribute__((__aligned__(16)));
132 unsigned int uc_flags;
133 unsigned int uc_link;
136 u32 uc_regs; /* points to uc_mcontext field */
137 compat_sigset_t uc_sigmask; /* mask last for extensibility */
138 /* glibc has 1024-bit signal masks, ours are 64-bit */
141 struct mcontext32 uc_mcontext;
144 #endif /* _PPC64_PPC32_H */