1 # $NetBSD: genassym.cf,v 1.10 2008/09/20 18:29:06 tsutsui Exp $
4 # Copyright (c) 1982, 1990, 1993
5 # The Regents of the University of California. All rights reserved.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
10 # 1. Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
12 # 2. Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in the
14 # documentation and/or other materials provided with the distribution.
15 # 3. Neither the name of the University nor the names of its contributors
16 # may be used to endorse or promote products derived from this software
17 # without specific prior written permission.
19 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 # from: @(#)genassym.c 8.3 (Berkeley) 1/4/94
35 # Copyright (c) 1994, 1995 Gordon W. Ross
36 # Copyright (c) 1993 Adam Glass
38 # Redistribution and use in source and binary forms, with or without
39 # modification, are permitted provided that the following conditions
41 # 1. Redistributions of source code must retain the above copyright
42 # notice, this list of conditions and the following disclaimer.
43 # 2. Redistributions in binary form must reproduce the above copyright
44 # notice, this list of conditions and the following disclaimer in the
45 # documentation and/or other materials provided with the distribution.
46 # 3. All advertising materials mentioning features or use of this software
47 # must display the following acknowledgement:
48 # This product includes software developed by the University of
49 # California, Berkeley and its contributors.
50 # 4. Neither the name of the University nor the names of its contributors
51 # may be used to endorse or promote products derived from this software
52 # without specific prior written permission.
54 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
66 # from: @(#)genassym.c 8.3 (Berkeley) 1/4/94
69 if defined(_KERNEL_OPT)
70 include "opt_compat_svr4.h"
77 include <sys/syscall.h>
79 include <uvm/uvm_extern.h>
82 include <compat/svr4/svr4_syscall.h>
83 include <compat/svr4/svr4_ucontext.h>
86 include <machine/cpu.h>
87 include <machine/dvma.h>
88 include <machine/mon.h>
89 include <machine/pcb.h>
90 include <machine/pmap.h>
91 include <machine/psl.h>
92 include <machine/pte.h>
93 include <machine/vmparam.h>
95 include <sun3/sun3/buserr.h>
96 include <sun3/sun3/cache.h>
97 include <sun3/sun3/fc.h>
99 include <sun3/sun3x/enable.h>
104 # bus error stuff XXX
105 # define BUSERR_REG BUSERR_REG
106 # define BUSERR_MMU BUSERR_MMU
109 define PSL_LOWIPL PSL_LOWIPL
110 define PSL_HIGHIPL PSL_HIGHIPL
111 define PSL_USER PSL_USER
113 define PSL_TS PSL_T | PSL_S
114 define FC_CONTROL FC_CONTROL
115 define FC_SUPERD FC_SUPERD
116 define FC_USERD FC_USERD
117 define IC_CLEAR IC_CLEAR
118 define DC_CLEAR DC_CLEAR
119 define CACHE_CLR CACHE_CLR
122 define USRSTACK USRSTACK
123 define SUN3X_MONSTART SUN3X_MONSTART
124 define SUN3X_PROM_BASE SUN3X_PROM_BASE
125 define SUN3X_MONEND SUN3X_MONEND
128 define KERNBASE KERNBASE
130 define PAGE_SIZE PAGE_SIZE
133 define SYS_exit SYS_exit
134 define SYS_compat_16___sigreturn14 SYS_compat_16___sigreturn14
135 define SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13
139 define ENAMETOOLONG ENAMETOOLONG
141 # trap types: locore.s includes trap.h
144 # unix structure-isms
147 # lwp & proc fields and values
148 define L_PCB offsetof(struct lwp, l_addr)
149 define L_PRIORITY offsetof(struct lwp, l_priority)
150 define L_STAT offsetof(struct lwp, l_stat)
151 define L_WCHAN offsetof(struct lwp, l_wchan)
152 define L_PROC offsetof(struct lwp, l_proc)
153 define L_MD_REGS offsetof(struct lwp, l_md.md_regs)
154 define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags)
155 define P_FLAG offsetof(struct proc, p_flag)
156 define P_VMSPACE offsetof(struct proc, p_vmspace)
158 # lwp fields and values
160 define LSSLEEP LSSLEEP
162 define LSONPROC LSONPROC
164 # XXX: HP-UX trace bit?
166 # VM/pmap structure fields
167 define VM_PMAP offsetof(struct vmspace, vm_map.pmap)
168 define PM_A_PHYS offsetof(struct pmap, pm_a_phys)
169 define PM_A_TMGR offsetof(struct pmap, pm_a_tmgr)
172 define PCB_FLAGS offsetof(struct pcb, pcb_flags)
173 define PCB_PS offsetof(struct pcb, pcb_ps)
174 define PCB_USP offsetof(struct pcb, pcb_usp)
175 define PCB_REGS offsetof(struct pcb, pcb_regs[0])
176 define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
177 define PCB_FPCTX offsetof(struct pcb, pcb_fpregs)
178 define SIZEOF_PCB sizeof(struct pcb)
180 # exception frame offset/sizes
181 define FR_SP offsetof(struct trapframe, tf_regs[15])
182 define FR_ADJ offsetof(struct trapframe, tf_stackadj)
183 define FR_HW offsetof(struct trapframe, tf_sr)
184 define FR_SIZE sizeof(struct trapframe)
187 define FPF_REGS offsetof(struct fpframe, fpf_regs[0])
188 define FPF_FPCR offsetof(struct fpframe, fpf_fpcr)
190 # SVR4 binary compatibility
192 define SVR4_SIGF_HANDLER offsetof(struct svr4_sigframe, sf_handler)
193 define SVR4_SIGF_UC offsetof(struct svr4_sigframe, sf_uc)
194 define SVR4_SYS_context SVR4_SYS_context
195 define SVR4_SYS_exit SVR4_SYS_exit
196 define SVR4_SETCONTEXT SVR4_SETCONTEXT