xref: /minix3/sys/arch/arm/include/setjmp.h (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1 /*	$NetBSD: setjmp.h,v 1.5 2013/01/11 13:56:32 matt Exp $	*/
2 
3 /*
4  * machine/setjmp.h: machine dependent setjmp-related information.
5  */
6 
7 #define	_JBLEN	64		/* size, in longs, of a jmp_buf */
8 
9 /*
10  * NOTE: The internal structure of a jmp_buf is *PRIVATE*
11  *       This information is provided as there is software
12  *       that fiddles with this with obtain the stack pointer
13  *	 (yes really ! and its commercial !).
14  *
15  * Description of the setjmp buffer
16  *
17  * word  0	magic number	(dependent on creator)
18  *	13	fpscr		vfp status control register
19  *	14	r4		register 4
20  *	15	r5		register 5
21  *	16	r6		register 6
22  *	17	r7		register 7
23  *	18	r8		register 8
24  *	19	r9		register 9
25  *	20	r10		register 10 (sl)
26  *	21	r11		register 11 (fp)
27  *	22	r12		register 12 (ip)
28  *	23	r13		register 13 (sp)
29  *	24	r14		register 14 (lr)
30  *	25	signal mask	(dependent on magic)
31  *	26	(con't)
32  *	27	(con't)
33  *	28	(con't)
34  *	32-33	d8		(vfp register d8)
35  *	34-35	d9		(vfp register d9)
36  *	36-37	d10		(vfp register d10)
37  *	38-39	d11		(vfp register d11)
38  *	40-41	d12		(vfp register d12)
39  *	42-43	d13		(vfp register d13)
40  *	44-45	d14		(vfp register d14)
41  *	46-47	d15		(vfp register d15)
42  *
43  * The magic number number identifies the jmp_buf and
44  * how the buffer was created as well as providing
45  * a sanity check
46  *
47  * A side note I should mention - Please do not tamper
48  * with the floating point fields. While they are
49  * always saved and restored at the moment this cannot
50  * be garenteed especially if the compiler happens
51  * to be generating soft-float code so no fp
52  * registers will be used.
53  *
54  * Whilst this can be seen an encouraging people to
55  * use the setjmp buffer in this way I think that it
56  * is for the best then if changes occur compiles will
57  * break rather than just having new builds falling over
58  * mysteriously.
59  */
60 
61 #define _JB_MAGIC__SETJMP	0x4278f500
62 #define _JB_MAGIC_SETJMP	0x4278f501
63 #define _JB_MAGIC__SETJMP_VFP	0x4278f502
64 #define _JB_MAGIC_SETJMP_VFP	0x4278f503
65 
66 /* Valid for all jmp_buf's */
67 
68 #define _JB_MAGIC		 0
69 #define _JB_REG_FPSCR		13
70 #define _JB_REG_R4		14
71 #define _JB_REG_R5		15
72 #define _JB_REG_R6		16
73 #define _JB_REG_R7		17
74 #define _JB_REG_R8		18
75 #define _JB_REG_R9		19
76 #define _JB_REG_R10		20
77 #define _JB_REG_R11		21
78 #define _JB_REG_R12		22
79 #define _JB_REG_R13		23
80 #define _JB_REG_R14		24
81 
82 /* Only valid with the _JB_MAGIC_SETJMP magic */
83 
84 #define _JB_SIGMASK		25
85 
86 #define	_JB_REG_D8		32
87 #define	_JB_REG_D9		34
88 #define	_JB_REG_D10		36
89 #define	_JB_REG_D11		38
90 #define	_JB_REG_D12		40
91 #define	_JB_REG_D13		42
92 #define	_JB_REG_D14		44
93 #define	_JB_REG_D15		46
94