xref: /netbsd/sys/arch/sparc64/sparc64/genassym.cf (revision bf9ec67e)
1#	$NetBSD: genassym.cf,v 1.26 2002/05/14 02:34:15 eeh 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 Christos Zoulas.
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# 3. All advertising materials mentioning features or use of this software
19#    must display the following acknowledgement:
20#        This product includes software developed by the NetBSD
21#        Foundation, Inc. and its contributors.
22# 4. Neither the name of The NetBSD Foundation nor the names of its
23#    contributors may be used to endorse or promote products derived
24#    from this software without specific prior written permission.
25#
26# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36# POSSIBILITY OF SUCH DAMAGE.
37#
38# Copyright (c) 1992, 1993
39#	The Regents of the University of California.  All rights reserved.
40#
41# This software was developed by the Computer Systems Engineering group
42# at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
43# contributed to Berkeley.
44#
45# All advertising materials mentioning features or use of this software
46# must display the following acknowledgement:
47#	This product includes software developed by the University of
48#	California, Lawrence Berkeley Laboratory.
49#
50# Redistribution and use in source and binary forms, with or without
51# modification, are permitted provided that the following conditions
52# are met:
53# 1. Redistributions of source code must retain the above copyright
54#    notice, this list of conditions and the following disclaimer.
55# 2. Redistributions in binary form must reproduce the above copyright
56#    notice, this list of conditions and the following disclaimer in the
57#    documentation and/or other materials provided with the distribution.
58# 3. All advertising materials mentioning features or use of this software
59#    must display the following acknowledgement:
60#	This product includes software developed by the University of
61#	California, Berkeley and its contributors.
62# 4. Neither the name of the University nor the names of its contributors
63#    may be used to endorse or promote products derived from this software
64#    without specific prior written permission.
65#
66# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
67# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
68# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
69# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
70# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
71# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
72# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
73# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
74# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
75# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
76# SUCH DAMAGE.
77#
78#	@(#)genassym.c	8.1 (Berkeley) 6/11/93
79#
80
81include <sys/param.h>
82include <sys/buf.h>
83include <sys/proc.h>
84include <sys/map.h>
85include <sys/proc.h>
86include <sys/mbuf.h>
87include <sys/msgbuf.h>
88include <sys/syscall.h>
89include <sys/user.h>
90include <sys/device.h>
91include <sys/disklabel.h>
92include <sys/disk.h>
93
94include <uvm/uvm.h>
95
96include <machine/db_machdep.h>
97include <machine/pmap.h>
98include <machine/cpu.h>
99include <machine/reg.h>
100
101#include <sparc64/sparc64/cpuvar.h>
102
103ifdef notyet
104include <sparc64/dev/zsreg.h>
105include <sparc64/dev/zsvar.h>
106endif
107
108ifdef notyet
109include <dev/ic/am7930reg.h>
110include <dev/ic/am7930var.h>
111
112include <dev/sun/fdreg.h>
113include <dev/sun/fdvar.h>
114endif
115
116# general constants
117define	BSD		BSD
118define	USRSTACK	USRSTACK
119define	PADDRT		sizeof(paddr_t)
120
121# proc fields and values
122define	P_ADDR		offsetof(struct proc, p_addr)
123define	P_STAT		offsetof(struct proc, p_stat)
124define	P_WCHAN		offsetof(struct proc, p_wchan)
125define	P_VMSPACE	offsetof(struct proc, p_vmspace)
126define	P_PID		offsetof(struct proc, p_pid)
127define	P_FPSTATE	offsetof(struct proc, p_md.md_fpstate)
128define	SRUN		SRUN
129define	SONPROC		SONPROC
130
131# user structure fields
132define	USIZ		sizeof(struct user)
133
134# VM structure fields
135define	VM_PMAP		offsetof(struct vmspace, vm_map.pmap)
136
137# UVM structure fields
138define	UVM_PAGE_IDLE_ZERO	offsetof(struct uvm, page_idle_zero)
139
140# pmap structure fields
141define	PM_CTX		offsetof(struct pmap, pm_ctx)
142define	PM_SEGS		offsetof(struct pmap, pm_segs)
143define	PM_PHYS		offsetof(struct pmap, pm_physaddr)
144
145
146# interrupt/fault metering
147define	V_SWTCH		offsetof(struct uvmexp, swtch)
148define	V_INTR		offsetof(struct uvmexp, intrs)
149define	V_FAULTS	offsetof(struct uvmexp, faults)
150
151# CPU info structure
152define	CI_CURPROC	offsetof(struct cpu_info, ci_curproc)
153define	CI_CPCB		offsetof(struct cpu_info, ci_cpcb)
154define	CI_NEXT		offsetof(struct cpu_info, ci_next)
155define	CI_FPPROC	offsetof(struct cpu_info, ci_fpproc)
156define	CI_NUMBER	offsetof(struct cpu_info, ci_number)
157define	CI_UPAID	offsetof(struct cpu_info, ci_upaid)
158define	CI_SPINUP	offsetof(struct cpu_info, ci_spinup)
159define	CI_INITSTACK	offsetof(struct cpu_info, ci_initstack)
160define	CI_PADDR	offsetof(struct cpu_info, ci_paddr)
161
162# FPU state
163define	FS_REGS		offsetof(struct fpstate64, fs_regs)
164define	FS_FSR		offsetof(struct fpstate64, fs_fsr)
165define	FS_GSR		offsetof(struct fpstate64, fs_gsr)
166define	FS_QSIZE	offsetof(struct fpstate64, fs_qsize)
167define	FS_QUEUE	offsetof(struct fpstate64, fs_queue)
168define	FS_SIZE		sizeof(struct fpstate64)
169define	FSR_QNE		FSR_QNE
170define	FPRS_FEF	FPRS_FEF
171define	FPRS_DU		FPRS_DU
172define	FPRS_DL		FPRS_DL
173
174# system calls
175define	SYS___sigreturn14 SYS___sigreturn14
176define	SYS_execve	SYS_execve
177define	SYS_exit	SYS_exit
178
179# errno
180define	EFAULT		EFAULT
181define	ENAMETOOLONG	ENAMETOOLONG
182
183# PCB fields
184define	PCB_NSAVED	offsetof(struct pcb, pcb_nsaved)
185define	PCB_ONFAULT	offsetof(struct pcb, pcb_onfault)
186define	PCB_PSTATE	offsetof(struct pcb, pcb_pstate)
187define	PCB_CWP		offsetof(struct pcb, pcb_cwp)
188define	PCB_PIL		offsetof(struct pcb, pcb_pil)
189define	PCB_RW		offsetof(struct pcb, pcb_rw)
190define	PCB_SP		offsetof(struct pcb, pcb_sp)
191define	PCB_PC		offsetof(struct pcb, pcb_pc)
192define  PCB_LASTCALL	offsetof(struct pcb, lastcall)
193define	PCB_SIZE	sizeof(struct pcb)
194
195
196# trapframe64 fields
197define	TF_TSTATE	offsetof(struct trapframe64, tf_tstate)
198define	TF_PC		offsetof(struct trapframe64, tf_pc)
199define	TF_NPC		offsetof(struct trapframe64, tf_npc)
200define	TF_FAULT	offsetof(struct trapframe64, tf_fault)
201define	TF_Y		offsetof(struct trapframe64, tf_y)
202define	TF_PIL		offsetof(struct trapframe64, tf_pil)
203define	TF_OLDPIL	offsetof(struct trapframe64, tf_oldpil)
204define	TF_TT		offsetof(struct trapframe64, tf_tt)
205define	TF_GLOBAL	offsetof(struct trapframe64, tf_global)
206define	TF_OUT		offsetof(struct trapframe64, tf_out)
207ifdef DEBUG
208define	TF_LOCAL	offsetof(struct trapframe64, tf_local)
209define	TF_IN		offsetof(struct trapframe64, tf_in)
210endif
211define	TF_SIZE		sizeof(struct trapframe64)
212
213ifdef notyet
214# clockframe fields
215define	CF_TSTATE	offsetof(struct clockframe, tstate)
216define	CF_PC		offsetof(struct clockframe, pc)
217define	CF_NPC		offsetof(struct clockframe, npc)
218define	CF_PIL		offsetof(struct clockframe, pil)
219define	CF_OLDPIL	offsetof(struct clockframe, oldpil)
220define	CF_FP		offsetof(struct clockframe, fp)
221endif
222
223# interrupt handler fields
224define	IH_FUN		offsetof(struct intrhand, ih_fun)
225define	IH_ARG		offsetof(struct intrhand, ih_arg)
226define	IH_NUMBER	offsetof(struct intrhand, ih_number)
227define	IH_PIL		offsetof(struct intrhand, ih_pil)
228define	IH_PEND		offsetof(struct intrhand, ih_pending)
229define	IH_NEXT		offsetof(struct intrhand, ih_next)
230define	IH_MAP		offsetof(struct intrhand, ih_map)
231define	IH_CLR		offsetof(struct intrhand, ih_clr)
232
233# mbuf fields of import
234define	M_NEXT		offsetof(struct mbuf, m_next)
235define	M_DATA		offsetof(struct mbuf, m_data)
236define	M_LEN		offsetof(struct mbuf, m_len)
237
238ifdef notyet
239# floppy trap handler fields
240define	FDC_REG_MSR	offsetof(struct fdcio, fdcio_reg_msr)
241define	FDC_REG_FIFO	offsetof(struct fdcio, fdcio_reg_fifo)
242define	FDC_ISTATE	offsetof(struct fdcio, fdcio_istate)
243define	FDC_STATUS	offsetof(struct fdcio, fdcio_status)
244define	FDC_NSTAT	offsetof(struct fdcio, fdcio_nstat)
245define	FDC_DATA	offsetof(struct fdcio, fdcio_data)
246define	FDC_TC		offsetof(struct fdcio, fdcio_tc)
247define	FDC_EVCNT	offsetof(struct fdcio, fdcio_intrcnt.ev_count)
248
249# db_regs structure so we can save all registers
250define	DBR_TRAPS	offsetof(struct db_regs, dbr_traps)
251define	DBR_Y		offsetof(struct db_regs, dbr_y)
252define	DBR_TL		offsetof(struct db_regs, dbr_tl)
253define	DBR_CANRESTORE	offsetof(struct db_regs, dbr_canrestore)
254define	DBR_CANSAVE	offsetof(struct db_regs, dbr_cansave)
255define	DBR_CLEANWIN	offsetof(struct db_regs, dbr_cleanwin)
256define	DBR_CWP		offsetof(struct db_regs, dbr_cwp)
257define	DBR_WSTATE	offsetof(struct db_regs, dbr_wstate)
258define	DBR_G		offsetof(struct db_regs, dbr_g)
259define	DBR_AG		offsetof(struct db_regs, dbr_ag)
260define	DBR_IG		offsetof(struct db_regs, dbr_ig)
261define	DBR_MG		offsetof(struct db_regs, dbr_mg)
262define	DBR_OUT		offsetof(struct db_regs, dbr_out)
263define	DBR_LOCAL	offsetof(struct db_regs, dbr_local)
264define	DBR_IN		offsetof(struct db_regs, dbr_in)
265endif
266