1# $NetBSD: genassym.cf,v 1.2 2002/05/11 09:39:27 jdolecek 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 <sun2/sun2/buserr.h> 67include <sun2/sun2/control.h> 68include <sun2/sun2/fc.h> 69include <sun2/sun2/enable.h> 70 71include <dev/ic/am9513reg.h> 72 73# XXX: for copy.s 74define M68010 1 75 76# bus error stuff 77define BUSERR_REG BUSERR_REG 78define BUSERR_PROTERR BUSERR_PROTERR 79 80# 68k isms 81define PSL_LOWIPL PSL_LOWIPL 82define PSL_HIGHIPL PSL_HIGHIPL 83define PSL_USER PSL_USER 84define PSL_S PSL_S 85define PSL_TS PSL_T | PSL_S 86define FC_CONTROL FC_CONTROL 87define FC_SUPERD FC_SUPERD 88define FC_USERD FC_USERD 89 90# sun2 control space isms 91define SCONTEXT_REG SCONTEXT_REG 92define CONTEXT_REG CONTEXT_REG 93define CONTEXT_NUM CONTEXT_NUM 94define SYSTEM_ENAB SYSTEM_ENAB 95define ENA_INTS ENA_INTS 96define SEGMAP_BASE SEGMAP_BASE 97 98# sun2 memory map 99define USRSTACK USRSTACK 100define SUN2_MONSTART SUN2_MONSTART 101define SUN2_PROM_BASE SUN2_PROM_BASE 102define SUN2_MONEND SUN2_MONEND 103 104# sun2 clock 105define AM9513_CLK_CMD AM9513_CLK_CMD 106define SUN2_CLK_TIMER_CLEAR_OUTPUT AM9513_CMD_CLEAR_OUTPUT(AM9513_TIMER2) 107 108# kernel-isms 109define KERNBASE KERNBASE 110define USPACE USPACE 111define NBPG NBPG 112define NBSG NBSG 113 114# system calls 115define SYS_exit SYS_exit 116define SYS___sigreturn14 SYS___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# proc fields and values 130define P_FORW offsetof(struct proc, p_forw) 131define P_BACK offsetof(struct proc, p_back) 132define P_VMSPACE offsetof(struct proc, p_vmspace) 133define P_ADDR offsetof(struct proc, p_addr) 134define P_PRIORITY offsetof(struct proc, p_priority) 135define P_STAT offsetof(struct proc, p_stat) 136define P_WCHAN offsetof(struct proc, p_wchan) 137define P_FLAG offsetof(struct proc, p_flag) 138define P_MDFLAG offsetof(struct proc, p_md.md_flags) 139define P_MDREGS offsetof(struct proc, p_md.md_regs) 140define SRUN SRUN 141define SONPROC SONPROC 142 143# XXX: HP-UX trace bit? 144 145# VM/pmap structure fields 146define VM_PMAP offsetof(struct vmspace, vm_map.pmap) 147define PM_CTXNUM offsetof(struct pmap, pm_ctxnum) 148 149# pcb offsets 150define PCB_FLAGS offsetof(struct pcb, pcb_flags) 151define PCB_PS offsetof(struct pcb, pcb_ps) 152define PCB_USP offsetof(struct pcb, pcb_usp) 153define PCB_REGS offsetof(struct pcb, pcb_regs[0]) 154define PCB_ONFAULT offsetof(struct pcb, pcb_onfault) 155define PCB_FPCTX offsetof(struct pcb, pcb_fpregs) 156define SIZEOF_PCB sizeof(struct pcb) 157 158# exception frame offset/sizes 159define FR_SP offsetof(struct trapframe, tf_regs[15]) 160define FR_ADJ offsetof(struct trapframe, tf_stackadj) 161define FR_HW offsetof(struct trapframe, tf_sr) 162define FR_SIZE sizeof(struct trapframe) 163 164# FP frame offsets 165define FPF_REGS offsetof(struct fpframe, fpf_regs[0]) 166define FPF_FPCR offsetof(struct fpframe, fpf_fpcr) 167 168# SVR4 binary compatibility 169ifdef COMPAT_SVR4 170define SVR4_SIGF_HANDLER offsetof(struct svr4_sigframe, sf_handler) 171define SVR4_SIGF_UC offsetof(struct svr4_sigframe, sf_uc) 172define SVR4_SYS_context SVR4_SYS_context 173define SVR4_SYS_exit SVR4_SYS_exit 174define SVR4_SETCONTEXT SVR4_SETCONTEXT 175endif 176