xref: /openbmc/linux/arch/ia64/include/uapi/asm/sigcontext.h (revision 43e40f25d2c090392fc36cb900b42972e88cc2e2)
1*43e40f25SDavid Howells #ifndef _ASM_IA64_SIGCONTEXT_H
2*43e40f25SDavid Howells #define _ASM_IA64_SIGCONTEXT_H
3*43e40f25SDavid Howells 
4*43e40f25SDavid Howells /*
5*43e40f25SDavid Howells  * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
6*43e40f25SDavid Howells  * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
7*43e40f25SDavid Howells  */
8*43e40f25SDavid Howells 
9*43e40f25SDavid Howells #include <asm/fpu.h>
10*43e40f25SDavid Howells 
11*43e40f25SDavid Howells #define IA64_SC_FLAG_ONSTACK_BIT		0	/* is handler running on signal stack? */
12*43e40f25SDavid Howells #define IA64_SC_FLAG_IN_SYSCALL_BIT		1	/* did signal interrupt a syscall? */
13*43e40f25SDavid Howells #define IA64_SC_FLAG_FPH_VALID_BIT		2	/* is state in f[32]-f[127] valid? */
14*43e40f25SDavid Howells 
15*43e40f25SDavid Howells #define IA64_SC_FLAG_ONSTACK		(1 << IA64_SC_FLAG_ONSTACK_BIT)
16*43e40f25SDavid Howells #define IA64_SC_FLAG_IN_SYSCALL		(1 << IA64_SC_FLAG_IN_SYSCALL_BIT)
17*43e40f25SDavid Howells #define IA64_SC_FLAG_FPH_VALID		(1 << IA64_SC_FLAG_FPH_VALID_BIT)
18*43e40f25SDavid Howells 
19*43e40f25SDavid Howells # ifndef __ASSEMBLY__
20*43e40f25SDavid Howells 
21*43e40f25SDavid Howells /*
22*43e40f25SDavid Howells  * Note on handling of register backing store: sc_ar_bsp contains the address that would
23*43e40f25SDavid Howells  * be found in ar.bsp after executing a "cover" instruction the context in which the
24*43e40f25SDavid Howells  * signal was raised.  If signal delivery required switching to an alternate signal stack
25*43e40f25SDavid Howells  * (sc_rbs_base is not NULL), the "dirty" partition (as it would exist after executing the
26*43e40f25SDavid Howells  * imaginary "cover" instruction) is backed by the *alternate* signal stack, not the
27*43e40f25SDavid Howells  * original one.  In this case, sc_rbs_base contains the base address of the new register
28*43e40f25SDavid Howells  * backing store.  The number of registers in the dirty partition can be calculated as:
29*43e40f25SDavid Howells  *
30*43e40f25SDavid Howells  *   ndirty = ia64_rse_num_regs(sc_rbs_base, sc_rbs_base + (sc_loadrs >> 16))
31*43e40f25SDavid Howells  *
32*43e40f25SDavid Howells  */
33*43e40f25SDavid Howells 
34*43e40f25SDavid Howells struct sigcontext {
35*43e40f25SDavid Howells 	unsigned long		sc_flags;	/* see manifest constants above */
36*43e40f25SDavid Howells 	unsigned long		sc_nat;		/* bit i == 1 iff scratch reg gr[i] is a NaT */
37*43e40f25SDavid Howells 	stack_t			sc_stack;	/* previously active stack */
38*43e40f25SDavid Howells 
39*43e40f25SDavid Howells 	unsigned long		sc_ip;		/* instruction pointer */
40*43e40f25SDavid Howells 	unsigned long		sc_cfm;		/* current frame marker */
41*43e40f25SDavid Howells 	unsigned long		sc_um;		/* user mask bits */
42*43e40f25SDavid Howells 	unsigned long		sc_ar_rsc;	/* register stack configuration register */
43*43e40f25SDavid Howells 	unsigned long		sc_ar_bsp;	/* backing store pointer */
44*43e40f25SDavid Howells 	unsigned long		sc_ar_rnat;	/* RSE NaT collection register */
45*43e40f25SDavid Howells 	unsigned long		sc_ar_ccv;	/* compare and exchange compare value register */
46*43e40f25SDavid Howells 	unsigned long		sc_ar_unat;	/* ar.unat of interrupted context */
47*43e40f25SDavid Howells 	unsigned long		sc_ar_fpsr;	/* floating-point status register */
48*43e40f25SDavid Howells 	unsigned long		sc_ar_pfs;	/* previous function state */
49*43e40f25SDavid Howells 	unsigned long		sc_ar_lc;	/* loop count register */
50*43e40f25SDavid Howells 	unsigned long		sc_pr;		/* predicate registers */
51*43e40f25SDavid Howells 	unsigned long		sc_br[8];	/* branch registers */
52*43e40f25SDavid Howells 	/* Note: sc_gr[0] is used as the "uc_link" member of ucontext_t */
53*43e40f25SDavid Howells 	unsigned long		sc_gr[32];	/* general registers (static partition) */
54*43e40f25SDavid Howells 	struct ia64_fpreg	sc_fr[128];	/* floating-point registers */
55*43e40f25SDavid Howells 
56*43e40f25SDavid Howells 	unsigned long		sc_rbs_base;	/* NULL or new base of sighandler's rbs */
57*43e40f25SDavid Howells 	unsigned long		sc_loadrs;	/* see description above */
58*43e40f25SDavid Howells 
59*43e40f25SDavid Howells 	unsigned long		sc_ar25;	/* cmp8xchg16 uses this */
60*43e40f25SDavid Howells 	unsigned long		sc_ar26;	/* rsvd for scratch use */
61*43e40f25SDavid Howells 	unsigned long		sc_rsvd[12];	/* reserved for future use */
62*43e40f25SDavid Howells 	/*
63*43e40f25SDavid Howells 	 * The mask must come last so we can increase _NSIG_WORDS
64*43e40f25SDavid Howells 	 * without breaking binary compatibility.
65*43e40f25SDavid Howells 	 */
66*43e40f25SDavid Howells 	sigset_t		sc_mask;	/* signal mask to restore after handler returns */
67*43e40f25SDavid Howells };
68*43e40f25SDavid Howells 
69*43e40f25SDavid Howells # endif /* __ASSEMBLY__ */
70*43e40f25SDavid Howells #endif /* _ASM_IA64_SIGCONTEXT_H */
71