diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2015-08-05 01:42:00 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2015-08-05 02:18:21 -0400 |
commit | 87ce62802f7a3553234ebf1ae7cd52c8bf272fb9 (patch) | |
tree | 05cf0987ec30adfd5661e1dee2a1d16f0d4ff988 | |
parent | b89aa12c177477e34caa722818536fb5d0bffd76 (diff) |
ARC: Make pt_regs regs unsigned
KGDB fails to build after f51e2f191112 ("ARC: make sure instruction_pointer()
returns unsigned value")
The hack to force one specific reg to unsigned backfired. There's no
reason to keep the regs signed after all.
| CC arch/arc/kernel/kgdb.o
|../arch/arc/kernel/kgdb.c: In function 'kgdb_trap':
| ../arch/arc/kernel/kgdb.c:180:29: error: lvalue required as left operand of assignment
| instruction_pointer(regs) -= BREAK_INSTR_SIZE;
Reported-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Fixes: f51e2f191112 ("ARC: make sure instruction_pointer() returns unsigned value")
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r-- | arch/arc/include/asm/ptrace.h | 54 | ||||
-rw-r--r-- | arch/arc/include/uapi/asm/ptrace.h | 20 |
2 files changed, 37 insertions, 37 deletions
diff --git a/arch/arc/include/asm/ptrace.h b/arch/arc/include/asm/ptrace.h index 91694ec1ce95..69095da1fcfd 100644 --- a/arch/arc/include/asm/ptrace.h +++ b/arch/arc/include/asm/ptrace.h | |||
@@ -20,20 +20,20 @@ | |||
20 | struct pt_regs { | 20 | struct pt_regs { |
21 | 21 | ||
22 | /* Real registers */ | 22 | /* Real registers */ |
23 | long bta; /* bta_l1, bta_l2, erbta */ | 23 | unsigned long bta; /* bta_l1, bta_l2, erbta */ |
24 | 24 | ||
25 | long lp_start, lp_end, lp_count; | 25 | unsigned long lp_start, lp_end, lp_count; |
26 | 26 | ||
27 | long status32; /* status32_l1, status32_l2, erstatus */ | 27 | unsigned long status32; /* status32_l1, status32_l2, erstatus */ |
28 | long ret; /* ilink1, ilink2 or eret */ | 28 | unsigned long ret; /* ilink1, ilink2 or eret */ |
29 | long blink; | 29 | unsigned long blink; |
30 | long fp; | 30 | unsigned long fp; |
31 | long r26; /* gp */ | 31 | unsigned long r26; /* gp */ |
32 | 32 | ||
33 | long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0; | 33 | unsigned long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0; |
34 | 34 | ||
35 | long sp; /* user/kernel sp depending on where we came from */ | 35 | unsigned long sp; /* User/Kernel depending on where we came from */ |
36 | long orig_r0; | 36 | unsigned long orig_r0; |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * To distinguish bet excp, syscall, irq | 39 | * To distinguish bet excp, syscall, irq |
@@ -55,13 +55,13 @@ struct pt_regs { | |||
55 | unsigned long event; | 55 | unsigned long event; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | long user_r25; | 58 | unsigned long user_r25; |
59 | }; | 59 | }; |
60 | #else | 60 | #else |
61 | 61 | ||
62 | struct pt_regs { | 62 | struct pt_regs { |
63 | 63 | ||
64 | long orig_r0; | 64 | unsigned long orig_r0; |
65 | 65 | ||
66 | union { | 66 | union { |
67 | struct { | 67 | struct { |
@@ -76,26 +76,26 @@ struct pt_regs { | |||
76 | unsigned long event; | 76 | unsigned long event; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | long bta; /* bta_l1, bta_l2, erbta */ | 79 | unsigned long bta; /* bta_l1, bta_l2, erbta */ |
80 | 80 | ||
81 | long user_r25; | 81 | unsigned long user_r25; |
82 | 82 | ||
83 | long r26; /* gp */ | 83 | unsigned long r26; /* gp */ |
84 | long fp; | 84 | unsigned long fp; |
85 | long sp; /* user/kernel sp depending on where we came from */ | 85 | unsigned long sp; /* user/kernel sp depending on where we came from */ |
86 | 86 | ||
87 | long r12; | 87 | unsigned long r12; |
88 | 88 | ||
89 | /*------- Below list auto saved by h/w -----------*/ | 89 | /*------- Below list auto saved by h/w -----------*/ |
90 | long r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11; | 90 | unsigned long r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11; |
91 | 91 | ||
92 | long blink; | 92 | unsigned long blink; |
93 | long lp_end, lp_start, lp_count; | 93 | unsigned long lp_end, lp_start, lp_count; |
94 | 94 | ||
95 | long ei, ldi, jli; | 95 | unsigned long ei, ldi, jli; |
96 | 96 | ||
97 | long ret; | 97 | unsigned long ret; |
98 | long status32; | 98 | unsigned long status32; |
99 | }; | 99 | }; |
100 | 100 | ||
101 | #endif | 101 | #endif |
@@ -103,10 +103,10 @@ struct pt_regs { | |||
103 | /* Callee saved registers - need to be saved only when you are scheduled out */ | 103 | /* Callee saved registers - need to be saved only when you are scheduled out */ |
104 | 104 | ||
105 | struct callee_regs { | 105 | struct callee_regs { |
106 | long r25, r24, r23, r22, r21, r20, r19, r18, r17, r16, r15, r14, r13; | 106 | unsigned long r25, r24, r23, r22, r21, r20, r19, r18, r17, r16, r15, r14, r13; |
107 | }; | 107 | }; |
108 | 108 | ||
109 | #define instruction_pointer(regs) (unsigned long)((regs)->ret) | 109 | #define instruction_pointer(regs) ((regs)->ret) |
110 | #define profile_pc(regs) instruction_pointer(regs) | 110 | #define profile_pc(regs) instruction_pointer(regs) |
111 | 111 | ||
112 | /* return 1 if user mode or 0 if kernel mode */ | 112 | /* return 1 if user mode or 0 if kernel mode */ |
@@ -142,7 +142,7 @@ struct callee_regs { | |||
142 | 142 | ||
143 | static inline long regs_return_value(struct pt_regs *regs) | 143 | static inline long regs_return_value(struct pt_regs *regs) |
144 | { | 144 | { |
145 | return regs->r0; | 145 | return (long)regs->r0; |
146 | } | 146 | } |
147 | 147 | ||
148 | #endif /* !__ASSEMBLY__ */ | 148 | #endif /* !__ASSEMBLY__ */ |
diff --git a/arch/arc/include/uapi/asm/ptrace.h b/arch/arc/include/uapi/asm/ptrace.h index 76a7739aab1c..0b3ef63d4a03 100644 --- a/arch/arc/include/uapi/asm/ptrace.h +++ b/arch/arc/include/uapi/asm/ptrace.h | |||
@@ -32,20 +32,20 @@ | |||
32 | */ | 32 | */ |
33 | struct user_regs_struct { | 33 | struct user_regs_struct { |
34 | 34 | ||
35 | long pad; | 35 | unsigned long pad; |
36 | struct { | 36 | struct { |
37 | long bta, lp_start, lp_end, lp_count; | 37 | unsigned long bta, lp_start, lp_end, lp_count; |
38 | long status32, ret, blink, fp, gp; | 38 | unsigned long status32, ret, blink, fp, gp; |
39 | long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0; | 39 | unsigned long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0; |
40 | long sp; | 40 | unsigned long sp; |
41 | } scratch; | 41 | } scratch; |
42 | long pad2; | 42 | unsigned long pad2; |
43 | struct { | 43 | struct { |
44 | long r25, r24, r23, r22, r21, r20; | 44 | unsigned long r25, r24, r23, r22, r21, r20; |
45 | long r19, r18, r17, r16, r15, r14, r13; | 45 | unsigned long r19, r18, r17, r16, r15, r14, r13; |
46 | } callee; | 46 | } callee; |
47 | long efa; /* break pt addr, for break points in delay slots */ | 47 | unsigned long efa; /* break pt addr, for break points in delay slots */ |
48 | long stop_pc; /* give dbg stop_pc after ensuring brkpt trap */ | 48 | unsigned long stop_pc; /* give dbg stop_pc after ensuring brkpt trap */ |
49 | }; | 49 | }; |
50 | #endif /* !__ASSEMBLY__ */ | 50 | #endif /* !__ASSEMBLY__ */ |
51 | 51 | ||