diff options
author | David VomLehn <dvomlehn@cisco.com> | 2010-02-22 19:31:13 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-02-27 06:53:41 -0500 |
commit | 81fc0179541dd52763cf62a52f0c09a05bcc6439 (patch) | |
tree | b04013dfa4eb52cadb619577d95beb2c003247de /arch/mips | |
parent | 3b439470e360931ad65234f94aa92cd7362f635a (diff) |
MIPS: PowerTV: Eliminate duplicate opcode definition macros
Change to different macros for assembler macros since the old names in
powertv_setup.c were co-opted for use in asm/asm.h. This broken the
build for the powertv platform. This patch introduces new macros based on
the new macros in asm.h to take the place of the old macro values.
Signed-off-by: David VomLehn <dvomlehn@cisco.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/985/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/powertv/powertv_setup.c | 102 |
1 files changed, 49 insertions, 53 deletions
diff --git a/arch/mips/powertv/powertv_setup.c b/arch/mips/powertv/powertv_setup.c index 698b1eafbe98..af2cae0a5ab3 100644 --- a/arch/mips/powertv/powertv_setup.c +++ b/arch/mips/powertv/powertv_setup.c | |||
@@ -25,14 +25,15 @@ | |||
25 | #include <linux/etherdevice.h> | 25 | #include <linux/etherdevice.h> |
26 | #include <linux/if_ether.h> | 26 | #include <linux/if_ether.h> |
27 | #include <linux/ctype.h> | 27 | #include <linux/ctype.h> |
28 | |||
29 | #include <linux/cpu.h> | 28 | #include <linux/cpu.h> |
29 | #include <linux/time.h> | ||
30 | |||
30 | #include <asm/bootinfo.h> | 31 | #include <asm/bootinfo.h> |
31 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
32 | #include <asm/mips-boards/generic.h> | 33 | #include <asm/mips-boards/generic.h> |
33 | #include <asm/mips-boards/prom.h> | 34 | #include <asm/mips-boards/prom.h> |
34 | #include <asm/dma.h> | 35 | #include <asm/dma.h> |
35 | #include <linux/time.h> | 36 | #include <asm/asm.h> |
36 | #include <asm/traps.h> | 37 | #include <asm/traps.h> |
37 | #include <asm/asm-offsets.h> | 38 | #include <asm/asm-offsets.h> |
38 | #include "reset.h" | 39 | #include "reset.h" |
@@ -41,26 +42,21 @@ | |||
41 | 42 | ||
42 | /* | 43 | /* |
43 | * Macros for loading addresses and storing registers: | 44 | * Macros for loading addresses and storing registers: |
44 | * PTR_LA Load the address into a register | 45 | * LONG_L_ Stringified version of LONG_L for use in asm() statement |
45 | * LONG_S Store the full width of the given register. | 46 | * LONG_S_ Stringified version of LONG_S for use in asm() statement |
46 | * LONG_L Load the full width of the given register | 47 | * PTR_LA_ Stringified version of PTR_LA for use in asm() statement |
47 | * PTR_ADDIU Add a constant value to a register used as a pointer | ||
48 | * REG_SIZE Number of 8-bit bytes in a full width register | 48 | * REG_SIZE Number of 8-bit bytes in a full width register |
49 | */ | 49 | */ |
50 | #define LONG_L_ VAL(LONG_L) " " | ||
51 | #define LONG_S_ VAL(LONG_S) " " | ||
52 | #define PTR_LA_ VAL(PTR_LA) " " | ||
53 | |||
50 | #ifdef CONFIG_64BIT | 54 | #ifdef CONFIG_64BIT |
51 | #warning TODO: 64-bit code needs to be verified | 55 | #warning TODO: 64-bit code needs to be verified |
52 | #define PTR_LA "dla " | ||
53 | #define LONG_S "sd " | ||
54 | #define LONG_L "ld " | ||
55 | #define PTR_ADDIU "daddiu " | ||
56 | #define REG_SIZE "8" /* In bytes */ | 56 | #define REG_SIZE "8" /* In bytes */ |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #ifdef CONFIG_32BIT | 59 | #ifdef CONFIG_32BIT |
60 | #define PTR_LA "la " | ||
61 | #define LONG_S "sw " | ||
62 | #define LONG_L "lw " | ||
63 | #define PTR_ADDIU "addiu " | ||
64 | #define REG_SIZE "4" /* In bytes */ | 60 | #define REG_SIZE "4" /* In bytes */ |
65 | #endif | 61 | #endif |
66 | 62 | ||
@@ -113,9 +109,9 @@ static int panic_handler(struct notifier_block *notifier_block, | |||
113 | * structure. */ | 109 | * structure. */ |
114 | __asm__ __volatile__ ( | 110 | __asm__ __volatile__ ( |
115 | ".set noat\n" | 111 | ".set noat\n" |
116 | LONG_S "$at, %[at]\n" | 112 | LONG_S_ "$at, %[at]\n" |
117 | LONG_S "$2, %[v0]\n" | 113 | LONG_S_ "$2, %[v0]\n" |
118 | LONG_S "$3, %[v1]\n" | 114 | LONG_S_ "$3, %[v1]\n" |
119 | : | 115 | : |
120 | [at] "=m" (at), | 116 | [at] "=m" (at), |
121 | [v0] "=m" (v0), | 117 | [v0] "=m" (v0), |
@@ -129,54 +125,54 @@ static int panic_handler(struct notifier_block *notifier_block, | |||
129 | "move $at, %[pt_regs]\n" | 125 | "move $at, %[pt_regs]\n" |
130 | 126 | ||
131 | /* Argument registers */ | 127 | /* Argument registers */ |
132 | LONG_S "$4, " VAL(PT_R4) "($at)\n" | 128 | LONG_S_ "$4, " VAL(PT_R4) "($at)\n" |
133 | LONG_S "$5, " VAL(PT_R5) "($at)\n" | 129 | LONG_S_ "$5, " VAL(PT_R5) "($at)\n" |
134 | LONG_S "$6, " VAL(PT_R6) "($at)\n" | 130 | LONG_S_ "$6, " VAL(PT_R6) "($at)\n" |
135 | LONG_S "$7, " VAL(PT_R7) "($at)\n" | 131 | LONG_S_ "$7, " VAL(PT_R7) "($at)\n" |
136 | 132 | ||
137 | /* Temporary regs */ | 133 | /* Temporary regs */ |
138 | LONG_S "$8, " VAL(PT_R8) "($at)\n" | 134 | LONG_S_ "$8, " VAL(PT_R8) "($at)\n" |
139 | LONG_S "$9, " VAL(PT_R9) "($at)\n" | 135 | LONG_S_ "$9, " VAL(PT_R9) "($at)\n" |
140 | LONG_S "$10, " VAL(PT_R10) "($at)\n" | 136 | LONG_S_ "$10, " VAL(PT_R10) "($at)\n" |
141 | LONG_S "$11, " VAL(PT_R11) "($at)\n" | 137 | LONG_S_ "$11, " VAL(PT_R11) "($at)\n" |
142 | LONG_S "$12, " VAL(PT_R12) "($at)\n" | 138 | LONG_S_ "$12, " VAL(PT_R12) "($at)\n" |
143 | LONG_S "$13, " VAL(PT_R13) "($at)\n" | 139 | LONG_S_ "$13, " VAL(PT_R13) "($at)\n" |
144 | LONG_S "$14, " VAL(PT_R14) "($at)\n" | 140 | LONG_S_ "$14, " VAL(PT_R14) "($at)\n" |
145 | LONG_S "$15, " VAL(PT_R15) "($at)\n" | 141 | LONG_S_ "$15, " VAL(PT_R15) "($at)\n" |
146 | 142 | ||
147 | /* "Saved" registers */ | 143 | /* "Saved" registers */ |
148 | LONG_S "$16, " VAL(PT_R16) "($at)\n" | 144 | LONG_S_ "$16, " VAL(PT_R16) "($at)\n" |
149 | LONG_S "$17, " VAL(PT_R17) "($at)\n" | 145 | LONG_S_ "$17, " VAL(PT_R17) "($at)\n" |
150 | LONG_S "$18, " VAL(PT_R18) "($at)\n" | 146 | LONG_S_ "$18, " VAL(PT_R18) "($at)\n" |
151 | LONG_S "$19, " VAL(PT_R19) "($at)\n" | 147 | LONG_S_ "$19, " VAL(PT_R19) "($at)\n" |
152 | LONG_S "$20, " VAL(PT_R20) "($at)\n" | 148 | LONG_S_ "$20, " VAL(PT_R20) "($at)\n" |
153 | LONG_S "$21, " VAL(PT_R21) "($at)\n" | 149 | LONG_S_ "$21, " VAL(PT_R21) "($at)\n" |
154 | LONG_S "$22, " VAL(PT_R22) "($at)\n" | 150 | LONG_S_ "$22, " VAL(PT_R22) "($at)\n" |
155 | LONG_S "$23, " VAL(PT_R23) "($at)\n" | 151 | LONG_S_ "$23, " VAL(PT_R23) "($at)\n" |
156 | 152 | ||
157 | /* Add'l temp regs */ | 153 | /* Add'l temp regs */ |
158 | LONG_S "$24, " VAL(PT_R24) "($at)\n" | 154 | LONG_S_ "$24, " VAL(PT_R24) "($at)\n" |
159 | LONG_S "$25, " VAL(PT_R25) "($at)\n" | 155 | LONG_S_ "$25, " VAL(PT_R25) "($at)\n" |
160 | 156 | ||
161 | /* Kernel temp regs */ | 157 | /* Kernel temp regs */ |
162 | LONG_S "$26, " VAL(PT_R26) "($at)\n" | 158 | LONG_S_ "$26, " VAL(PT_R26) "($at)\n" |
163 | LONG_S "$27, " VAL(PT_R27) "($at)\n" | 159 | LONG_S_ "$27, " VAL(PT_R27) "($at)\n" |
164 | 160 | ||
165 | /* Global pointer, stack pointer, frame pointer and | 161 | /* Global pointer, stack pointer, frame pointer and |
166 | * return address */ | 162 | * return address */ |
167 | LONG_S "$gp, " VAL(PT_R28) "($at)\n" | 163 | LONG_S_ "$gp, " VAL(PT_R28) "($at)\n" |
168 | LONG_S "$sp, " VAL(PT_R29) "($at)\n" | 164 | LONG_S_ "$sp, " VAL(PT_R29) "($at)\n" |
169 | LONG_S "$fp, " VAL(PT_R30) "($at)\n" | 165 | LONG_S_ "$fp, " VAL(PT_R30) "($at)\n" |
170 | LONG_S "$ra, " VAL(PT_R31) "($at)\n" | 166 | LONG_S_ "$ra, " VAL(PT_R31) "($at)\n" |
171 | 167 | ||
172 | /* Now we can get the $at and v0 registers back and | 168 | /* Now we can get the $at and v0 registers back and |
173 | * store them */ | 169 | * store them */ |
174 | LONG_L "$8, %[at]\n" | 170 | LONG_L_ "$8, %[at]\n" |
175 | LONG_S "$8, " VAL(PT_R1) "($at)\n" | 171 | LONG_S_ "$8, " VAL(PT_R1) "($at)\n" |
176 | LONG_L "$8, %[v0]\n" | 172 | LONG_L_ "$8, %[v0]\n" |
177 | LONG_S "$8, " VAL(PT_R2) "($at)\n" | 173 | LONG_S_ "$8, " VAL(PT_R2) "($at)\n" |
178 | LONG_L "$8, %[v1]\n" | 174 | LONG_L_ "$8, %[v1]\n" |
179 | LONG_S "$8, " VAL(PT_R3) "($at)\n" | 175 | LONG_S_ "$8, " VAL(PT_R3) "($at)\n" |
180 | : | 176 | : |
181 | : | 177 | : |
182 | [at] "m" (at), | 178 | [at] "m" (at), |
@@ -191,8 +187,8 @@ static int panic_handler(struct notifier_block *notifier_block, | |||
191 | __asm__ __volatile__ ( | 187 | __asm__ __volatile__ ( |
192 | ".set noat\n" | 188 | ".set noat\n" |
193 | "1:\n" | 189 | "1:\n" |
194 | PTR_LA "$at, 1b\n" | 190 | PTR_LA_ "$at, 1b\n" |
195 | LONG_S "$at, %[cp0_epc]\n" | 191 | LONG_S_ "$at, %[cp0_epc]\n" |
196 | : | 192 | : |
197 | [cp0_epc] "=m" (my_regs.cp0_epc) | 193 | [cp0_epc] "=m" (my_regs.cp0_epc) |
198 | : | 194 | : |