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