diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2005-11-09 20:56:55 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-09 21:10:38 -0500 |
commit | 3ddfbcf19b15ccd25a0b4b2dc2e38000e08de739 (patch) | |
tree | ca77158ab291453ed39e87f2d81beef9e8d1a560 /include/asm-powerpc/ppc_asm.h | |
parent | f6d3577da14e877b79517c883d1139ee6ad7da45 (diff) |
[PATCH] powerpc: Consolidate asm compatibility macros
This patch consolidates macros used to generate assembly for
compatibility across different CPUs or configs. A new header,
asm-powerpc/asm-compat.h contains the main compatibility macros. It
uses some preprocessor magic to make the macros suitable both for use
in .S files, and in inline asm in .c files. Headers (bitops.h,
uaccess.h, atomic.h, bug.h) which had their own such compatibility
macros are changed to use asm-compat.h.
ppc_asm.h is now for use in .S files *only*, and a #error enforces
that. As such, we're a lot more careless about namespace pollution
here than in asm-compat.h.
While we're at it, this patch adds a call to the PPC405_ERR77 macro in
futex.h which should have had it already, but didn't.
Built and booted on pSeries, Maple and iSeries (ARCH=powerpc). Built
for 32-bit powermac (ARCH=powerpc) and Walnut (ARCH=ppc).
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/ppc_asm.h')
-rw-r--r-- | include/asm-powerpc/ppc_asm.h | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h index c534ca41224b..c27baa0563fe 100644 --- a/include/asm-powerpc/ppc_asm.h +++ b/include/asm-powerpc/ppc_asm.h | |||
@@ -6,8 +6,13 @@ | |||
6 | 6 | ||
7 | #include <linux/stringify.h> | 7 | #include <linux/stringify.h> |
8 | #include <linux/config.h> | 8 | #include <linux/config.h> |
9 | #include <asm/asm-compat.h> | ||
9 | 10 | ||
10 | #ifdef __ASSEMBLY__ | 11 | #ifndef __ASSEMBLY__ |
12 | #error __FILE__ should only be used in assembler files | ||
13 | #else | ||
14 | |||
15 | #define SZL (BITS_PER_LONG/8) | ||
11 | 16 | ||
12 | /* | 17 | /* |
13 | * Macros for storing registers into and loading registers from | 18 | * Macros for storing registers into and loading registers from |
@@ -184,12 +189,6 @@ n: | |||
184 | oris reg,reg,(label)@h; \ | 189 | oris reg,reg,(label)@h; \ |
185 | ori reg,reg,(label)@l; | 190 | ori reg,reg,(label)@l; |
186 | 191 | ||
187 | /* operations for longs and pointers */ | ||
188 | #define LDL ld | ||
189 | #define STL std | ||
190 | #define CMPI cmpdi | ||
191 | #define SZL 8 | ||
192 | |||
193 | /* offsets for stack frame layout */ | 192 | /* offsets for stack frame layout */ |
194 | #define LRSAVE 16 | 193 | #define LRSAVE 16 |
195 | 194 | ||
@@ -203,12 +202,6 @@ n: | |||
203 | 202 | ||
204 | #define OFF(name) name@l | 203 | #define OFF(name) name@l |
205 | 204 | ||
206 | /* operations for longs and pointers */ | ||
207 | #define LDL lwz | ||
208 | #define STL stw | ||
209 | #define CMPI cmpwi | ||
210 | #define SZL 4 | ||
211 | |||
212 | /* offsets for stack frame layout */ | 205 | /* offsets for stack frame layout */ |
213 | #define LRSAVE 4 | 206 | #define LRSAVE 4 |
214 | 207 | ||
@@ -266,15 +259,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
266 | #endif | 259 | #endif |
267 | 260 | ||
268 | 261 | ||
269 | #ifdef CONFIG_IBM405_ERR77 | ||
270 | #define PPC405_ERR77(ra,rb) dcbt ra, rb; | ||
271 | #define PPC405_ERR77_SYNC sync; | ||
272 | #else | ||
273 | #define PPC405_ERR77(ra,rb) | ||
274 | #define PPC405_ERR77_SYNC | ||
275 | #endif | ||
276 | |||
277 | |||
278 | #ifdef CONFIG_IBM440EP_ERR42 | 262 | #ifdef CONFIG_IBM440EP_ERR42 |
279 | #define PPC440EP_ERR42 isync | 263 | #define PPC440EP_ERR42 isync |
280 | #else | 264 | #else |
@@ -502,17 +486,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
502 | #define N_SLINE 68 | 486 | #define N_SLINE 68 |
503 | #define N_SO 100 | 487 | #define N_SO 100 |
504 | 488 | ||
505 | #define ASM_CONST(x) x | ||
506 | #else | ||
507 | #define __ASM_CONST(x) x##UL | ||
508 | #define ASM_CONST(x) __ASM_CONST(x) | ||
509 | |||
510 | #ifdef CONFIG_PPC64 | ||
511 | #define DATAL ".llong" | ||
512 | #else | ||
513 | #define DATAL ".long" | ||
514 | #endif | ||
515 | |||
516 | #endif /* __ASSEMBLY__ */ | 489 | #endif /* __ASSEMBLY__ */ |
517 | 490 | ||
518 | #endif /* _ASM_POWERPC_PPC_ASM_H */ | 491 | #endif /* _ASM_POWERPC_PPC_ASM_H */ |