diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-06-23 21:32:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-30 21:28:26 -0400 |
commit | c1137c37a9370f510dc022e6e95fff036ccb90be (patch) | |
tree | 96fd89dd4daa06178ade06558f6ab489791be667 /include/asm-powerpc | |
parent | c5157e587b33b1185cf73207fc53760cf1351430 (diff) |
powerpc: Consolidate feature fixup macros for 64/32 bit
Currently we have three versions of MAKE_FTR_SECTION_ENTRY(), the macro that
generates a feature section entry. There is 64bit version, a 32bit version
and version for 32bit code built with a 64bit kernel.
Rather than triplicating (?) the MAKE_FTR_SECTION_ENTRY() logic, we can
move the 64bit/32bit differences into separate macros, and then only have
one version of MAKE_FTR_SECTION_ENTRY().
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/feature-fixups.h | 54 |
1 files changed, 13 insertions, 41 deletions
diff --git a/include/asm-powerpc/feature-fixups.h b/include/asm-powerpc/feature-fixups.h index 85972125bbb8..35f927888fe8 100644 --- a/include/asm-powerpc/feature-fixups.h +++ b/include/asm-powerpc/feature-fixups.h | |||
@@ -19,55 +19,27 @@ | |||
19 | * that values will be negative, that is, the fixup table has to be | 19 | * that values will be negative, that is, the fixup table has to be |
20 | * located after the code it fixes up. | 20 | * located after the code it fixes up. |
21 | */ | 21 | */ |
22 | #ifdef CONFIG_PPC64 | 22 | #if defined(CONFIG_PPC64) && !defined(__powerpc64__) |
23 | |||
24 | #ifdef __powerpc64__ | ||
25 | |||
26 | /* 64 bits kernel, 64 bits code */ | ||
27 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ | ||
28 | 99: \ | ||
29 | .section sect,"a"; \ | ||
30 | .align 3; \ | ||
31 | 98: \ | ||
32 | .llong msk; \ | ||
33 | .llong val; \ | ||
34 | .llong label##b-98b; \ | ||
35 | .llong 99b-98b; \ | ||
36 | .previous | ||
37 | |||
38 | #else /* __powerpc64__ */ | ||
39 | |||
40 | /* 64 bits kernel, 32 bits code (ie. vdso32) */ | 23 | /* 64 bits kernel, 32 bits code (ie. vdso32) */ |
24 | #define FTR_ENTRY_LONG .llong | ||
25 | #define FTR_ENTRY_OFFSET .long 0xffffffff; .long | ||
26 | #else | ||
27 | /* 64 bit kernel 64 bit code, or 32 bit kernel 32 bit code */ | ||
28 | #define FTR_ENTRY_LONG PPC_LONG | ||
29 | #define FTR_ENTRY_OFFSET PPC_LONG | ||
30 | #endif | ||
31 | |||
41 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ | 32 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ |
42 | 99: \ | 33 | 99: \ |
43 | .section sect,"a"; \ | 34 | .section sect,"a"; \ |
44 | .align 3; \ | 35 | .align 3; \ |
45 | 98: \ | 36 | 98: \ |
46 | .llong msk; \ | 37 | FTR_ENTRY_LONG msk; \ |
47 | .llong val; \ | 38 | FTR_ENTRY_LONG val; \ |
48 | .long 0xffffffff; \ | 39 | FTR_ENTRY_OFFSET label##b-98b; \ |
49 | .long label##b-98b; \ | 40 | FTR_ENTRY_OFFSET 99b-98b; \ |
50 | .long 0xffffffff; \ | ||
51 | .long 99b-98b; \ | ||
52 | .previous | ||
53 | |||
54 | #endif /* !__powerpc64__ */ | ||
55 | |||
56 | #else /* CONFIG_PPC64 */ | ||
57 | |||
58 | /* 32 bits kernel, 32 bits code */ | ||
59 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ | ||
60 | 99: \ | ||
61 | .section sect,"a"; \ | ||
62 | .align 2; \ | ||
63 | 98: \ | ||
64 | .long msk; \ | ||
65 | .long val; \ | ||
66 | .long label##b-98b; \ | ||
67 | .long 99b-98b; \ | ||
68 | .previous | 41 | .previous |
69 | 42 | ||
70 | #endif /* !CONFIG_PPC64 */ | ||
71 | 43 | ||
72 | 44 | ||
73 | /* CPU feature dependent sections */ | 45 | /* CPU feature dependent sections */ |