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