aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-01-13 19:25:09 -0500
committerEric W. Biederman <ebiederm@xmission.com>2018-01-15 18:42:35 -0500
commit71ee78d538a7bcb7a876dcbd65eb73627425df6f (patch)
tree8f68f79851b83c3b1f28c9a523cbd4126ea7cccd
parent753e5a8543dae136142751961bb18ff25b0062dc (diff)
signal/blackfin: Move the blackfin specific si_codes to asm-generic/siginfo.h
Having si_codes in many different files simply encourages duplicate definitions that can cause problems later. To avoid that merge the blackfin specific si_codes into uapi/asm-generic/siginfo.h Update copy_siginfo_to_user to copy with the absence of BUS_MCEERR_AR that blackfin defines to be something else. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
-rw-r--r--arch/blackfin/include/uapi/asm/siginfo.h32
-rw-r--r--include/uapi/asm-generic/siginfo.h29
-rw-r--r--kernel/signal.c9
3 files changed, 33 insertions, 37 deletions
diff --git a/arch/blackfin/include/uapi/asm/siginfo.h b/arch/blackfin/include/uapi/asm/siginfo.h
index b1db506c8d2e..8c505170f4d0 100644
--- a/arch/blackfin/include/uapi/asm/siginfo.h
+++ b/arch/blackfin/include/uapi/asm/siginfo.h
@@ -15,36 +15,4 @@
15 15
16#define si_uid16 _sifields._kill._uid 16#define si_uid16 _sifields._kill._uid
17 17
18#define ILL_ILLPARAOP 2 /* illegal opcode combine ********** */
19#define ILL_ILLEXCPT 4 /* unrecoverable exception ********** */
20#define ILL_CPLB_VI 9 /* D/I CPLB protect violation ******** */
21#define ILL_CPLB_MISS 10 /* D/I CPLB miss ******** */
22#define ILL_CPLB_MULHIT 11 /* D/I CPLB multiple hit ******** */
23#undef NSIGILL
24#define NSIGILL 11
25
26/*
27 * SIGBUS si_codes
28 */
29#define BUS_OPFETCH 4 /* error from instruction fetch ******** */
30#undef NSIGBUS
31#define NSIGBUS 4
32
33/*
34 * SIGTRAP si_codes
35 */
36#define TRAP_STEP 1 /* single-step breakpoint************* */
37#define TRAP_TRACEFLOW 2 /* trace buffer overflow ************* */
38#define TRAP_WATCHPT 3 /* watchpoint match ************* */
39#define TRAP_ILLTRAP 4 /* illegal trap ************* */
40#undef NSIGTRAP
41#define NSIGTRAP 4
42
43/*
44 * SIGSEGV si_codes
45 */
46#define SEGV_STACKFLOW 3 /* stack overflow */
47#undef NSIGSEGV
48#define NSIGSEGV 3
49
50#endif /* _UAPI_BFIN_SIGINFO_H */ 18#endif /* _UAPI_BFIN_SIGINFO_H */
diff --git a/include/uapi/asm-generic/siginfo.h b/include/uapi/asm-generic/siginfo.h
index 7a268db1c44f..254afc31e3be 100644
--- a/include/uapi/asm-generic/siginfo.h
+++ b/include/uapi/asm-generic/siginfo.h
@@ -179,13 +179,24 @@ typedef struct siginfo {
179 * SIGILL si_codes 179 * SIGILL si_codes
180 */ 180 */
181#define ILL_ILLOPC 1 /* illegal opcode */ 181#define ILL_ILLOPC 1 /* illegal opcode */
182#ifdef __bfin__
183# define ILL_ILLPARAOP 2 /* illegal opcode combine */
184#endif
182#define ILL_ILLOPN 2 /* illegal operand */ 185#define ILL_ILLOPN 2 /* illegal operand */
183#define ILL_ILLADR 3 /* illegal addressing mode */ 186#define ILL_ILLADR 3 /* illegal addressing mode */
184#define ILL_ILLTRP 4 /* illegal trap */ 187#define ILL_ILLTRP 4 /* illegal trap */
188#ifdef __bfin__
189# define ILL_ILLEXCPT 4 /* unrecoverable exception */
190#endif
185#define ILL_PRVOPC 5 /* privileged opcode */ 191#define ILL_PRVOPC 5 /* privileged opcode */
186#define ILL_PRVREG 6 /* privileged register */ 192#define ILL_PRVREG 6 /* privileged register */
187#define ILL_COPROC 7 /* coprocessor error */ 193#define ILL_COPROC 7 /* coprocessor error */
188#define ILL_BADSTK 8 /* internal stack error */ 194#define ILL_BADSTK 8 /* internal stack error */
195#ifdef __bfin__
196# define ILL_CPLB_VI 9 /* D/I CPLB protect violation */
197# define ILL_CPLB_MISS 10 /* D/I CPLB miss */
198# define ILL_CPLB_MULHIT 11 /* D/I CPLB multiple hit */
199#endif
189#ifdef __tile__ 200#ifdef __tile__
190# define ILL_DBLFLT 9 /* double fault */ 201# define ILL_DBLFLT 9 /* double fault */
191# define ILL_HARDWALL 10 /* user networks hardwall violation */ 202# define ILL_HARDWALL 10 /* user networks hardwall violation */
@@ -225,7 +236,11 @@ typedef struct siginfo {
225 */ 236 */
226#define SEGV_MAPERR 1 /* address not mapped to object */ 237#define SEGV_MAPERR 1 /* address not mapped to object */
227#define SEGV_ACCERR 2 /* invalid permissions for mapped object */ 238#define SEGV_ACCERR 2 /* invalid permissions for mapped object */
228#define SEGV_BNDERR 3 /* failed address bound checks */ 239#ifdef __bfin__
240# define SEGV_STACKFLOW 3 /* stack overflow */
241#else
242# define SEGV_BNDERR 3 /* failed address bound checks */
243#endif
229#ifdef __ia64__ 244#ifdef __ia64__
230# define __SEGV_PSTKOVF 4 /* paragraph stack overflow */ 245# define __SEGV_PSTKOVF 4 /* paragraph stack overflow */
231#else 246#else
@@ -239,8 +254,12 @@ typedef struct siginfo {
239#define BUS_ADRALN 1 /* invalid address alignment */ 254#define BUS_ADRALN 1 /* invalid address alignment */
240#define BUS_ADRERR 2 /* non-existent physical address */ 255#define BUS_ADRERR 2 /* non-existent physical address */
241#define BUS_OBJERR 3 /* object specific hardware error */ 256#define BUS_OBJERR 3 /* object specific hardware error */
257#ifdef __bfin__
258# define BUS_OPFETCH 4 /* error from instruction fetch */
259#else
242/* hardware memory error consumed on a machine check: action required */ 260/* hardware memory error consumed on a machine check: action required */
243#define BUS_MCEERR_AR 4 261# define BUS_MCEERR_AR 4
262#endif
244/* hardware memory error detected in process but not consumed: action optional*/ 263/* hardware memory error detected in process but not consumed: action optional*/
245#define BUS_MCEERR_AO 5 264#define BUS_MCEERR_AO 5
246#define NSIGBUS 5 265#define NSIGBUS 5
@@ -252,6 +271,12 @@ typedef struct siginfo {
252#define TRAP_TRACE 2 /* process trace trap */ 271#define TRAP_TRACE 2 /* process trace trap */
253#define TRAP_BRANCH 3 /* process taken branch trap */ 272#define TRAP_BRANCH 3 /* process taken branch trap */
254#define TRAP_HWBKPT 4 /* hardware breakpoint/watchpoint */ 273#define TRAP_HWBKPT 4 /* hardware breakpoint/watchpoint */
274#ifdef __bfin__
275# define TRAP_STEP 1 /* single-step breakpoint */
276# define TRAP_TRACEFLOW 2 /* trace buffer overflow */
277# define TRAP_WATCHPT 3 /* watchpoint match */
278# define TRAP_ILLTRAP 4 /* illegal trap */
279#endif
255#define NSIGTRAP 4 280#define NSIGTRAP 4
256 281
257/* 282/*
diff --git a/kernel/signal.c b/kernel/signal.c
index 47c87b1d0b8a..4c3f4448c5f1 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2770,13 +2770,16 @@ int copy_siginfo_to_user(siginfo_t __user *to, const siginfo_t *from)
2770 err |= __put_user(from->si_flags, &to->si_flags); 2770 err |= __put_user(from->si_flags, &to->si_flags);
2771 err |= __put_user(from->si_isr, &to->si_isr); 2771 err |= __put_user(from->si_isr, &to->si_isr);
2772#endif 2772#endif
2773#ifdef BUS_MCEERR_AO
2774 /* 2773 /*
2775 * Other callers might not initialize the si_lsb field, 2774 * Other callers might not initialize the si_lsb field,
2776 * so check explicitly for the right codes here. 2775 * so check explicitly for the right codes here.
2777 */ 2776 */
2778 if (from->si_signo == SIGBUS && 2777#ifdef BUS_MCEERR_AR
2779 (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)) 2778 if (from->si_signo == SIGBUS && from->si_code == BUS_MCEERR_AR)
2779 err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb);
2780#endif
2781#ifdef BUS_MCEERR_AO
2782 if (from->si_signo == SIGBUS && from->si_code == BUS_MCEERR_AO)
2780 err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); 2783 err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb);
2781#endif 2784#endif
2782#ifdef SEGV_BNDERR 2785#ifdef SEGV_BNDERR