patch-2.1.48 linux/include/asm-ppc/ptrace.h

Next file: linux/include/asm-ppc/semaphore.h
Previous file: linux/include/asm-ppc/processor.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.47/linux/include/asm-ppc/ptrace.h linux/include/asm-ppc/ptrace.h
@@ -2,54 +2,61 @@
 #define _PPC_PTRACE_H
 
 /*
- * This struct defines the way the registers are stored on the
- * kernel stack during a system call or other kernel entry.
- * Note: the "_overhead" and "_underhead" spaces are stack locations
- * used by called routines.  Because of the way the PowerPC ABI
- * specifies the function prologue/epilogue, registers can be
- * saved in stack locations which are below the current stack
- * pointer (_underhead).  If an interrupt occurs during this
- * [albeit] small time interval, registers which were saved on
- * the stack could be trashed by the interrupt save code.  The
- * "_underhead" leaves a hole just in case this happens.  It also
- * wastes 80 bytes of stack if it doesn't!  Similarly, the called
- * routine stores some information "above" the stack pointer before
- * if gets adjusted.  This is covered by the "_overhead" field
- * and [thankfully] is not totally wasted.
+ * this should only contain volatile regs
+ * since we can keep non-volatile in the tss
+ * should set this up when only volatiles are saved
+ * by intr code.
  *
+ * I can't find any reference to the above comment (from Gary Thomas)
+ * about _underhead/_overhead in the sys V abi for the ppc
+ * dated july 25, 1994.
+ *
+ * the stack must be kept to a size that is a multiple of 16
+ * so this includes the stack frame overhead 
+ * -- Cort.
+ */
+
+/*
+ * GCC sometimes accesses words at negative offsets from the stack
+ * pointer, although the SysV ABI says it shouldn't.  To cope with
+ * this, we leave this much untouched space on the stack on exception
+ * entry.
  */
+#define STACK_FRAME_OVERHEAD 16
+#define STACK_UNDERHEAD	64
 
+#ifndef __ASSEMBLY__
 struct pt_regs {
-  unsigned long _overhead[14]; /* Callee's SP,LR,params */
-  unsigned long gpr[32];
-  unsigned long nip;
-  unsigned long msr;
-  unsigned long ctr;
-  unsigned long link;
-  unsigned long ccr;
-  unsigned long xer;
-  unsigned long dar;	/* Fault registers */
-  unsigned long dsisr;
-  unsigned long srr1;
-  unsigned long srr0;
-  unsigned long hash1, hash2;
-  unsigned long imiss, dmiss;
-  unsigned long icmp, dcmp;
-  unsigned long orig_gpr3; /* Used for restarting system calls */
-  unsigned long result;    /* Result of a system call */
-  double        fpcsr;
-  unsigned long trap;	/* Reason for being here */
-  unsigned long marker;	/* Should have DEADDEAD */
-  /*unsigned long _underhead[20]; *//* Callee's register save area */
-  unsigned long edx;	/* for binfmt_elf.c which wants edx */
+	unsigned long gpr[32];
+	unsigned long nip;	
+	unsigned long msr;	
+	unsigned long ctr;	
+	unsigned long link;	
+	unsigned long ccr;	
+	unsigned long xer;	
+	unsigned long dar;	/* Fault registers */
+	unsigned long dsisr;
+#if 0  
+	unsigned long srr1;
+	unsigned long srr0;
+	unsigned long hash1, hash2;
+	unsigned long imiss, dmiss;
+	unsigned long icmp, dcmp;
+#endif  
+	unsigned long orig_gpr3; /* Used for restarting system calls */
+	unsigned long result;	/* Result of a system call */
+	unsigned long trap;	/* Reason for being here */
+	unsigned long marker;	/* Should have DEADDEAD */
 };
 
+
 #define instruction_pointer(regs) ((regs)->nip)
 #define user_mode(regs) ((regs)->msr & 0x4000)
 #ifdef KERNEL
 extern void show_regs(struct pt_regs *);
 #endif
 
+/* should include and generate these in ppc_defs.h -- Cort */
 /* Offsets used by 'ptrace' system call interface */
 /* Note: these should correspond to gpr[x]        */
 #define PT_R0	0
@@ -94,6 +101,7 @@
 #define PT_CCR	38
 
 #define PT_FPR0	48
+#endif /* __ASSEMBLY__ */
 
-#endif
+#endif /* _PPC_PTRACE_H */
 

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