diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-10-04 20:15:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:16 -0400 |
commit | 751f409db6216ebd134a94f6dcd97779933a5106 (patch) | |
tree | 7b059d89cf303ed2d37f36e8f8604e2295e3566a /arch/tile | |
parent | 5ab1c309b344880d81494e9eab7fb27682bc6d9d (diff) |
compat: move compat_siginfo_t definition to asm/compat.h
This is a preparatory patch for the introduction of NT_SIGINFO elf note.
Make the location of compat_siginfo_t uniform across eight architectures
which have it. Now it can be pulled in by including asm/compat.h or
linux/compat.h.
Most of the copies are verbatim. compat_uid[32]_t had to be replaced by
__compat_uid[32]_t. compat_uptr_t had to be moved up before
compat_siginfo_t in asm/compat.h on a several architectures (tile already
had it moved up). compat_sigval_t had to be relocated from linux/compat.h
to asm/compat.h.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: "Jonathan M. Foote" <jmfoote@cert.org>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/include/asm/compat.h | 62 | ||||
-rw-r--r-- | arch/tile/kernel/compat_signal.c | 57 |
2 files changed, 62 insertions, 57 deletions
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h index 6e74450ff0a1..3063e6fc8daa 100644 --- a/arch/tile/include/asm/compat.h +++ b/arch/tile/include/asm/compat.h | |||
@@ -110,6 +110,68 @@ struct compat_flock64 { | |||
110 | 110 | ||
111 | typedef u32 compat_sigset_word; | 111 | typedef u32 compat_sigset_word; |
112 | 112 | ||
113 | typedef union compat_sigval { | ||
114 | compat_int_t sival_int; | ||
115 | compat_uptr_t sival_ptr; | ||
116 | } compat_sigval_t; | ||
117 | |||
118 | #define COMPAT_SI_PAD_SIZE (128/sizeof(int) - 3) | ||
119 | |||
120 | typedef struct compat_siginfo { | ||
121 | int si_signo; | ||
122 | int si_errno; | ||
123 | int si_code; | ||
124 | |||
125 | union { | ||
126 | int _pad[COMPAT_SI_PAD_SIZE]; | ||
127 | |||
128 | /* kill() */ | ||
129 | struct { | ||
130 | unsigned int _pid; /* sender's pid */ | ||
131 | unsigned int _uid; /* sender's uid */ | ||
132 | } _kill; | ||
133 | |||
134 | /* POSIX.1b timers */ | ||
135 | struct { | ||
136 | compat_timer_t _tid; /* timer id */ | ||
137 | int _overrun; /* overrun count */ | ||
138 | compat_sigval_t _sigval; /* same as below */ | ||
139 | int _sys_private; /* not to be passed to user */ | ||
140 | int _overrun_incr; /* amount to add to overrun */ | ||
141 | } _timer; | ||
142 | |||
143 | /* POSIX.1b signals */ | ||
144 | struct { | ||
145 | unsigned int _pid; /* sender's pid */ | ||
146 | unsigned int _uid; /* sender's uid */ | ||
147 | compat_sigval_t _sigval; | ||
148 | } _rt; | ||
149 | |||
150 | /* SIGCHLD */ | ||
151 | struct { | ||
152 | unsigned int _pid; /* which child */ | ||
153 | unsigned int _uid; /* sender's uid */ | ||
154 | int _status; /* exit code */ | ||
155 | compat_clock_t _utime; | ||
156 | compat_clock_t _stime; | ||
157 | } _sigchld; | ||
158 | |||
159 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
160 | struct { | ||
161 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
162 | #ifdef __ARCH_SI_TRAPNO | ||
163 | int _trapno; /* TRAP # which caused the signal */ | ||
164 | #endif | ||
165 | } _sigfault; | ||
166 | |||
167 | /* SIGPOLL */ | ||
168 | struct { | ||
169 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
170 | int _fd; | ||
171 | } _sigpoll; | ||
172 | } _sifields; | ||
173 | } compat_siginfo_t; | ||
174 | |||
113 | #define COMPAT_OFF_T_MAX 0x7fffffff | 175 | #define COMPAT_OFF_T_MAX 0x7fffffff |
114 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 176 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
115 | 177 | ||
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index 474571b84085..7bc0859a9f5e 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c | |||
@@ -55,63 +55,6 @@ struct compat_ucontext { | |||
55 | sigset_t uc_sigmask; /* mask last for extensibility */ | 55 | sigset_t uc_sigmask; /* mask last for extensibility */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | #define COMPAT_SI_PAD_SIZE ((SI_MAX_SIZE - 3 * sizeof(int)) / sizeof(int)) | ||
59 | |||
60 | struct compat_siginfo { | ||
61 | int si_signo; | ||
62 | int si_errno; | ||
63 | int si_code; | ||
64 | |||
65 | union { | ||
66 | int _pad[COMPAT_SI_PAD_SIZE]; | ||
67 | |||
68 | /* kill() */ | ||
69 | struct { | ||
70 | unsigned int _pid; /* sender's pid */ | ||
71 | unsigned int _uid; /* sender's uid */ | ||
72 | } _kill; | ||
73 | |||
74 | /* POSIX.1b timers */ | ||
75 | struct { | ||
76 | compat_timer_t _tid; /* timer id */ | ||
77 | int _overrun; /* overrun count */ | ||
78 | compat_sigval_t _sigval; /* same as below */ | ||
79 | int _sys_private; /* not to be passed to user */ | ||
80 | int _overrun_incr; /* amount to add to overrun */ | ||
81 | } _timer; | ||
82 | |||
83 | /* POSIX.1b signals */ | ||
84 | struct { | ||
85 | unsigned int _pid; /* sender's pid */ | ||
86 | unsigned int _uid; /* sender's uid */ | ||
87 | compat_sigval_t _sigval; | ||
88 | } _rt; | ||
89 | |||
90 | /* SIGCHLD */ | ||
91 | struct { | ||
92 | unsigned int _pid; /* which child */ | ||
93 | unsigned int _uid; /* sender's uid */ | ||
94 | int _status; /* exit code */ | ||
95 | compat_clock_t _utime; | ||
96 | compat_clock_t _stime; | ||
97 | } _sigchld; | ||
98 | |||
99 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
100 | struct { | ||
101 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
102 | #ifdef __ARCH_SI_TRAPNO | ||
103 | int _trapno; /* TRAP # which caused the signal */ | ||
104 | #endif | ||
105 | } _sigfault; | ||
106 | |||
107 | /* SIGPOLL */ | ||
108 | struct { | ||
109 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
110 | int _fd; | ||
111 | } _sigpoll; | ||
112 | } _sifields; | ||
113 | }; | ||
114 | |||
115 | struct compat_rt_sigframe { | 58 | struct compat_rt_sigframe { |
116 | unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; /* caller save area */ | 59 | unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; /* caller save area */ |
117 | struct compat_siginfo info; | 60 | struct compat_siginfo info; |