1 /* $NetBSD: setjmp.h,v 1.5 2013/01/11 13:56:32 matt 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 * 13 fpscr vfp status control register
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)
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)
43 * The magic number number identifies the jmp_buf and
44 * how the buffer was created as well as providing
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.
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
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
66 /* Valid for all jmp_buf's */
69 #define _JB_REG_FPSCR 13
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
82 /* Only valid with the _JB_MAGIC_SETJMP magic */
84 #define _JB_SIGMASK 25
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