xref: /netbsd/sys/arch/hp300/hp300/genassym.cf (revision bf9ec67e)
1#	$NetBSD: genassym.cf,v 1.24 2002/05/11 09:39:26 jdolecek 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. All advertising materials mentioning features or use of this software
16#    must display the following acknowledgement:
17#	This product includes software developed by the University of
18#	California, Berkeley and its contributors.
19# 4. Neither the name of the University nor the names of its contributors
20#    may be used to endorse or promote products derived from this software
21#    without specific prior written permission.
22#
23# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33# SUCH DAMAGE.
34#
35#	@(#)genassym.c	8.3 (Berkeley) 1/4/94
36#
37
38if defined(_KERNEL_OPT)
39include "opt_compat_svr4.h"
40endif
41
42include <sys/param.h>
43include <sys/buf.h>
44include <sys/map.h>
45include <sys/proc.h>
46include <sys/mbuf.h>
47include <sys/msgbuf.h>
48include <sys/syscall.h>
49include <sys/user.h>
50
51include <uvm/uvm_extern.h>
52
53ifdef COMPAT_SVR4
54include <compat/svr4/svr4_syscall.h>
55include <compat/svr4/svr4_ucontext.h>
56endif
57
58include <machine/hp300spu.h>
59include <machine/cpu.h>
60include <machine/intr.h>
61include <machine/psl.h>
62include <machine/reg.h>
63include <machine/pte.h>
64
65include <hp300/hp300/clockreg.h>
66
67# values for mmutype
68define	MMU_68040		MMU_68040
69define	MMU_68030		MMU_68030
70define	MMU_HP			MMU_HP
71define	MMU_68851		MMU_68851
72
73# MMU configuration options
74ifdef M68K_MMU_HP
75define	M68K_MMU_HP		1
76endif
77ifdef M68K_MMU_MOTOROLA
78define	M68K_MMU_MOTOROLA	1
79endif
80
81# values for cputype
82define	CPU_68020		CPU_68020
83define	CPU_68030		CPU_68030
84define	CPU_68040		CPU_68040
85
86# CPU configuration options
87ifdef M68020
88define	M68020			1
89endif
90ifdef M68030
91define	M68030			1
92endif
93ifdef M68040
94define	M68040			1
95endif
96
97# values for fputype
98define	FPU_68881		FPU_68881
99define	FPU_68882		FPU_68882
100define	FPU_68040		FPU_68040
101
102# values for machineid
103define	HP_320			HP_320
104define	HP_330			HP_330
105define	HP_340			HP_340
106define	HP_345			HP_345
107define	HP_350			HP_350
108define	HP_360			HP_360
109define	HP_370			HP_370
110define	HP_375			HP_375
111define	HP_380			HP_380
112define	HP_385			HP_385
113define	HP_400			HP_400
114define	HP_425			HP_425
115define	HP_433			HP_433
116
117# values for mmuid
118define	MMUID_345		MMUID_345
119define	MMUID_375		MMUID_375
120define	MMUID_385		MMUID_385
121define	MMUID_425_T		MMUID_425_T
122define	MMUID_425_S		MMUID_425_S
123define	MMUID_433_T		MMUID_433_T
124define	MMUID_433_S		MMUID_433_S
125define	MMUID_425_E		MMUID_425_E
126
127define	MMUID_SHIFT		MMUID_SHIFT
128define	MMUID_MASK		MMUID_MASK
129
130# values for ectype
131define	EC_PHYS			EC_PHYS
132define	EC_NONE			EC_NONE
133define	EC_VIRT			EC_VIRT
134
135# Cache type configuration options
136ifdef CACHE_HAVE_VAC
137define	CACHE_HAVE_VAC		1
138endif
139ifdef CACHE_HAVE_PAC
140define	CACHE_HAVE_PAC		1
141endif
142
143# general constants
144define	UPAGES			UPAGES
145define	USPACE			USPACE
146define	NBPG			NBPG
147define	PGSHIFT			PGSHIFT
148define	USRSTACK		USRSTACK
149define	MAXADDR			MAXADDR
150
151# proc fields and values
152define	P_FORW			offsetof(struct proc, p_forw)
153define	P_BACK			offsetof(struct proc, p_back)
154define	P_VMSPACE		offsetof(struct proc, p_vmspace)
155define	P_ADDR			offsetof(struct proc, p_addr)
156define	P_PRIORITY		offsetof(struct proc, p_priority)
157define	P_STAT			offsetof(struct proc, p_stat)
158define	P_WCHAN			offsetof(struct proc, p_wchan)
159define	P_MD_FLAGS		offsetof(struct proc, p_md.md_flags)
160define	P_MD_REGS		offsetof(struct proc, p_md.md_regs)
161define	SSLEEP			SSLEEP
162define	SRUN			SRUN
163define	SONPROC			SONPROC
164
165# interrupt event counters
166define	HI_EVCNT		offsetof(struct hp300_intr, hi_evcnt)
167define	SIZEOF_HI		sizeof(struct hp300_intr)
168
169# interrupt/fault metering
170define	UVMEXP_INTRS		offsetof(struct uvmexp, intrs)
171
172# PSL values (should just include psl.h?)
173define	PSL_S			PSL_S
174define	PSL_IPL7		PSL_IPL7
175define	PSL_LOWIPL		PSL_LOWIPL
176define	PSL_HIGHIPL		PSL_HIGHIPL
177define	PSL_USER		PSL_USER
178define	PSL_TS			PSL_T | PSL_S
179define	SPL1			PSL_S | PSL_IPL1
180define	SPL2			PSL_S | PSL_IPL2
181define	SPL3			PSL_S | PSL_IPL3
182define	SPL4			PSL_S | PSL_IPL4
183define	SPL5			PSL_S | PSL_IPL5
184define	SPL6			PSL_S | PSL_IPL6
185
186# magic
187define	FC_USERD		FC_USERD
188define	FC_PURGE		FC_PURGE
189define	INTIOBASE		INTIOBASE
190define	MMUBASE			MMUBASE
191define	MMUSTAT			MMUSTAT
192define	MMUCMD			MMUCMD
193define	MMUSSTP			MMUSSTP
194define	MMUUSTP			MMUUSTP
195define	MMUTBINVAL		MMUTBINVAL
196define	MMU_BERR		MMU_BERR
197define	MMU_ENAB		MMU_ENAB
198define	MMU_FAULT		MMU_FAULT
199define	MMU_CEN			MMU_CEN
200define	MMU_IEN			MMU_IEN
201define	MMU_FPE			MMU_FPE
202define	CACHE_ON		CACHE_ON
203define	CACHE_OFF		CACHE_OFF
204define	CACHE_CLR		CACHE_CLR
205define	IC_CLEAR		IC_CLEAR
206define	DC_CLEAR		DC_CLEAR
207
208# pte/ste bits
209define	PG_V			PG_V
210define	PG_NV			PG_NV
211define	PG_RO			PG_RO
212define	PG_RW			PG_RW
213define	PG_CI			PG_CI
214define	PG_PROT			PG_PROT
215define	PG_FRAME		PG_FRAME
216define	SG_V			SG_V
217define	SG_NV			SG_NV
218define	SG_RW			SG_RW
219define	SG_FRAME		SG_FRAME
220define	SG_ISHIFT		SG_ISHIFT
221
222# pcb fields
223define	PCB_PS			offsetof(struct pcb, pcb_ps)
224define	PCB_USP			offsetof(struct pcb, pcb_usp)
225define	PCB_REGS		offsetof(struct pcb, pcb_regs)
226define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
227define	PCB_FPCTX		offsetof(struct pcb, pcb_fpregs)
228define	SIZEOF_PCB		sizeof(struct pcb)
229
230# exception frame offset/sizes
231define	FR_SP			offsetof(struct frame, f_regs[15])
232define	FR_HW			offsetof(struct frame, f_sr)
233define	FR_ADJ			offsetof(struct frame, f_stackadj)
234define	FR_SIZE			sizeof(struct trapframe)
235
236# FP frame offsets
237define	FPF_REGS		offsetof(struct fpframe, fpf_regs[0])
238define	FPF_FPCR		offsetof(struct fpframe, fpf_fpcr)
239
240# system calls
241define	SYS_exit		SYS_exit
242define	SYS_execve		SYS_execve
243define	SYS___sigreturn14	SYS___sigreturn14
244define	SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13
245
246# errno
247define	EFAULT			EFAULT
248define	ENAMETOOLONG		ENAMETOOLONG
249
250# clock registers
251define	CLKSR			CLKSR
252define	CLKMSB1			CLKMSB1
253define	CLKMSB3			CLKMSB3
254
255# SVR4 binary compatibility
256ifdef COMPAT_SVR4
257define	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
258define	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
259define	SVR4_SYS_context	SVR4_SYS_context
260define	SVR4_SYS_exit		SVR4_SYS_exit
261define	SVR4_SETCONTEXT		SVR4_SETCONTEXT
262endif
263