xref: /netbsd/sys/arch/atari/atari/genassym.cf (revision 6550d01e)
1#	$NetBSD: genassym.cf,v 1.32 2011/01/14 02:06:24 rmind Exp $
2
3#-
4# Copyright (c) 1997 The NetBSD Foundation, Inc.
5# All rights reserved.
6#
7#  This code is derived from software contributed to The NetBSD Foundation
8#  by Leo Weppelman.
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
32ifdef _KERNEL_OPT
33include "opt_compat_svr4.h"
34include "opt_mbtype.h"
35endif
36
37include <sys/param.h>
38include <sys/buf.h>
39include <sys/proc.h>
40include <sys/mbuf.h>
41include <sys/msgbuf.h>
42include <sys/syscall.h>
43
44include <uvm/uvm_extern.h>
45
46ifdef COMPAT_SVR4
47include <compat/svr4/svr4_syscall.h>
48include <compat/svr4/svr4_ucontext.h>
49endif
50
51include <machine/cpu.h>
52include <machine/trap.h>
53include <machine/psl.h>
54include <machine/pcb.h>
55include <machine/vmparam.h>
56include <machine/pte.h>
57include <machine/iomap.h>
58include <machine/scu.h>
59
60define  _XXX_CIRCUMVENT_BUG	1
61
62# CPU options
63ifdef M68020
64define	M68020			1
65endif
66ifdef M68030
67define	M68030			1
68endif
69ifdef M68040
70define	M68040			1
71endif
72ifdef M68060
73define	M68060			1
74endif
75
76# lwp & proc fields and values
77define	L_PCB			offsetof(struct lwp, l_addr)
78define	L_PRIORITY		offsetof(struct lwp, l_priority)
79define	L_STAT			offsetof(struct lwp, l_stat)
80define	L_WCHAN			offsetof(struct lwp, l_wchan)
81define	L_PROC			offsetof(struct lwp, l_proc)
82define	L_MD_REGS		offsetof(struct lwp, l_md.md_regs)
83define	L_MD_FLAGS		offsetof(struct lwp, l_md.md_flags)
84define	P_FLAG			offsetof(struct proc, p_flag)
85define	P_RASLIST		offsetof(struct proc, p_raslist)
86define	P_VMSPACE		offsetof(struct proc, p_vmspace)
87
88# lwp fields and values
89
90define	LSSLEEP			LSSLEEP
91define	LSRUN			LSRUN
92define	LSONPROC		LSONPROC
93
94# interrupt/fault metering
95define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
96
97# general constants
98define	UPAGES			UPAGES
99define	USPACE			USPACE
100define	PAGE_SIZE		PAGE_SIZE
101define	PGSHIFT			PGSHIFT
102define	USRSTACK		USRSTACK
103
104define	T_BUSERR		T_BUSERR
105define	T_ADDRERR		T_ADDRERR
106define	T_ILLINST		T_ILLINST
107define	T_ZERODIV		T_ZERODIV
108define	T_CHKINST		T_CHKINST
109define	T_TRAPVINST		T_TRAPVINST
110define	T_PRIVINST		T_PRIVINST
111define	T_TRACE			T_TRACE
112define	T_MMUFLT		T_MMUFLT
113define	T_SSIR			T_SSIR
114define	T_FMTERR		T_FMTERR
115define	T_COPERR		T_COPERR
116define	T_FPERR			T_FPERR
117define	T_ASTFLT		T_ASTFLT
118define	T_TRAP15		T_TRAP15
119define	T_FPEMULI		T_FPEMULI
120define	T_FPEMULD		T_FPEMULD
121
122# PSL values
123define	PSL_S			PSL_S
124define	PSL_IPL7		PSL_IPL7
125define	PSL_LOWIPL		PSL_LOWIPL
126define	PSL_HIGHIPL		PSL_HIGHIPL
127define	PSL_USER		PSL_USER
128define	PSL_TS			PSL_T | PSL_S
129define	SPL1			PSL_S | PSL_IPL1
130define	SPL2			PSL_S | PSL_IPL2
131define	SPL3			PSL_S | PSL_IPL3
132define	SPL4			PSL_S | PSL_IPL4
133define	SPL5			PSL_S | PSL_IPL5
134define	SPL6			PSL_S | PSL_IPL6
135
136# Various MMU/cache related constants
137define	FC_USERD		FC_USERD
138define	FC_SUPERD		FC_SUPERD
139define	CACHE_ON		CACHE_ON
140define	CACHE_OFF		CACHE_OFF
141define	CACHE_CLR		CACHE_CLR
142define	IC_CLEAR		IC_CLEAR
143define	DC_CLEAR		DC_CLEAR
144define	CACHE40_ON		CACHE40_ON
145define	CACHE40_OFF		CACHE40_OFF
146define	CACHE60_ON		CACHE60_ON
147define	IC60_CABC		IC60_CABC
148define	IC60_CUBC		IC60_CUBC
149
150# pte/ste bits
151define	PG_V			PG_V
152define	PG_NV			PG_NV
153define	PG_RO			PG_RO
154define	PG_RW			PG_RW
155define	PG_CI			PG_CI
156define	PG_PROT			PG_PROT
157define	PG_FRAME		PG_FRAME
158define	SG_V			SG_V
159define	SG_NV			SG_NV
160define	SG_RW			SG_RW
161define	SG_FRAME		SG_FRAME
162
163# pcb fields
164define  PCB_FLAGS		offsetof(struct pcb, pcb_flags)
165define	PCB_PS			offsetof(struct pcb, pcb_ps)
166define	PCB_USP			offsetof(struct pcb, pcb_usp)
167define	PCB_REGS		offsetof(struct pcb, pcb_regs)
168define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
169define	PCB_FPCTX		offsetof(struct pcb, pcb_fpregs)
170define	SIZEOF_PCB		sizeof(struct pcb)
171
172# frame offsets
173define	TF_PC			offsetof(struct frame, f_pc)
174
175# exception frame offset/sizes
176define	FR_SP			offsetof(struct frame, f_regs[15])
177define	FR_HW			offsetof(struct frame, f_sr)
178define	FR_ADJ			offsetof(struct frame, f_stackadj)
179define	FR_SIZE			sizeof(struct trapframe)
180define	SP			SP
181
182# FP frame offsets
183define	FPF_REGS		offsetof(struct fpframe, fpf_regs[0])
184define	FPF_FPCR		offsetof(struct fpframe, fpf_fpcr)
185define	FPF_FPSR		offsetof(struct fpframe, fpf_fpsr)
186define	FPF_FPI			offsetof(struct fpframe, fpf_fpiar)
187
188# system calls
189define	SYS_exit		SYS_exit
190define	SYS_execve		SYS_execve
191define	SYS_compat_16___sigreturn14	SYS_compat_16___sigreturn14
192define	SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13
193
194# processor type from loader
195define	ATARI_68020		ATARI_68020
196define	ATARI_68030		ATARI_68030
197define	ATARI_68040		ATARI_68040
198define	ATARI_68060		ATARI_68060
199
200# values for mmutype
201define	MMU_68030		MMU_68030
202define	MMU_68851		MMU_68851
203define	MMU_68040		MMU_68040
204
205# values for cputype
206define	CPU_68020		CPU_68020
207define	CPU_68030		CPU_68030
208define	CPU_68040		CPU_68040
209define	CPU_68060		CPU_68060
210
211# values for fputype
212define	FPU_68881		FPU_68881
213define	FPU_68882		FPU_68882
214define	FPU_68040		FPU_68040
215define	FPU_68060		FPU_68060
216
217ifdef _ATARIHW_
218# AD_SCU definition needs this...
219quote #define stio_addr		0
220
221define	SCU_SOFTINT		AD_SCU + offsetof(struct scu, sys_int)
222define	SCU_SYSMASK		AD_SCU + offsetof(struct scu, sys_mask)
223endif
224
225# SVR4 binary compatibility
226ifdef COMPAT_SVR4
227define SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
228define SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
229define SVR4_SYS_context		SVR4_SYS_context
230define SVR4_SYS_exit		SVR4_SYS_exit
231define SVR4_SETCONTEXT		SVR4_SETCONTEXT
232endif
233