summaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/processor.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-07-07 17:56:11 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 18:23:37 -0700
commita2f7a9ce2a5c3d21cc0eb37a03da603b44ba4b09 (patch)
tree20d782192f849d9f8f1eabd465246e8fd292324a /include/asm-ppc64/processor.h
parent315a699851722a6bc31e35f91562f31f55d4c4a2 (diff)
downloadop-kernel-dev-a2f7a9ce2a5c3d21cc0eb37a03da603b44ba4b09.zip
op-kernel-dev-a2f7a9ce2a5c3d21cc0eb37a03da603b44ba4b09.tar.gz
[PATCH] ppc64: Fix runlatch code to work on pseries machines
Not all ppc64 CPUs have the CTRL SPR, so we need a cputable feature for it. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-ppc64/processor.h')
-rw-r--r--include/asm-ppc64/processor.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index af28aa5..06aa07c 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -20,6 +20,7 @@
#include <asm/ptrace.h>
#include <asm/types.h>
#include <asm/systemcfg.h>
+#include <asm/cputable.h>
/* Machine State Register (MSR) Fields */
#define MSR_SF_LG 63 /* Enable 64 bit mode */
@@ -501,18 +502,22 @@ static inline void ppc64_runlatch_on(void)
{
unsigned long ctrl;
- ctrl = mfspr(SPRN_CTRLF);
- ctrl |= CTRL_RUNLATCH;
- mtspr(SPRN_CTRLT, ctrl);
+ if (cpu_has_feature(CPU_FTR_CTRL)) {
+ ctrl = mfspr(SPRN_CTRLF);
+ ctrl |= CTRL_RUNLATCH;
+ mtspr(SPRN_CTRLT, ctrl);
+ }
}
static inline void ppc64_runlatch_off(void)
{
unsigned long ctrl;
- ctrl = mfspr(SPRN_CTRLF);
- ctrl &= ~CTRL_RUNLATCH;
- mtspr(SPRN_CTRLT, ctrl);
+ if (cpu_has_feature(CPU_FTR_CTRL)) {
+ ctrl = mfspr(SPRN_CTRLF);
+ ctrl &= ~CTRL_RUNLATCH;
+ mtspr(SPRN_CTRLT, ctrl);
+ }
}
#endif /* __KERNEL__ */
OpenPOWER on IntegriCloud