1 /* $OpenBSD: setjmp.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
2 /* $NetBSD: setjmp.h,v 1.2 2001/08/25 14:45:59 bjh21 Exp $ */
5 * machine/setjmp.h: machine dependent setjmp-related information.
9 #define _JBLEN 64 /* size, in longs, of a jmp_buf */
11 #define _JBLEN 29 /* size, in longs, of a jmp_buf */
15 * NOTE: The internal structure of a jmp_buf is *PRIVATE*
16 * This information is provided as there is software
17 * that fiddles with this with obtain the stack pointer
18 * (yes really ! and its commercial !).
20 * Description of the setjmp buffer
22 * word 0 magic number (dependant on creator)
23 * 1 - 3 f4 fp register 4
24 * 4 - 6 f5 fp register 5
25 * 7 - 9 f6 fp register 6
26 * 10 - 12 f7 fp register 7
27 * 13 fpsr fp status register
34 * 20 r10 register 10 (sl)
35 * 21 r11 register 11 (fp)
36 * 22 r12 register 12 (ip)
37 * 23 r13 register 13 (sp)
38 * 24 r14 register 14 (lr)
39 * 25 signal mask (dependant on magic)
44 * The magic number number identifies the jmp_buf and
45 * how the buffer was created as well as providing
48 * A side note I should mention - Please do not tamper
49 * with the floating point fields. While they are
50 * always saved and restored at the moment this cannot
51 * be garenteed especially if the compiler happens
52 * to be generating soft-float code so no fp
53 * registers will be used.
55 * Whilst this can be seen an encouraging people to
56 * use the setjmp buffer in this way I think that it
57 * is for the best then if changes occur compiles will
58 * break rather than just having new builds falling over
62 #define _JB_MAGIC__SETJMP 0x4278f500
63 #define _JB_MAGIC_SETJMP 0x4278f501
65 /* Valid for all jmp_buf's */
72 #define _JB_REG_FPSR 13
79 #define _JB_REG_R10 20
80 #define _JB_REG_R11 21
81 #define _JB_REG_R12 22
82 #define _JB_REG_R13 23
83 #define _JB_REG_R14 24
85 /* Only valid with the _JB_MAGIC_SETJMP magic */
87 #define _JB_SIGMASK 25