patch-2.4.15 linux/include/asm-ia64/sigcontext.h

Next file: linux/include/asm-ia64/signal.h
Previous file: linux/include/asm-ia64/shmbuf.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.14/linux/include/asm-ia64/sigcontext.h linux/include/asm-ia64/sigcontext.h
@@ -2,13 +2,13 @@
 #define _ASM_IA64_SIGCONTEXT_H
 
 /*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
 #include <asm/fpu.h>
 
-#define IA64_SC_FLAG_ONSTACK_BIT		1	/* is handler running on signal stack? */
+#define IA64_SC_FLAG_ONSTACK_BIT		0	/* is handler running on signal stack? */
 #define IA64_SC_FLAG_IN_SYSCALL_BIT		1	/* did signal interrupt a syscall? */
 #define IA64_SC_FLAG_FPH_VALID_BIT		2	/* is state in f[32]-f[127] valid? */
 
@@ -18,6 +18,19 @@
 
 # ifndef __ASSEMBLY__
 
+/*
+ * Note on handling of register backing store: sc_ar_bsp contains the address that would
+ * be found in ar.bsp after executing a "cover" instruction the context in which the
+ * signal was raised.  If signal delivery required switching to an alternate signal stack
+ * (sc_rbs_base is not NULL), the "dirty" partition (as it would exist after executing the
+ * imaginary "cover" instruction) is backed by the *alternate* signal stack, not the
+ * original one.  In this case, sc_rbs_base contains the base address of the new register
+ * backing store.  The number of registers in the dirty partition can be calculated as:
+ *
+ *   ndirty = ia64_rse_num_regs(sc_rbs_base, sc_rbs_base + (sc_loadrs >> 16))
+ *
+ */
+
 struct sigcontext {
 	unsigned long		sc_flags;	/* see manifest constants above */
 	unsigned long		sc_nat;		/* bit i == 1 iff scratch reg gr[i] is a NaT */
@@ -40,8 +53,10 @@
 	unsigned long		sc_gr[32];	/* general registers (static partition) */
 	struct ia64_fpreg	sc_fr[128];	/* floating-point registers */
 
-	unsigned long		sc_rsvd[16];	/* reserved for future use */
+	unsigned long		sc_rbs_base;	/* NULL or new base of sighandler's rbs */
+	unsigned long		sc_loadrs;	/* see description above */
 
+	unsigned long		sc_rsvd[14];	/* reserved for future use */
 	/*
 	 * The mask must come last so we can increase _NSIG_WORDS
 	 * without breaking binary compatibility.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)