aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-01-24 02:42:41 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-19 21:03:24 -0400
commit948cf67c4726cca2fc57533dccadfb54d890689d (patch)
treee763f1b49f66cf2c73b5a902063e2cb828e5d06c /arch/powerpc/include/asm
parent9d07bc841c9779b4d7902e417f4e509996ce805d (diff)
powerpc: Add NAP mode support on Power7 in HV mode
Wakeup comes from the system reset handler with a potential loss of the non-hypervisor CPU state. We save the non-volatile state on the stack and a pointer to it in the PACA, which the system reset handler uses to restore things Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r--arch/powerpc/include/asm/machdep.h1
-rw-r--r--arch/powerpc/include/asm/paca.h2
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h6
3 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index e4f01915fbb0..493dbb38e1ba 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -267,6 +267,7 @@ struct machdep_calls {
267 267
268extern void e500_idle(void); 268extern void e500_idle(void);
269extern void power4_idle(void); 269extern void power4_idle(void);
270extern void power7_idle(void);
270extern void ppc6xx_idle(void); 271extern void ppc6xx_idle(void);
271extern void book3e_idle(void); 272extern void book3e_idle(void);
272 273
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index ec57540cd7af..f6da4f517fca 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -125,7 +125,7 @@ struct paca_struct {
125 struct task_struct *__current; /* Pointer to current */ 125 struct task_struct *__current; /* Pointer to current */
126 u64 kstack; /* Saved Kernel stack addr */ 126 u64 kstack; /* Saved Kernel stack addr */
127 u64 stab_rr; /* stab/slb round-robin counter */ 127 u64 stab_rr; /* stab/slb round-robin counter */
128 u64 saved_r1; /* r1 save for RTAS calls */ 128 u64 saved_r1; /* r1 save for RTAS calls or PM */
129 u64 saved_msr; /* MSR saved here by enter_rtas */ 129 u64 saved_msr; /* MSR saved here by enter_rtas */
130 u16 trap_save; /* Used when bad stack is encountered */ 130 u16 trap_save; /* Used when bad stack is encountered */
131 u8 soft_enabled; /* irq soft-enable flag */ 131 u8 soft_enabled; /* irq soft-enable flag */
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 1255569387b6..384a96db794a 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -56,6 +56,9 @@
56#define PPC_INST_TLBSRX_DOT 0x7c0006a5 56#define PPC_INST_TLBSRX_DOT 0x7c0006a5
57#define PPC_INST_XXLOR 0xf0000510 57#define PPC_INST_XXLOR 0xf0000510
58 58
59#define PPC_INST_NAP 0x4c000364
60#define PPC_INST_SLEEP 0x4c0003a4
61
59/* macros to insert fields into opcodes */ 62/* macros to insert fields into opcodes */
60#define __PPC_RA(a) (((a) & 0x1f) << 16) 63#define __PPC_RA(a) (((a) & 0x1f) << 16)
61#define __PPC_RB(b) (((b) & 0x1f) << 11) 64#define __PPC_RB(b) (((b) & 0x1f) << 11)
@@ -126,4 +129,7 @@
126#define XXLOR(t, a, b) stringify_in_c(.long PPC_INST_XXLOR | \ 129#define XXLOR(t, a, b) stringify_in_c(.long PPC_INST_XXLOR | \
127 VSX_XX3((t), (a), (b))) 130 VSX_XX3((t), (a), (b)))
128 131
132#define PPC_NAP stringify_in_c(.long PPC_INST_NAP)
133#define PPC_SLEEP stringify_in_c(.long PPC_INST_SLEEP)
134
129#endif /* _ASM_POWERPC_PPC_OPCODE_H */ 135#endif /* _ASM_POWERPC_PPC_OPCODE_H */