aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/feature-fixups.h
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2008-06-23 21:32:39 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 21:28:25 -0400
commitc5157e587b33b1185cf73207fc53760cf1351430 (patch)
tree996a4e76bae11001a8e97141c617c159dde37ec8 /include/asm-powerpc/feature-fixups.h
parent51c52e86694f19e84600a40f6156889feafd8ae9 (diff)
powerpc: Consolidate CPU and firmware feature fixup macros
The CPU and firmware feature fixup macros are currently spread across three files, firmware.h, cputable.h and asm-compat.h. Consolidate them into their own file, feature-fixups.h 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/feature-fixups.h')
-rw-r--r--include/asm-powerpc/feature-fixups.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/include/asm-powerpc/feature-fixups.h b/include/asm-powerpc/feature-fixups.h
new file mode 100644
index 000000000000..85972125bbb8
--- /dev/null
+++ b/include/asm-powerpc/feature-fixups.h
@@ -0,0 +1,102 @@
1#ifndef __ASM_POWERPC_FEATURE_FIXUPS_H
2#define __ASM_POWERPC_FEATURE_FIXUPS_H
3
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifdef __ASSEMBLY__
12
13/*
14 * Feature section common macros
15 *
16 * Note that the entries now contain offsets between the table entry
17 * and the code rather than absolute code pointers in order to be
18 * useable with the vdso shared library. There is also an assumption
19 * that values will be negative, that is, the fixup table has to be
20 * located after the code it fixes up.
21 */
22#ifdef CONFIG_PPC64
23
24#ifdef __powerpc64__
25
26/* 64 bits kernel, 64 bits code */
27#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \
2899: \
29 .section sect,"a"; \
30 .align 3; \
3198: \
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) */
41#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \
4299: \
43 .section sect,"a"; \
44 .align 3; \
4598: \
46 .llong msk; \
47 .llong val; \
48 .long 0xffffffff; \
49 .long label##b-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) \
6099: \
61 .section sect,"a"; \
62 .align 2; \
6398: \
64 .long msk; \
65 .long val; \
66 .long label##b-98b; \
67 .long 99b-98b; \
68 .previous
69
70#endif /* !CONFIG_PPC64 */
71
72
73/* CPU feature dependent sections */
74#define BEGIN_FTR_SECTION_NESTED(label) label:
75#define BEGIN_FTR_SECTION BEGIN_FTR_SECTION_NESTED(97)
76
77#define END_FTR_SECTION_NESTED(msk, val, label) \
78 MAKE_FTR_SECTION_ENTRY(msk, val, label, __ftr_fixup)
79
80#define END_FTR_SECTION(msk, val) \
81 END_FTR_SECTION_NESTED(msk, val, 97)
82
83#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk))
84#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0)
85
86
87/* Firmware feature dependent sections */
88#define BEGIN_FW_FTR_SECTION_NESTED(label) label:
89#define BEGIN_FW_FTR_SECTION BEGIN_FW_FTR_SECTION_NESTED(97)
90
91#define END_FW_FTR_SECTION_NESTED(msk, val, label) \
92 MAKE_FTR_SECTION_ENTRY(msk, val, label, __fw_ftr_fixup)
93
94#define END_FW_FTR_SECTION(msk, val) \
95 END_FW_FTR_SECTION_NESTED(msk, val, 97)
96
97#define END_FW_FTR_SECTION_IFSET(msk) END_FW_FTR_SECTION((msk), (msk))
98#define END_FW_FTR_SECTION_IFCLR(msk) END_FW_FTR_SECTION((msk), 0)
99
100#endif /* __ASSEMBLY__ */
101
102#endif /* __ASM_POWERPC_FEATURE_FIXUPS_H */