xref: /netbsd/sys/arch/sun3/sun3/genassym.cf (revision 6550d01e)
1#	$NetBSD: genassym.cf,v 1.14 2010/10/15 15:55:53 tsutsui Exp $
2
3#
4# Copyright (c) 1982, 1990, 1993
5#	The Regents of the University of California.  All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
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.
18#
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
29# SUCH DAMAGE.
30#
31#	from: @(#)genassym.c	8.3 (Berkeley) 1/4/94
32#
33
34#
35# Copyright (c) 1994, 1995 Gordon W. Ross
36# Copyright (c) 1993 Adam Glass
37#
38# Redistribution and use in source and binary forms, with or without
39# modification, are permitted provided that the following conditions
40# are met:
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.
53#
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
64# SUCH DAMAGE.
65#
66#	from: @(#)genassym.c	8.3 (Berkeley) 1/4/94
67#
68
69if defined(_KERNEL_OPT)
70include "opt_compat_svr4.h"
71endif
72
73include <sys/param.h>
74include <sys/cdefs.h>
75include <sys/errno.h>
76include <sys/proc.h>
77include <sys/syscall.h>
78
79include <uvm/uvm_extern.h>
80
81ifdef COMPAT_SVR4
82include <compat/svr4/svr4_syscall.h>
83include <compat/svr4/svr4_ucontext.h>
84endif
85
86include <machine/cpu.h>
87include <machine/dvma.h>
88include <machine/mon.h>
89include <machine/pcb.h>
90include <machine/pmap.h>
91include <machine/psl.h>
92include <machine/pte.h>
93include <machine/vmparam.h>
94
95include <sun3/sun3/buserr.h>
96include <sun3/sun3/cache.h>
97include <sun3/sun3/control.h>
98include <sun3/sun3/fc.h>
99
100include <sun3/sun3/enable.h>
101
102# XXX: for copy.s
103define	M68020			1
104
105# 68k isms
106define	PSL_LOWIPL			PSL_LOWIPL
107define	PSL_HIGHIPL			PSL_HIGHIPL
108define	PSL_USER			PSL_USER
109define	PSL_S				PSL_S
110define	PSL_TS				PSL_T | PSL_S
111define	FC_CONTROL			FC_CONTROL
112define	FC_SUPERD			FC_SUPERD
113define	FC_USERD			FC_USERD
114define	IC_CLEAR			IC_CLEAR
115
116ifndef _LKM
117# bus error stuff
118define	BUSERR_REG			BUSERR_REG
119define	BUSERR_MMU			BUSERR_MMU
120
121# sun3 control space isms
122define	CONTEXT_REG			CONTEXT_REG
123define	CONTEXT_NUM			CONTEXT_NUM
124define	SYSTEM_ENAB			SYSTEM_ENAB
125define	ENA_FPP				ENA_FPP
126define	SEGMAP_BASE			SEGMAP_BASE
127
128# sun3 memory map
129define	USRSTACK3			USRSTACK3
130define	SUN3_MONSTART			SUN3_MONSTART
131define	SUN3_PROM_BASE			SUN3_PROM_BASE
132define	SUN3_MONEND			SUN3_MONEND
133
134# kernel-isms
135define	KERNBASE3			KERNBASE3
136define	USPACE				USPACE
137define	PAGE_SIZE			PAGE_SIZE
138define	NBSG				NBSG
139endif
140
141# system calls
142define	SYS_exit			SYS_exit
143define	SYS_compat_16___sigreturn14	SYS_compat_16___sigreturn14
144define	SYS_compat_13_sigreturn13	SYS_compat_13_sigreturn13
145
146# errno-isms
147define	EFAULT				EFAULT
148define	ENAMETOOLONG			ENAMETOOLONG
149
150# trap types: locore.s includes trap.h
151
152#
153# unix structure-isms
154#
155
156# lwp & proc fields and values
157define	L_PCB			offsetof(struct lwp, l_addr)
158define	L_PRIORITY		offsetof(struct lwp, l_priority)
159define	L_STAT			offsetof(struct lwp, l_stat)
160define	L_WCHAN			offsetof(struct lwp, l_wchan)
161define	L_PROC			offsetof(struct lwp, l_proc)
162define	L_MD_REGS		offsetof(struct lwp, l_md.md_regs)
163define	L_MD_FLAGS		offsetof(struct lwp, l_md.md_flags)
164define	P_FLAG			offsetof(struct proc, p_flag)
165define	P_RASLIST		offsetof(struct proc, p_raslist)
166define	P_VMSPACE		offsetof(struct proc, p_vmspace)
167
168# lwp fields and values
169
170define	LSSLEEP			LSSLEEP
171define	LSRUN			LSRUN
172define	LSONPROC		LSONPROC
173
174# XXX: HP-UX trace bit?
175
176ifndef _LKM
177# VM/pmap structure fields
178define	VM_PMAP			offsetof(struct vmspace, vm_map.pmap)
179define	PM_CTXNUM		offsetof(struct pmap, pm_ctxnum)
180endif
181
182# pcb offsets
183define	PCB_FLAGS		offsetof(struct pcb, pcb_flags)
184define	PCB_PS			offsetof(struct pcb, pcb_ps)
185define	PCB_USP			offsetof(struct pcb, pcb_usp)
186define	PCB_REGS		offsetof(struct pcb, pcb_regs[0])
187define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
188define	PCB_FPCTX		offsetof(struct pcb, pcb_fpregs)
189define	SIZEOF_PCB		sizeof(struct pcb)
190
191# frame offsets
192define 	TF_PC			offsetof(struct frame, f_pc)
193
194# exception frame offset/sizes
195define	FR_SP			offsetof(struct trapframe, tf_regs[15])
196define	FR_ADJ			offsetof(struct trapframe, tf_stackadj)
197define	FR_HW			offsetof(struct trapframe, tf_sr)
198define	FR_SIZE			sizeof(struct trapframe)
199
200# FP frame offsets
201define	FPF_REGS		offsetof(struct fpframe, fpf_regs[0])
202define	FPF_FPCR		offsetof(struct fpframe, fpf_fpcr)
203
204# SVR4 binary compatibility
205ifdef COMPAT_SVR4
206define	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
207define	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
208define	SVR4_SYS_context	SVR4_SYS_context
209define	SVR4_SYS_exit		SVR4_SYS_exit
210define	SVR4_SETCONTEXT		SVR4_SETCONTEXT
211endif
212