summaryrefslogtreecommitdiff
path: root/include/asm-powerpc/feature-fixups.h
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-07-02 01:16:40 +1000
committerPaul Mackerras <paulus@samba.org>2008-07-03 16:58:10 +1000
commit2d1b2027626d5151fff8ef7c06ca8e7876a1a510 (patch)
tree6ecc861f4f45a5d26309bf12683aa0372358ef7c /include/asm-powerpc/feature-fixups.h
parent5888da18765ca9af7f10015263d8bc8e3057f128 (diff)
downloadlwn-2d1b2027626d5151fff8ef7c06ca8e7876a1a510.tar.gz
lwn-2d1b2027626d5151fff8ef7c06ca8e7876a1a510.zip
powerpc: Fixup lwsync at runtime
To allow for a single kernel image on e500 v1/v2/mc we need to fixup lwsync at runtime. On e500v1/v2 lwsync causes an illop so we need to patch up the code. We default to 'sync' since that is always safe and if the cpu is capable we will replace 'sync' with 'lwsync'. We introduce CPU_FTR_LWSYNC as a way to determine at runtime if this is needed. This flag could be moved elsewhere since we dont really use it for the normal CPU_FTR purpose. Finally we only store the relative offset in the fixup section to keep it as small as possible rather than using a full fixup_entry. Signed-off-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.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-powerpc/feature-fixups.h b/include/asm-powerpc/feature-fixups.h
index ab30129dced7..a1029967620b 100644
--- a/include/asm-powerpc/feature-fixups.h
+++ b/include/asm-powerpc/feature-fixups.h
@@ -113,4 +113,14 @@ label##5: \
#endif /* __ASSEMBLY__ */
+/* LWSYNC feature sections */
+#define START_LWSYNC_SECTION(label) label##1:
+#define MAKE_LWSYNC_SECTION_ENTRY(label, sect) \
+label##2: \
+ .pushsection sect,"a"; \
+ .align 2; \
+label##3: \
+ .long label##1b-label##3b; \
+ .popsection;
+
#endif /* __ASM_POWERPC_FEATURE_FIXUPS_H */