1 /* $NetBSD: setjmp.h,v 1.4 2011/06/30 20:09:20 wiz Exp $ */
4 * machine/setjmp.h: machine dependent setjmp-related information.
7 #define _JBLEN 64 /* size, in longs, of a jmp_buf */
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 !).
15 * Description of the setjmp buffer
17 * word 0 magic number (dependent on creator)
18 * 1 - 3 f4 fp register 4
19 * 4 - 6 f5 fp register 5
20 * 7 - 9 f6 fp register 6
21 * 10 - 12 f7 fp register 7
22 * 13 fpsr fp status register
29 * 20 r10 register 10 (sl)
30 * 21 r11 register 11 (fp)
31 * 22 r12 register 12 (ip)
32 * 23 r13 register 13 (sp)
33 * 24 r14 register 14 (lr)
34 * 25 signal mask (dependent on magic)
39 * The magic number number identifies the jmp_buf and
40 * how the buffer was created as well as providing
43 * A side note I should mention - Please do not tamper
44 * with the floating point fields. While they are
45 * always saved and restored at the moment this cannot
46 * be garenteed especially if the compiler happens
47 * to be generating soft-float code so no fp
48 * registers will be used.
50 * Whilst this can be seen an encouraging people to
51 * use the setjmp buffer in this way I think that it
52 * is for the best then if changes occur compiles will
53 * break rather than just having new builds falling over
57 #define _JB_MAGIC__SETJMP 0x4278f500
58 #define _JB_MAGIC_SETJMP 0x4278f501
60 /* Valid for all jmp_buf's */
67 #define _JB_REG_FPSR 13
74 #define _JB_REG_R10 20
75 #define _JB_REG_R11 21
76 #define _JB_REG_R12 22
77 #define _JB_REG_R13 23
78 #define _JB_REG_R14 24
80 /* Only valid with the _JB_MAGIC_SETJMP magic */
82 #define _JB_SIGMASK 25