patch-2.1.48 linux/arch/ppc/kernel/ppc_asm.tmpl

Next file: linux/arch/ppc/kernel/ppc_defs.h
Previous file: linux/arch/ppc/kernel/port_io.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.47/linux/arch/ppc/kernel/ppc_asm.tmpl linux/arch/ppc/kernel/ppc_asm.tmpl
@@ -2,19 +2,10 @@
  * This file contains all the macros and symbols which define
  * a PowerPC assembly language environment.
  */
-
+#include <linux/config.h>	
 #define _TEXT()\
 	.text
 
-#if 0 /* Old way */	
-#define _EXTERN(n) .##n	
-
-#define _GLOBAL(n)\
-	.globl n;\
-n:	.long	_EXTERN(n);\
-	.globl _EXTERN(n);\
-_EXTERN(n):
-#else
 #define _EXTERN(n) n	
 
 #define SYMBOL_NAME(x) x
@@ -22,7 +13,6 @@
 #define _GLOBAL(n)\
 	.globl n;\
 n:
-#endif
 
 #ifndef FALSE
 #define FALSE	0
@@ -136,9 +126,13 @@
 #define SDR1	25	/* MMU hash base register */
 #define DAR	19	/* Data Address Register */
 #define SPR0	272	/* Supervisor Private Registers */
+#define SPRG0   272
 #define SPR1	273
+#define SPRG1   273
 #define SPR2	274
+#define SPRG2   274
 #define SPR3	275
+#define SPRG3   275
 #define DSISR	18
 #define SRR0	26	/* Saved Registers (exception) */
 #define SRR1	27
@@ -164,7 +158,36 @@
 #define SR14	14
 #define SR15	15
 
+#define curptr r2
+
+/*
+ * Macros for storing registers into and loading registers from
+ * exception frames.
+ */
+#define SAVE_GPR(n, base)	stw	n,GPR0+4*(n)(base)
+#define SAVE_2GPRS(n, base)	SAVE_GPR(n, base); SAVE_GPR(n+1, base)
+#define SAVE_4GPRS(n, base)	SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)
+#define SAVE_8GPRS(n, base)	SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)
+#define SAVE_10GPRS(n, base)	SAVE_8GPRS(n, base); SAVE_2GPRS(n+8, base)
+#define REST_GPR(n, base)	lwz	n,GPR0+4*(n)(base)
+#define REST_2GPRS(n, base)	REST_GPR(n, base); REST_GPR(n+1, base)
+#define REST_4GPRS(n, base)	REST_2GPRS(n, base); REST_2GPRS(n+2, base)
+#define REST_8GPRS(n, base)	REST_4GPRS(n, base); REST_4GPRS(n+4, base)
+#define REST_10GPRS(n, base)	REST_8GPRS(n, base); REST_2GPRS(n+8, base)
+
+#define SAVE_FPR(n, base)	stfd	n,TSS_FPR0+8*(n)(base)
+#define SAVE_2FPRS(n, base)	SAVE_FPR(n, base); SAVE_FPR(n+1, base)
+#define SAVE_4FPRS(n, base)	SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base)
+#define SAVE_8FPRS(n, base)	SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base)
+#define SAVE_16FPRS(n, base)	SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base)
+#define SAVE_32FPRS(n, base)	SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base)
+#define REST_FPR(n, base)	lfd	n,TSS_FPR0+8*(n)(base)
+#define REST_2FPRS(n, base)	REST_FPR(n, base); REST_FPR(n+1, base)
+#define REST_4FPRS(n, base)	REST_2FPRS(n, base); REST_2FPRS(n+2, base)
+#define REST_8FPRS(n, base)	REST_4FPRS(n, base); REST_4FPRS(n+4, base)
+#define REST_16FPRS(n, base)	REST_8FPRS(n, base); REST_8FPRS(n+8, base)
+#define REST_32FPRS(n, base)	REST_16FPRS(n, base); REST_16FPRS(n+16, base)
+
 /* Missing instructions */
 #define bdne	bc 0,2,
 
-#include "asm/ppc_machine.h"

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov