1#         $NetBSD: genassym.cf,v 1.3 2020/10/21 01:24:04 thorpej Exp $
2
3#
4# Copyright (c) 2001 The NetBSD Foundation, Inc.
5# All rights reserved.
6#
7# This code is derived from software contributed to The NetBSD Foundation
8# by Matt Thomas <matt@3am-sfotware.com>.
9#
10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions
12# are met:
13# 1. Redistributions of source code must retain the above copyright
14#    notice, this list of conditions and the following disclaimer.
15# 2. Redistributions in binary form must reproduce the above copyright
16#    notice, this list of conditions and the following disclaimer in the
17#    documentation and/or other materials provided with the distribution.
18#
19# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30#
31
32include <sys/types.h>
33include <machine/reg.h>
34include <ucontext.h>
35include <signal.h>
36
37define _REG_V0                _REG_V0             /* 0 */
38define _REG_T0                _REG_T0             /* 1 */
39define _REG_T1                _REG_T1             /* 2 */
40define _REG_T2                _REG_T2             /* 3 */
41define _REG_T3                _REG_T3             /* 4 */
42define _REG_T4                _REG_T4             /* 5 */
43define _REG_T5                _REG_T5             /* 6 */
44define _REG_T6                _REG_T6             /* 7 */
45define _REG_T7                _REG_T7             /* 8 */
46define _REG_S0                _REG_S0             /* 9 */
47define _REG_S1                _REG_S1             /* 10 */
48define _REG_S2                _REG_S2             /* 11 */
49define _REG_S3                _REG_S3             /* 12 */
50define _REG_S4                _REG_S4             /* 13 */
51define _REG_S5                _REG_S5             /* 14 */
52define _REG_S6                _REG_S6             /* 15 */
53define _REG_A0                _REG_A0             /* 16 */
54define _REG_A1                _REG_A1             /* 17 */
55define _REG_A2                _REG_A2             /* 18 */
56define _REG_A3                _REG_A3             /* 19 */
57define _REG_A4                _REG_A4             /* 20 */
58define _REG_A5                _REG_A5             /* 21 */
59define _REG_T8                _REG_T8             /* 22 */
60define _REG_T9                _REG_T9             /* 23 */
61define _REG_T10               _REG_T10  /* 24 */
62define _REG_T11               _REG_T11  /* 25 */
63define _REG_RA                _REG_RA             /* 26 */
64define _REG_T12               _REG_T12  /* 27 */
65define _REG_PV                _REG_PV             /* 27 */
66define _REG_AT                _REG_AT             /* 28 */
67define _REG_GP                _REG_GP             /* 29 */
68define _REG_SP                _REG_SP             /* 30 */
69define _REG_UNIQUE  _REG_UNIQUE         /* 31 */
70define _REG_PC                _REG_PC             /* 32 */
71define _REG_PS                _REG_PS             /* 33 */
72
73define    SC_ONSTACK          offsetof(struct sigcontext, sc_onstack)
74define    SC_SP               offsetof(struct sigcontext, sc_sp)
75define    SC_PC               offsetof(struct sigcontext, sc_pc)
76define    SC_PS               offsetof(struct sigcontext, sc_ps)
77define    SC_REGS             offsetof(struct sigcontext, sc_regs)
78define    SC_OWNEDFP          offsetof(struct sigcontext, sc_regs)
79define    SC_FPREGS offsetof(struct sigcontext, sc_fpregs)
80define    SC_FPCR             offsetof(struct sigcontext, sc_fpcr)
81define    SC_FP_CONTROL       offsetof(struct sigcontext, sc_fp_control)
82define    SC_MASK             offsetof(struct sigcontext, sc_mask)
83define    SC_RESERVED         offsetof(struct sigcontext, sc_reserved)
84define    SC_XXX              offsetof(struct sigcontext, sc_xxx)
85
86define    SIZEOF_SIGINFO      sizeof(siginfo_t)
87
88define    UC_GREGS  offsetof(ucontext_t, uc_mcontext.__gregs)
89