Skip to contentSkip to conversation

powerpc: Add definitions used by exception handling on 64-bit Book3E

PATCH In review Benjamin Herrenschmidt 2 participants 2 messages Jul 23, 2009 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 15/20 powerpc: Add definitions used by exception handling on 64-bit Book3E

This adds various definitions and macros used by the exception and TLB miss handling on 64-bit BookE

It also adds the definitions of the SPRGs used for various exception types

---

 arch/powerpc/include/asm/exception-64e.h |  200 +++++++++++++++++++++++++++++++
 arch/powerpc/include/asm/reg.h           |   19 ++
 2 files changed, 219 insertions(+)
arch/powerpc/include/asm/reg.h +19 -0
@@ -652,6 +652,16 @@
  *	- SPRG2 scratch for exception vectors
  *	- SPRG3 unused (user visible)
  *
+ * 64-bit embedded
+ *	- SPRG0 generic exception scratch
+ *	- SPRG2 TLB exception stack
+ *	- SPRG3 unused (user visible)
+ *	- SPRG4 unused (user visible)
+ *	- SPRG6 TLB miss scratch (user visible, sorry !)
+ *	- SPRG7 critical exception scratch
+ *	- SPRG8 machine check exception scratch
+ *	- SPRG9 debug exception scratch
+ *
  * All 32-bit:
  *	- SPRG3 current thread_info pointer
  *        (virtual on BookE, physical on others)
@@ -705,6 +715,15 @@
 #define SPRN_SPRG_SCRATCH0	SPRN_SPRG2
 #endif
 
+#ifdef CONFIG_PPC_BOOK3E_64
+#define SPRN_SPRG_MC_SCRATCH	SPRN_SPRG8
+#define SPRN_SPRG_CRIT_SCRATCH	SPRN_SPRG7
+#define SPRN_SPRG_DBG_SCRATCH	SPRN_SPRG9
+#define SPRN_SPRG_TLB_EXFRAME	SPRN_SPRG2
+#define SPRN_SPRG_TLB_SCRATCH	SPRN_SPRG6
+#define SPRN_SPRG_GEN_SCRATCH	SPRN_SPRG0
+#endif
+
 #ifdef CONFIG_PPC_BOOK3S_32
 #define SPRN_SPRG_SCRATCH0	SPRN_SPRG0
 #define SPRN_SPRG_SCRATCH1	SPRN_SPRG1
arch/powerpc/include/asm/exception-64e.h new file +200 -0

200 lines not on this page · raw message

#1 lore raw

Hi Ben,

Another trivial one.

arch/powerpc/include/asm/exception-64e.h line 12

Quoted 3 lines · On Thu, 23 Jul 2009 15:59:49 +1000 Benjamin Herrenschmidt…
arch/powerpc/include/asm/exception-64e.h new file +2 -0
+#ifndef __EXCEPTION_64E_H__
+#define __EXCEPTION_64E_H__

To be consistent with most of our headers, please use _ASM_POWERPC_EXCEPTION_64E_H.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/