Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

locking, m68k/asm-offsets: Rename pt_regs offset defines

In order to be able to use asm-offsets.h in C files the
existing namespace conflicts must be solved first. In
asm-offsets.h e.g. PT_D0 gets defined which is the offset of
the d0 member of the pt_regs structure. However a same define
(with a different meaning) exists in asm/ptregs.h.

So rename the defines created with the asm-offset mechanism to
PT_OFF_D0 etc. There also already exist a few defines with
these names that have the same meaning. So remove the existing
defines and use the asm-offset generated ones.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Horst Hartmann <horsth@linux.vnet.ibm.com>
Cc: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Miller <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: <linux-arch@vger.kernel.org>
LKML-Reference: <20090831124416.666403991@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Heiko Carstens and committed by
Ingo Molnar
f159ee78 9f34ceb6

+53 -56
-3
arch/m68k/include/asm/entry_mm.h
··· 118 118 #define STR(X) STR1(X) 119 119 #define STR1(X) #X 120 120 121 - #define PT_OFF_ORIG_D0 0x24 122 - #define PT_OFF_FORMATVEC 0x32 123 - #define PT_OFF_SR 0x2C 124 121 #define SAVE_ALL_INT \ 125 122 "clrl %%sp@-;" /* stk_adj */ \ 126 123 "pea -1:w;" /* orig d0 = -1 */ \
+4 -4
arch/m68k/include/asm/entry_no.h
··· 72 72 lea %sp@(-32),%sp /* space for 8 regs */ 73 73 moveml %d1-%d5/%a0-%a2,%sp@ 74 74 movel sw_usp,%a0 /* get usp */ 75 - movel %a0@-,%sp@(PT_PC) /* copy exception program counter */ 76 - movel %a0@-,%sp@(PT_FORMATVEC)/* copy exception format/vector/sr */ 75 + movel %a0@-,%sp@(PT_OFF_PC) /* copy exception program counter */ 76 + movel %a0@-,%sp@(PT_OFF_FORMATVEC)/*copy exception format/vector/sr */ 77 77 bra 7f 78 78 6: 79 79 clrl %sp@- /* stkadj */ ··· 89 89 bnes 8f /* no, skip */ 90 90 move #0x2700,%sr /* disable intrs */ 91 91 movel sw_usp,%a0 /* get usp */ 92 - movel %sp@(PT_PC),%a0@- /* copy exception program counter */ 93 - movel %sp@(PT_FORMATVEC),%a0@-/* copy exception format/vector/sr */ 92 + movel %sp@(PT_OFF_PC),%a0@- /* copy exception program counter */ 93 + movel %sp@(PT_OFF_FORMATVEC),%a0@-/*copy exception format/vector/sr */ 94 94 moveml %sp@,%d1-%d5/%a0-%a2 95 95 lea %sp@(32),%sp /* space for 8 regs */ 96 96 movel %sp@+,%d0
+10 -10
arch/m68k/include/asm/math-emu.h
··· 145 145 * these are only used during instruction decoding 146 146 * where we always know how deep we're on the stack. 147 147 */ 148 - #define FPS_DO (PT_D0) 149 - #define FPS_D1 (PT_D1) 150 - #define FPS_D2 (PT_D2) 151 - #define FPS_A0 (PT_A0) 152 - #define FPS_A1 (PT_A1) 153 - #define FPS_A2 (PT_A2) 154 - #define FPS_SR (PT_SR) 155 - #define FPS_PC (PT_PC) 156 - #define FPS_EA (PT_PC+6) 157 - #define FPS_PC2 (PT_PC+10) 148 + #define FPS_DO (PT_OFF_D0) 149 + #define FPS_D1 (PT_OFF_D1) 150 + #define FPS_D2 (PT_OFF_D2) 151 + #define FPS_A0 (PT_OFF_A0) 152 + #define FPS_A1 (PT_OFF_A1) 153 + #define FPS_A2 (PT_OFF_A2) 154 + #define FPS_SR (PT_OFF_SR) 155 + #define FPS_PC (PT_OFF_PC) 156 + #define FPS_EA (PT_OFF_PC+6) 157 + #define FPS_PC2 (PT_OFF_PC+10) 158 158 159 159 .macro fp_get_fp_reg 160 160 lea (FPD_FPREG,FPDATA,%d0.w*4),%a0
+13 -13
arch/m68k/kernel/asm-offsets.c
··· 44 44 DEFINE(TINFO_FLAGS, offsetof(struct thread_info, flags)); 45 45 46 46 /* offsets into the pt_regs */ 47 - DEFINE(PT_D0, offsetof(struct pt_regs, d0)); 48 - DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); 49 - DEFINE(PT_D1, offsetof(struct pt_regs, d1)); 50 - DEFINE(PT_D2, offsetof(struct pt_regs, d2)); 51 - DEFINE(PT_D3, offsetof(struct pt_regs, d3)); 52 - DEFINE(PT_D4, offsetof(struct pt_regs, d4)); 53 - DEFINE(PT_D5, offsetof(struct pt_regs, d5)); 54 - DEFINE(PT_A0, offsetof(struct pt_regs, a0)); 55 - DEFINE(PT_A1, offsetof(struct pt_regs, a1)); 56 - DEFINE(PT_A2, offsetof(struct pt_regs, a2)); 57 - DEFINE(PT_PC, offsetof(struct pt_regs, pc)); 58 - DEFINE(PT_SR, offsetof(struct pt_regs, sr)); 47 + DEFINE(PT_OFF_D0, offsetof(struct pt_regs, d0)); 48 + DEFINE(PT_OFF_ORIG_D0, offsetof(struct pt_regs, orig_d0)); 49 + DEFINE(PT_OFF_D1, offsetof(struct pt_regs, d1)); 50 + DEFINE(PT_OFF_D2, offsetof(struct pt_regs, d2)); 51 + DEFINE(PT_OFF_D3, offsetof(struct pt_regs, d3)); 52 + DEFINE(PT_OFF_D4, offsetof(struct pt_regs, d4)); 53 + DEFINE(PT_OFF_D5, offsetof(struct pt_regs, d5)); 54 + DEFINE(PT_OFF_A0, offsetof(struct pt_regs, a0)); 55 + DEFINE(PT_OFF_A1, offsetof(struct pt_regs, a1)); 56 + DEFINE(PT_OFF_A2, offsetof(struct pt_regs, a2)); 57 + DEFINE(PT_OFF_PC, offsetof(struct pt_regs, pc)); 58 + DEFINE(PT_OFF_SR, offsetof(struct pt_regs, sr)); 59 59 /* bitfields are a bit difficult */ 60 - DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4); 60 + DEFINE(PT_OFF_FORMATVEC, offsetof(struct pt_regs, pc) + 4); 61 61 62 62 /* offsets into the irq_handler struct */ 63 63 DEFINE(IRQ_HANDLER, offsetof(struct irq_node, handler));
+11 -11
arch/m68k/kernel/entry.S
··· 77 77 jra .Lret_from_exception 78 78 79 79 do_trace_entry: 80 - movel #-ENOSYS,%sp@(PT_D0) | needed for strace 80 + movel #-ENOSYS,%sp@(PT_OFF_D0)| needed for strace 81 81 subql #4,%sp 82 82 SAVE_SWITCH_STACK 83 83 jbsr syscall_trace 84 84 RESTORE_SWITCH_STACK 85 85 addql #4,%sp 86 - movel %sp@(PT_ORIG_D0),%d0 86 + movel %sp@(PT_OFF_ORIG_D0),%d0 87 87 cmpl #NR_syscalls,%d0 88 88 jcs syscall 89 89 badsys: 90 - movel #-ENOSYS,%sp@(PT_D0) 90 + movel #-ENOSYS,%sp@(PT_OFF_D0) 91 91 jra ret_from_syscall 92 92 93 93 do_trace_exit: ··· 103 103 addql #4,%sp 104 104 /* on 68040 complete pending writebacks if any */ 105 105 #ifdef CONFIG_M68040 106 - bfextu %sp@(PT_VECTOR){#0,#4},%d0 106 + bfextu %sp@(PT_OFF_FORMATVEC){#0,#4},%d0 107 107 subql #7,%d0 | bus error frame ? 108 108 jbne 1f 109 109 movel %sp,%sp@- ··· 127 127 jcc badsys 128 128 syscall: 129 129 jbsr @(sys_call_table,%d0:l:4)@(0) 130 - movel %d0,%sp@(PT_D0) | save the return value 130 + movel %d0,%sp@(PT_OFF_D0) | save the return value 131 131 ret_from_syscall: 132 132 |oriw #0x0700,%sr 133 133 movew %curptr@(TASK_INFO+TINFO_FLAGS+2),%d0 ··· 135 135 1: RESTORE_ALL 136 136 137 137 syscall_exit_work: 138 - btst #5,%sp@(PT_SR) | check if returning to kernel 138 + btst #5,%sp@(PT_OFF_SR) | check if returning to kernel 139 139 bnes 1b | if so, skip resched, signals 140 140 lslw #1,%d0 141 141 jcs do_trace_exit ··· 148 148 149 149 ENTRY(ret_from_exception) 150 150 .Lret_from_exception: 151 - btst #5,%sp@(PT_SR) | check if returning to kernel 151 + btst #5,%sp@(PT_OFF_SR) | check if returning to kernel 152 152 bnes 1f | if so, skip resched, signals 153 153 | only allow interrupts when we are really the last one on the 154 154 | kernel stack, otherwise stack overflow can occur during ··· 182 182 jbra resume_userspace 183 183 184 184 do_delayed_trace: 185 - bclr #7,%sp@(PT_SR) | clear trace bit in SR 185 + bclr #7,%sp@(PT_OFF_SR) | clear trace bit in SR 186 186 pea 1 | send SIGTRAP 187 187 movel %curptr,%sp@- 188 188 pea LSIGTRAP ··· 199 199 GET_CURRENT(%d0) 200 200 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 201 201 | put exception # in d0 202 - bfextu %sp@(PT_VECTOR){#4,#10},%d0 202 + bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 203 203 subw #VEC_SPUR,%d0 204 204 205 205 movel %sp,%sp@- ··· 216 216 ALIGN 217 217 ret_from_last_interrupt: 218 218 moveq #(~ALLOWINT>>8)&0xff,%d0 219 - andb %sp@(PT_SR),%d0 219 + andb %sp@(PT_OFF_SR),%d0 220 220 jne 2b 221 221 222 222 /* check if we need to do software interrupts */ ··· 232 232 GET_CURRENT(%d0) 233 233 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 234 234 | put exception # in d0 235 - bfextu %sp@(PT_VECTOR){#4,#10},%d0 235 + bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 236 236 user_irqvec_fixup = . + 2 237 237 subw #VEC_USER,%d0 238 238
+15 -15
arch/m68k/math-emu/fp_entry.S
··· 122 122 .long fp_get_d6, fp_get_d7 123 123 124 124 fp_get_d0: 125 - move.l (PT_D0+8,%sp),%d0 125 + move.l (PT_OFF_D0+8,%sp),%d0 126 126 printf PREGISTER,"{d0->%08x}",1,%d0 127 127 rts 128 128 129 129 fp_get_d1: 130 - move.l (PT_D1+8,%sp),%d0 130 + move.l (PT_OFF_D1+8,%sp),%d0 131 131 printf PREGISTER,"{d1->%08x}",1,%d0 132 132 rts 133 133 134 134 fp_get_d2: 135 - move.l (PT_D2+8,%sp),%d0 135 + move.l (PT_OFF_D2+8,%sp),%d0 136 136 printf PREGISTER,"{d2->%08x}",1,%d0 137 137 rts 138 138 ··· 173 173 174 174 fp_put_d0: 175 175 printf PREGISTER,"{d0<-%08x}",1,%d0 176 - move.l %d0,(PT_D0+8,%sp) 176 + move.l %d0,(PT_OFF_D0+8,%sp) 177 177 rts 178 178 179 179 fp_put_d1: 180 180 printf PREGISTER,"{d1<-%08x}",1,%d0 181 - move.l %d0,(PT_D1+8,%sp) 181 + move.l %d0,(PT_OFF_D1+8,%sp) 182 182 rts 183 183 184 184 fp_put_d2: 185 185 printf PREGISTER,"{d2<-%08x}",1,%d0 186 - move.l %d0,(PT_D2+8,%sp) 186 + move.l %d0,(PT_OFF_D2+8,%sp) 187 187 rts 188 188 189 189 fp_put_d3: 190 190 printf PREGISTER,"{d3<-%08x}",1,%d0 191 191 | move.l %d0,%d3 192 - move.l %d0,(PT_D3+8,%sp) 192 + move.l %d0,(PT_OFF_D3+8,%sp) 193 193 rts 194 194 195 195 fp_put_d4: 196 196 printf PREGISTER,"{d4<-%08x}",1,%d0 197 197 | move.l %d0,%d4 198 - move.l %d0,(PT_D4+8,%sp) 198 + move.l %d0,(PT_OFF_D4+8,%sp) 199 199 rts 200 200 201 201 fp_put_d5: 202 202 printf PREGISTER,"{d5<-%08x}",1,%d0 203 203 | move.l %d0,%d5 204 - move.l %d0,(PT_D5+8,%sp) 204 + move.l %d0,(PT_OFF_D5+8,%sp) 205 205 rts 206 206 207 207 fp_put_d6: ··· 225 225 .long fp_get_a6, fp_get_a7 226 226 227 227 fp_get_a0: 228 - move.l (PT_A0+8,%sp),%a0 228 + move.l (PT_OFF_A0+8,%sp),%a0 229 229 printf PREGISTER,"{a0->%08x}",1,%a0 230 230 rts 231 231 232 232 fp_get_a1: 233 - move.l (PT_A1+8,%sp),%a0 233 + move.l (PT_OFF_A1+8,%sp),%a0 234 234 printf PREGISTER,"{a1->%08x}",1,%a0 235 235 rts 236 236 237 237 fp_get_a2: 238 - move.l (PT_A2+8,%sp),%a0 238 + move.l (PT_OFF_A2+8,%sp),%a0 239 239 printf PREGISTER,"{a2->%08x}",1,%a0 240 240 rts 241 241 ··· 276 276 277 277 fp_put_a0: 278 278 printf PREGISTER,"{a0<-%08x}",1,%a0 279 - move.l %a0,(PT_A0+8,%sp) 279 + move.l %a0,(PT_OFF_A0+8,%sp) 280 280 rts 281 281 282 282 fp_put_a1: 283 283 printf PREGISTER,"{a1<-%08x}",1,%a0 284 - move.l %a0,(PT_A1+8,%sp) 284 + move.l %a0,(PT_OFF_A1+8,%sp) 285 285 rts 286 286 287 287 fp_put_a2: 288 288 printf PREGISTER,"{a2<-%08x}",1,%a0 289 - move.l %a0,(PT_A2+8,%sp) 289 + move.l %a0,(PT_OFF_A2+8,%sp) 290 290 rts 291 291 292 292 fp_put_a3: