genassym.cf revision 1.5 1 1.5 thorpej # $NetBSD: genassym.cf,v 1.5 2021/11/18 04:33:20 thorpej Exp $
2 1.2 matt
3 1.2 matt #
4 1.2 matt # Copyright (c) 2001 The NetBSD Foundation, Inc.
5 1.2 matt # All rights reserved.
6 1.2 matt #
7 1.2 matt # This code is derived from software contributed to The NetBSD Foundation
8 1.2 matt # by Matt Thomas <matt (a] 3am-sfotware.com>.
9 1.2 matt #
10 1.2 matt # Redistribution and use in source and binary forms, with or without
11 1.2 matt # modification, are permitted provided that the following conditions
12 1.2 matt # are met:
13 1.2 matt # 1. Redistributions of source code must retain the above copyright
14 1.2 matt # notice, this list of conditions and the following disclaimer.
15 1.2 matt # 2. Redistributions in binary form must reproduce the above copyright
16 1.2 matt # notice, this list of conditions and the following disclaimer in the
17 1.2 matt # documentation and/or other materials provided with the distribution.
18 1.2 matt #
19 1.2 matt # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.2 matt # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.2 matt # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.2 matt # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.2 matt # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.2 matt # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.2 matt # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.2 matt # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.2 matt # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.2 matt # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.2 matt # POSSIBILITY OF SUCH DAMAGE.
30 1.2 matt #
31 1.2 matt
32 1.2 matt include <sys/types.h>
33 1.2 matt include <machine/reg.h>
34 1.2 matt include <machine/regnum.h>
35 1.2 matt include <ucontext.h>
36 1.2 matt include <signal.h>
37 1.2 matt include <sys/siginfo.h>
38 1.2 matt
39 1.4 skrll define _UC_GREGS_V0 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_V0])
40 1.4 skrll define _UC_GREGS_GP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_GP])
41 1.4 skrll define _UC_GREGS_SP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
42 1.4 skrll define _UC_GREGS_EPC offsetof(ucontext_t, uc_mcontext.__gregs[_REG_EPC])
43 1.5 thorpej define _UC_GREGS offsetof(ucontext_t, uc_mcontext.__gregs[0])
44 1.4 skrll define _UC_LINK offsetof(ucontext_t, uc_link)
45 1.4 skrll define UCONTEXT_SIZE sizeof(ucontext_t)
46 1.4 skrll
47 1.5 thorpej define _REG_R0 _REG_R0
48 1.5 thorpej define _REG_AT _REG_AT
49 1.5 thorpej define _REG_V0 _REG_V0
50 1.5 thorpej define _REG_V1 _REG_V1
51 1.5 thorpej define _REG_A0 _REG_A0
52 1.5 thorpej define _REG_A1 _REG_A1
53 1.5 thorpej define _REG_A2 _REG_A2
54 1.5 thorpej define _REG_A3 _REG_A3
55 1.5 thorpej define _REG_T0 _REG_T0
56 1.5 thorpej define _REG_T1 _REG_T1
57 1.5 thorpej define _REG_T2 _REG_T2
58 1.5 thorpej define _REG_T3 _REG_T3
59 1.5 thorpej define _REG_T4 _REG_T4
60 1.5 thorpej define _REG_T5 _REG_T5
61 1.5 thorpej define _REG_T6 _REG_T6
62 1.5 thorpej define _REG_T7 _REG_T7
63 1.5 thorpej define _REG_S0 _REG_S0
64 1.5 thorpej define _REG_S1 _REG_S1
65 1.5 thorpej define _REG_S2 _REG_S2
66 1.5 thorpej define _REG_S3 _REG_S3
67 1.5 thorpej define _REG_S4 _REG_S4
68 1.5 thorpej define _REG_S5 _REG_S5
69 1.5 thorpej define _REG_S6 _REG_S6
70 1.5 thorpej define _REG_S7 _REG_S7
71 1.5 thorpej define _REG_T8 _REG_T8
72 1.5 thorpej define _REG_T9 _REG_T9
73 1.5 thorpej define _REG_K0 _REG_K0
74 1.5 thorpej define _REG_K1 _REG_K1
75 1.5 thorpej define _REG_GP _REG_GP
76 1.5 thorpej define _REG_SP _REG_SP
77 1.5 thorpej define _REG_S8 _REG_S8
78 1.5 thorpej define _REG_RA _REG_RA
79 1.5 thorpej define _REG_EPC _REG_EPC
80 1.5 thorpej define _REG_MDLO _REG_MDLO
81 1.5 thorpej define _REG_MDHI _REG_MDHI
82 1.5 thorpej
83 1.4 skrll define _SC_REGS offsetof(struct sigcontext, sc_regs[0])
84 1.4 skrll define _SC_REGS_V0 offsetof(struct sigcontext, sc_regs[_R_V0])
85 1.4 skrll define _SC_REGS_S0 offsetof(struct sigcontext, sc_regs[_R_S0])
86 1.4 skrll define _SC_REGS_S1 offsetof(struct sigcontext, sc_regs[_R_S1])
87 1.4 skrll define _SC_REGS_S2 offsetof(struct sigcontext, sc_regs[_R_S2])
88 1.4 skrll define _SC_REGS_S3 offsetof(struct sigcontext, sc_regs[_R_S3])
89 1.4 skrll define _SC_REGS_S4 offsetof(struct sigcontext, sc_regs[_R_S4])
90 1.4 skrll define _SC_REGS_S5 offsetof(struct sigcontext, sc_regs[_R_S5])
91 1.4 skrll define _SC_REGS_S6 offsetof(struct sigcontext, sc_regs[_R_S6])
92 1.4 skrll define _SC_REGS_S7 offsetof(struct sigcontext, sc_regs[_R_S7])
93 1.4 skrll define _SC_REGS_S8 offsetof(struct sigcontext, sc_regs[_R_S8])
94 1.4 skrll define _SC_REGS_SP offsetof(struct sigcontext, sc_regs[_R_SP])
95 1.4 skrll define _SC_REGS_GP offsetof(struct sigcontext, sc_regs[_R_GP])
96 1.4 skrll define _SC_FPREGS offsetof(struct sigcontext, sc_fpregs[0])
97 1.4 skrll define _SC_FPREGS_F20 offsetof(struct sigcontext, sc_fpregs[20])
98 1.4 skrll define _SC_FPREGS_F21 offsetof(struct sigcontext, sc_fpregs[21])
99 1.4 skrll define _SC_FPREGS_F22 offsetof(struct sigcontext, sc_fpregs[22])
100 1.4 skrll define _SC_FPREGS_F23 offsetof(struct sigcontext, sc_fpregs[23])
101 1.4 skrll define _SC_FPREGS_F24 offsetof(struct sigcontext, sc_fpregs[24])
102 1.4 skrll define _SC_FPREGS_F25 offsetof(struct sigcontext, sc_fpregs[25])
103 1.4 skrll define _SC_FPREGS_F26 offsetof(struct sigcontext, sc_fpregs[26])
104 1.4 skrll define _SC_FPREGS_F27 offsetof(struct sigcontext, sc_fpregs[27])
105 1.4 skrll define _SC_FPREGS_F28 offsetof(struct sigcontext, sc_fpregs[28])
106 1.4 skrll define _SC_FPREGS_F29 offsetof(struct sigcontext, sc_fpregs[29])
107 1.4 skrll define _SC_FPREGS_F30 offsetof(struct sigcontext, sc_fpregs[30])
108 1.4 skrll define _SC_FPREGS_F31 offsetof(struct sigcontext, sc_fpregs[31])
109 1.4 skrll define _SC_FPREGS_FCSR offsetof(struct sigcontext, sc_fpregs[32])
110 1.4 skrll define _SC_PC offsetof(struct sigcontext, sc_pc)
111 1.4 skrll define _SC_MASK offsetof(struct sigcontext, sc_mask)
112 1.4 skrll define _SC_MASK13 offsetof(struct sigcontext, __sc_mask13)
113 1.4 skrll define _SC_ONSTACK offsetof(struct sigcontext, sc_onstack)
114 1.4 skrll define _SC_FPUSED offsetof(struct sigcontext, sc_fpused)
115 1.4 skrll
116 1.4 skrll define SIGINFO_SIZE sizeof(siginfo_t)
117 1.4 skrll
118 1.4 skrll define STACK_T_SIZE ((sizeof(stack_t) + 2 * sizeof(register_t) - 1) & -(2 * sizeof(register_t)))
119 1.4 skrll define _STACK_T_SP offsetof(stack_t, ss_sp)
120 1.4 skrll define _STACK_T_SIZE offsetof(stack_t, ss_size)
121 1.4 skrll define _STACK_T_FLAGS offsetof(stack_t, ss_flags)
122 1.2 matt
123 1.4 skrll define SS_ONSTACK SS_ONSTACK
124