1# $NetBSD: genassym.cf,v 1.27 2002/09/26 08:49:34 martin 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/proc.h> 85include <sys/mbuf.h> 86include <sys/msgbuf.h> 87include <sys/syscall.h> 88include <sys/user.h> 89include <sys/device.h> 90include <sys/disklabel.h> 91include <sys/disk.h> 92 93include <uvm/uvm.h> 94 95include <machine/db_machdep.h> 96include <machine/pmap.h> 97include <machine/cpu.h> 98include <machine/reg.h> 99 100#include <sparc64/sparc64/cpuvar.h> 101 102ifdef notyet 103include <sparc64/dev/zsreg.h> 104include <sparc64/dev/zsvar.h> 105endif 106 107ifdef notyet 108include <dev/ic/am7930reg.h> 109include <dev/ic/am7930var.h> 110 111include <dev/sun/fdreg.h> 112include <dev/sun/fdvar.h> 113endif 114 115# general constants 116define BSD BSD 117define USRSTACK USRSTACK 118define PADDRT sizeof(paddr_t) 119 120# proc fields and values 121define P_ADDR offsetof(struct proc, p_addr) 122define P_STAT offsetof(struct proc, p_stat) 123define P_WCHAN offsetof(struct proc, p_wchan) 124define P_VMSPACE offsetof(struct proc, p_vmspace) 125define P_PID offsetof(struct proc, p_pid) 126define P_FPSTATE offsetof(struct proc, p_md.md_fpstate) 127define SRUN SRUN 128define SONPROC SONPROC 129 130# user structure fields 131define USIZ sizeof(struct user) 132 133# VM structure fields 134define VM_PMAP offsetof(struct vmspace, vm_map.pmap) 135 136# UVM structure fields 137define UVM_PAGE_IDLE_ZERO offsetof(struct uvm, page_idle_zero) 138 139# pmap structure fields 140define PM_CTX offsetof(struct pmap, pm_ctx) 141define PM_SEGS offsetof(struct pmap, pm_segs) 142define PM_PHYS offsetof(struct pmap, pm_physaddr) 143 144 145# interrupt/fault metering 146define V_SWTCH offsetof(struct uvmexp, swtch) 147define V_INTR offsetof(struct uvmexp, intrs) 148define V_FAULTS offsetof(struct uvmexp, faults) 149 150# CPU info structure 151define CI_CURPROC offsetof(struct cpu_info, ci_curproc) 152define CI_CPCB offsetof(struct cpu_info, ci_cpcb) 153define CI_NEXT offsetof(struct cpu_info, ci_next) 154define CI_FPPROC offsetof(struct cpu_info, ci_fpproc) 155define CI_NUMBER offsetof(struct cpu_info, ci_number) 156define CI_UPAID offsetof(struct cpu_info, ci_upaid) 157define CI_SPINUP offsetof(struct cpu_info, ci_spinup) 158define CI_INITSTACK offsetof(struct cpu_info, ci_initstack) 159define CI_PADDR offsetof(struct cpu_info, ci_paddr) 160 161# FPU state 162define FS_REGS offsetof(struct fpstate64, fs_regs) 163define FS_FSR offsetof(struct fpstate64, fs_fsr) 164define FS_GSR offsetof(struct fpstate64, fs_gsr) 165define FS_QSIZE offsetof(struct fpstate64, fs_qsize) 166define FS_QUEUE offsetof(struct fpstate64, fs_queue) 167define FS_SIZE sizeof(struct fpstate64) 168define FSR_QNE FSR_QNE 169define FPRS_FEF FPRS_FEF 170define FPRS_DU FPRS_DU 171define FPRS_DL FPRS_DL 172 173# system calls 174define SYS___sigreturn14 SYS___sigreturn14 175define SYS_execve SYS_execve 176define SYS_exit SYS_exit 177 178# errno 179define EFAULT EFAULT 180define ENAMETOOLONG ENAMETOOLONG 181 182# PCB fields 183define PCB_NSAVED offsetof(struct pcb, pcb_nsaved) 184define PCB_ONFAULT offsetof(struct pcb, pcb_onfault) 185define PCB_PSTATE offsetof(struct pcb, pcb_pstate) 186define PCB_CWP offsetof(struct pcb, pcb_cwp) 187define PCB_PIL offsetof(struct pcb, pcb_pil) 188define PCB_RW offsetof(struct pcb, pcb_rw) 189define PCB_SP offsetof(struct pcb, pcb_sp) 190define PCB_PC offsetof(struct pcb, pcb_pc) 191define PCB_LASTCALL offsetof(struct pcb, lastcall) 192define PCB_SIZE sizeof(struct pcb) 193 194 195# trapframe64 fields 196define TF_TSTATE offsetof(struct trapframe64, tf_tstate) 197define TF_PC offsetof(struct trapframe64, tf_pc) 198define TF_NPC offsetof(struct trapframe64, tf_npc) 199define TF_FAULT offsetof(struct trapframe64, tf_fault) 200define TF_Y offsetof(struct trapframe64, tf_y) 201define TF_PIL offsetof(struct trapframe64, tf_pil) 202define TF_OLDPIL offsetof(struct trapframe64, tf_oldpil) 203define TF_TT offsetof(struct trapframe64, tf_tt) 204define TF_GLOBAL offsetof(struct trapframe64, tf_global) 205define TF_OUT offsetof(struct trapframe64, tf_out) 206ifdef DEBUG 207define TF_LOCAL offsetof(struct trapframe64, tf_local) 208define TF_IN offsetof(struct trapframe64, tf_in) 209endif 210define TF_SIZE sizeof(struct trapframe64) 211 212ifdef notyet 213# clockframe fields 214define CF_TSTATE offsetof(struct clockframe, tstate) 215define CF_PC offsetof(struct clockframe, pc) 216define CF_NPC offsetof(struct clockframe, npc) 217define CF_PIL offsetof(struct clockframe, pil) 218define CF_OLDPIL offsetof(struct clockframe, oldpil) 219define CF_FP offsetof(struct clockframe, fp) 220endif 221 222# interrupt handler fields 223define IH_FUN offsetof(struct intrhand, ih_fun) 224define IH_ARG offsetof(struct intrhand, ih_arg) 225define IH_NUMBER offsetof(struct intrhand, ih_number) 226define IH_PIL offsetof(struct intrhand, ih_pil) 227define IH_PEND offsetof(struct intrhand, ih_pending) 228define IH_NEXT offsetof(struct intrhand, ih_next) 229define IH_MAP offsetof(struct intrhand, ih_map) 230define IH_CLR offsetof(struct intrhand, ih_clr) 231 232# mbuf fields of import 233define M_NEXT offsetof(struct mbuf, m_next) 234define M_DATA offsetof(struct mbuf, m_data) 235define M_LEN offsetof(struct mbuf, m_len) 236 237ifdef notyet 238# floppy trap handler fields 239define FDC_REG_MSR offsetof(struct fdcio, fdcio_reg_msr) 240define FDC_REG_FIFO offsetof(struct fdcio, fdcio_reg_fifo) 241define FDC_ISTATE offsetof(struct fdcio, fdcio_istate) 242define FDC_STATUS offsetof(struct fdcio, fdcio_status) 243define FDC_NSTAT offsetof(struct fdcio, fdcio_nstat) 244define FDC_DATA offsetof(struct fdcio, fdcio_data) 245define FDC_TC offsetof(struct fdcio, fdcio_tc) 246define FDC_EVCNT offsetof(struct fdcio, fdcio_intrcnt.ev_count) 247 248# db_regs structure so we can save all registers 249define DBR_TRAPS offsetof(struct db_regs, dbr_traps) 250define DBR_Y offsetof(struct db_regs, dbr_y) 251define DBR_TL offsetof(struct db_regs, dbr_tl) 252define DBR_CANRESTORE offsetof(struct db_regs, dbr_canrestore) 253define DBR_CANSAVE offsetof(struct db_regs, dbr_cansave) 254define DBR_CLEANWIN offsetof(struct db_regs, dbr_cleanwin) 255define DBR_CWP offsetof(struct db_regs, dbr_cwp) 256define DBR_WSTATE offsetof(struct db_regs, dbr_wstate) 257define DBR_G offsetof(struct db_regs, dbr_g) 258define DBR_AG offsetof(struct db_regs, dbr_ag) 259define DBR_IG offsetof(struct db_regs, dbr_ig) 260define DBR_MG offsetof(struct db_regs, dbr_mg) 261define DBR_OUT offsetof(struct db_regs, dbr_out) 262define DBR_LOCAL offsetof(struct db_regs, dbr_local) 263define DBR_IN offsetof(struct db_regs, dbr_in) 264endif 265