genassym.cf revision 1.17 1 1.17 thorpej # $NetBSD: genassym.cf,v 1.17 2023/12/27 17:35:37 thorpej Exp $
2 1.10 tsutsui
3 1.10 tsutsui #
4 1.10 tsutsui # Copyright (c) 1982, 1990, 1993
5 1.10 tsutsui # The Regents of the University of California. All rights reserved.
6 1.10 tsutsui #
7 1.10 tsutsui # Redistribution and use in source and binary forms, with or without
8 1.10 tsutsui # modification, are permitted provided that the following conditions
9 1.10 tsutsui # are met:
10 1.10 tsutsui # 1. Redistributions of source code must retain the above copyright
11 1.10 tsutsui # notice, this list of conditions and the following disclaimer.
12 1.10 tsutsui # 2. Redistributions in binary form must reproduce the above copyright
13 1.10 tsutsui # notice, this list of conditions and the following disclaimer in the
14 1.10 tsutsui # documentation and/or other materials provided with the distribution.
15 1.10 tsutsui # 3. Neither the name of the University nor the names of its contributors
16 1.10 tsutsui # may be used to endorse or promote products derived from this software
17 1.10 tsutsui # without specific prior written permission.
18 1.10 tsutsui #
19 1.10 tsutsui # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.10 tsutsui # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.10 tsutsui # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.10 tsutsui # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.10 tsutsui # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.10 tsutsui # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.10 tsutsui # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.10 tsutsui # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.10 tsutsui # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.10 tsutsui # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.10 tsutsui # SUCH DAMAGE.
30 1.10 tsutsui #
31 1.10 tsutsui # from: @(#)genassym.c 8.3 (Berkeley) 1/4/94
32 1.10 tsutsui #
33 1.1 jdolecek
34 1.1 jdolecek #
35 1.1 jdolecek # Copyright (c) 1994, 1995 Gordon W. Ross
36 1.1 jdolecek # Copyright (c) 1993 Adam Glass
37 1.1 jdolecek #
38 1.1 jdolecek # Redistribution and use in source and binary forms, with or without
39 1.1 jdolecek # modification, are permitted provided that the following conditions
40 1.1 jdolecek # are met:
41 1.1 jdolecek # 1. Redistributions of source code must retain the above copyright
42 1.1 jdolecek # notice, this list of conditions and the following disclaimer.
43 1.1 jdolecek # 2. Redistributions in binary form must reproduce the above copyright
44 1.1 jdolecek # notice, this list of conditions and the following disclaimer in the
45 1.1 jdolecek # documentation and/or other materials provided with the distribution.
46 1.1 jdolecek # 3. All advertising materials mentioning features or use of this software
47 1.1 jdolecek # must display the following acknowledgement:
48 1.1 jdolecek # This product includes software developed by the University of
49 1.1 jdolecek # California, Berkeley and its contributors.
50 1.1 jdolecek # 4. Neither the name of the University nor the names of its contributors
51 1.1 jdolecek # may be used to endorse or promote products derived from this software
52 1.1 jdolecek # without specific prior written permission.
53 1.1 jdolecek #
54 1.1 jdolecek # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 1.1 jdolecek # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 1.1 jdolecek # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 1.1 jdolecek # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 1.1 jdolecek # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 1.1 jdolecek # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 1.1 jdolecek # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 1.1 jdolecek # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 1.1 jdolecek # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 1.1 jdolecek # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 1.1 jdolecek # SUCH DAMAGE.
65 1.1 jdolecek #
66 1.1 jdolecek # from: @(#)genassym.c 8.3 (Berkeley) 1/4/94
67 1.1 jdolecek #
68 1.1 jdolecek
69 1.1 jdolecek include <sys/param.h>
70 1.1 jdolecek include <sys/cdefs.h>
71 1.1 jdolecek include <sys/errno.h>
72 1.1 jdolecek include <sys/proc.h>
73 1.1 jdolecek include <sys/syscall.h>
74 1.1 jdolecek
75 1.1 jdolecek include <uvm/uvm_extern.h>
76 1.1 jdolecek
77 1.1 jdolecek include <machine/cpu.h>
78 1.1 jdolecek include <machine/dvma.h>
79 1.17 thorpej include <machine/fcode.h>
80 1.1 jdolecek include <machine/mon.h>
81 1.1 jdolecek include <machine/pcb.h>
82 1.1 jdolecek include <machine/pmap.h>
83 1.1 jdolecek include <machine/psl.h>
84 1.1 jdolecek include <machine/pte.h>
85 1.1 jdolecek include <machine/vmparam.h>
86 1.1 jdolecek
87 1.1 jdolecek include <sun3/sun3/buserr.h>
88 1.1 jdolecek include <sun3/sun3/cache.h>
89 1.1 jdolecek
90 1.1 jdolecek include <sun3/sun3x/enable.h>
91 1.1 jdolecek
92 1.1 jdolecek # XXX: for copy.s
93 1.1 jdolecek define M68030 1
94 1.1 jdolecek
95 1.1 jdolecek # bus error stuff XXX
96 1.1 jdolecek # define BUSERR_REG BUSERR_REG
97 1.1 jdolecek # define BUSERR_MMU BUSERR_MMU
98 1.1 jdolecek
99 1.1 jdolecek # 68k isms
100 1.1 jdolecek define PSL_LOWIPL PSL_LOWIPL
101 1.1 jdolecek define PSL_HIGHIPL PSL_HIGHIPL
102 1.1 jdolecek define PSL_USER PSL_USER
103 1.1 jdolecek define PSL_S PSL_S
104 1.1 jdolecek define PSL_TS PSL_T | PSL_S
105 1.1 jdolecek define FC_CONTROL FC_CONTROL
106 1.1 jdolecek define FC_SUPERD FC_SUPERD
107 1.1 jdolecek define FC_USERD FC_USERD
108 1.1 jdolecek define IC_CLEAR IC_CLEAR
109 1.1 jdolecek define DC_CLEAR DC_CLEAR
110 1.1 jdolecek define CACHE_CLR CACHE_CLR
111 1.1 jdolecek
112 1.1 jdolecek # sun3 memory map
113 1.13 tsutsui define USRSTACK3X USRSTACK3X
114 1.1 jdolecek define SUN3X_MONSTART SUN3X_MONSTART
115 1.1 jdolecek define SUN3X_PROM_BASE SUN3X_PROM_BASE
116 1.1 jdolecek define SUN3X_MONEND SUN3X_MONEND
117 1.1 jdolecek
118 1.1 jdolecek # kernel-isms
119 1.13 tsutsui define KERNBASE3X KERNBASE3X
120 1.1 jdolecek define USPACE USPACE
121 1.4 nathanw define PAGE_SIZE PAGE_SIZE
122 1.1 jdolecek
123 1.1 jdolecek # system calls
124 1.1 jdolecek define SYS_exit SYS_exit
125 1.5 tsutsui define SYS_compat_16___sigreturn14 SYS_compat_16___sigreturn14
126 1.1 jdolecek define SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13
127 1.1 jdolecek
128 1.1 jdolecek # errno-isms
129 1.1 jdolecek define EFAULT EFAULT
130 1.1 jdolecek define ENAMETOOLONG ENAMETOOLONG
131 1.1 jdolecek
132 1.1 jdolecek # trap types: locore.s includes trap.h
133 1.1 jdolecek
134 1.1 jdolecek #
135 1.1 jdolecek # unix structure-isms
136 1.1 jdolecek #
137 1.1 jdolecek
138 1.3 thorpej # lwp & proc fields and values
139 1.11 rmind define L_PCB offsetof(struct lwp, l_addr)
140 1.3 thorpej define L_PROC offsetof(struct lwp, l_proc)
141 1.3 thorpej define L_MD_REGS offsetof(struct lwp, l_md.md_regs)
142 1.3 thorpej define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags)
143 1.3 thorpej define P_FLAG offsetof(struct proc, p_flag)
144 1.12 chs define P_RASLIST offsetof(struct proc, p_raslist)
145 1.1 jdolecek define P_VMSPACE offsetof(struct proc, p_vmspace)
146 1.3 thorpej
147 1.1 jdolecek # XXX: HP-UX trace bit?
148 1.1 jdolecek
149 1.1 jdolecek # VM/pmap structure fields
150 1.1 jdolecek define VM_PMAP offsetof(struct vmspace, vm_map.pmap)
151 1.1 jdolecek define PM_A_PHYS offsetof(struct pmap, pm_a_phys)
152 1.1 jdolecek define PM_A_TMGR offsetof(struct pmap, pm_a_tmgr)
153 1.1 jdolecek
154 1.1 jdolecek # pcb offsets
155 1.1 jdolecek define PCB_FLAGS offsetof(struct pcb, pcb_flags)
156 1.1 jdolecek define PCB_PS offsetof(struct pcb, pcb_ps)
157 1.1 jdolecek define PCB_USP offsetof(struct pcb, pcb_usp)
158 1.1 jdolecek define PCB_REGS offsetof(struct pcb, pcb_regs[0])
159 1.1 jdolecek define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
160 1.1 jdolecek define PCB_FPCTX offsetof(struct pcb, pcb_fpregs)
161 1.1 jdolecek define SIZEOF_PCB sizeof(struct pcb)
162 1.1 jdolecek
163 1.12 chs # frame offsets
164 1.12 chs define TF_PC offsetof(struct frame, f_pc)
165 1.12 chs
166 1.1 jdolecek # exception frame offset/sizes
167 1.1 jdolecek define FR_SP offsetof(struct trapframe, tf_regs[15])
168 1.1 jdolecek define FR_ADJ offsetof(struct trapframe, tf_stackadj)
169 1.1 jdolecek define FR_HW offsetof(struct trapframe, tf_sr)
170 1.1 jdolecek define FR_SIZE sizeof(struct trapframe)
171 1.1 jdolecek
172 1.1 jdolecek # FP frame offsets
173 1.1 jdolecek define FPF_REGS offsetof(struct fpframe, fpf_regs[0])
174 1.1 jdolecek define FPF_FPCR offsetof(struct fpframe, fpf_fpcr)
175