1# $NetBSD: genassym.cf,v 1.27 2002/09/25 19:30:22 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. All advertising materials mentioning features or use of this software 16# must display the following acknowledgement: 17# This product includes software developed by the University of 18# California, Berkeley and its contributors. 19# 4. Neither the name of the University nor the names of its contributors 20# may be used to endorse or promote products derived from this software 21# without specific prior written permission. 22# 23# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33# SUCH DAMAGE. 34# 35# @(#)genassym.c 8.3 (Berkeley) 1/4/94 36# 37 38if defined(_KERNEL_OPT) 39include "opt_compat_svr4.h" 40endif 41 42include <sys/param.h> 43include <sys/buf.h> 44include <sys/proc.h> 45include <sys/mbuf.h> 46include <sys/msgbuf.h> 47include <sys/syscall.h> 48include <sys/user.h> 49 50include <uvm/uvm.h> 51 52ifdef COMPAT_SVR4 53include <compat/svr4/svr4_syscall.h> 54include <compat/svr4/svr4_ucontext.h> 55endif 56 57include <machine/hp300spu.h> 58include <machine/cpu.h> 59include <machine/frame.h> 60include <machine/intr.h> 61include <machine/psl.h> 62include <machine/reg.h> 63include <machine/pte.h> 64 65include <hp300/hp300/clockreg.h> 66 67# values for mmutype 68define MMU_68040 MMU_68040 69define MMU_68030 MMU_68030 70define MMU_HP MMU_HP 71define MMU_68851 MMU_68851 72 73# MMU configuration options 74ifdef M68K_MMU_HP 75define M68K_MMU_HP 1 76endif 77ifdef M68K_MMU_MOTOROLA 78define M68K_MMU_MOTOROLA 1 79endif 80 81# values for cputype 82define CPU_68020 CPU_68020 83define CPU_68030 CPU_68030 84define CPU_68040 CPU_68040 85 86# CPU configuration options 87ifdef M68020 88define M68020 1 89endif 90ifdef M68030 91define M68030 1 92endif 93ifdef M68040 94define M68040 1 95endif 96 97# values for fputype 98define FPU_68881 FPU_68881 99define FPU_68882 FPU_68882 100define FPU_68040 FPU_68040 101 102# values for machineid 103define HP_320 HP_320 104define HP_330 HP_330 105define HP_340 HP_340 106define HP_345 HP_345 107define HP_350 HP_350 108define HP_360 HP_360 109define HP_370 HP_370 110define HP_375 HP_375 111define HP_380 HP_380 112define HP_385 HP_385 113define HP_400 HP_400 114define HP_425 HP_425 115define HP_433 HP_433 116 117# values for mmuid 118define MMUID_345 MMUID_345 119define MMUID_375 MMUID_375 120define MMUID_385 MMUID_385 121define MMUID_425_T MMUID_425_T 122define MMUID_425_S MMUID_425_S 123define MMUID_433_T MMUID_433_T 124define MMUID_433_S MMUID_433_S 125define MMUID_425_E MMUID_425_E 126 127define MMUID_SHIFT MMUID_SHIFT 128define MMUID_MASK MMUID_MASK 129 130# values for ectype 131define EC_PHYS EC_PHYS 132define EC_NONE EC_NONE 133define EC_VIRT EC_VIRT 134 135# Cache type configuration options 136ifdef CACHE_HAVE_VAC 137define CACHE_HAVE_VAC 1 138endif 139ifdef CACHE_HAVE_PAC 140define CACHE_HAVE_PAC 1 141endif 142 143# general constants 144define UPAGES UPAGES 145define USPACE USPACE 146define NBPG NBPG 147define PGSHIFT PGSHIFT 148define USRSTACK USRSTACK 149define MAXADDR MAXADDR 150 151# proc fields and values 152define P_FORW offsetof(struct proc, p_forw) 153define P_BACK offsetof(struct proc, p_back) 154define P_VMSPACE offsetof(struct proc, p_vmspace) 155define P_ADDR offsetof(struct proc, p_addr) 156define P_PRIORITY offsetof(struct proc, p_priority) 157define P_STAT offsetof(struct proc, p_stat) 158define P_WCHAN offsetof(struct proc, p_wchan) 159define P_NRAS offsetof(struct proc, p_nras) 160define P_MD_FLAGS offsetof(struct proc, p_md.md_flags) 161define P_MD_REGS offsetof(struct proc, p_md.md_regs) 162define SSLEEP SSLEEP 163define SRUN SRUN 164define SONPROC SONPROC 165 166# interrupt event counters 167define HI_EVCNT offsetof(struct hp300_intr, hi_evcnt) 168define SIZEOF_HI sizeof(struct hp300_intr) 169 170# interrupt/fault metering 171define UVMEXP_INTRS offsetof(struct uvmexp, intrs) 172 173define UVM_PAGE_IDLE_ZERO offsetof(struct uvm, page_idle_zero) 174 175# PSL values (should just include psl.h?) 176define PSL_S PSL_S 177define PSL_IPL7 PSL_IPL7 178define PSL_LOWIPL PSL_LOWIPL 179define PSL_HIGHIPL PSL_HIGHIPL 180define PSL_USER PSL_USER 181define PSL_TS PSL_T | PSL_S 182define SPL1 PSL_S | PSL_IPL1 183define SPL2 PSL_S | PSL_IPL2 184define SPL3 PSL_S | PSL_IPL3 185define SPL4 PSL_S | PSL_IPL4 186define SPL5 PSL_S | PSL_IPL5 187define SPL6 PSL_S | PSL_IPL6 188 189# magic 190define FC_USERD FC_USERD 191define FC_PURGE FC_PURGE 192define INTIOBASE INTIOBASE 193define MMUBASE MMUBASE 194define MMUSTAT MMUSTAT 195define MMUCMD MMUCMD 196define MMUSSTP MMUSSTP 197define MMUUSTP MMUUSTP 198define MMUTBINVAL MMUTBINVAL 199define MMU_BERR MMU_BERR 200define MMU_ENAB MMU_ENAB 201define MMU_FAULT MMU_FAULT 202define MMU_CEN MMU_CEN 203define MMU_IEN MMU_IEN 204define MMU_FPE MMU_FPE 205define CACHE_ON CACHE_ON 206define CACHE_OFF CACHE_OFF 207define CACHE_CLR CACHE_CLR 208define IC_CLEAR IC_CLEAR 209define DC_CLEAR DC_CLEAR 210 211# pte/ste bits 212define PG_V PG_V 213define PG_NV PG_NV 214define PG_RO PG_RO 215define PG_RW PG_RW 216define PG_CI PG_CI 217define PG_PROT PG_PROT 218define PG_FRAME PG_FRAME 219define SG_V SG_V 220define SG_NV SG_NV 221define SG_RW SG_RW 222define SG_FRAME SG_FRAME 223define SG_ISHIFT SG_ISHIFT 224 225# frame fields 226define TF_PC offsetof(struct frame, f_pc) 227 228# pcb fields 229define PCB_PS offsetof(struct pcb, pcb_ps) 230define PCB_USP offsetof(struct pcb, pcb_usp) 231define PCB_REGS offsetof(struct pcb, pcb_regs) 232define PCB_ONFAULT offsetof(struct pcb, pcb_onfault) 233define PCB_FPCTX offsetof(struct pcb, pcb_fpregs) 234define SIZEOF_PCB sizeof(struct pcb) 235 236# exception frame offset/sizes 237define FR_SP offsetof(struct frame, f_regs[15]) 238define FR_HW offsetof(struct frame, f_sr) 239define FR_ADJ offsetof(struct frame, f_stackadj) 240define FR_SIZE sizeof(struct trapframe) 241 242# FP frame offsets 243define FPF_REGS offsetof(struct fpframe, fpf_regs[0]) 244define FPF_FPCR offsetof(struct fpframe, fpf_fpcr) 245 246# system calls 247define SYS_exit SYS_exit 248define SYS_execve SYS_execve 249define SYS___sigreturn14 SYS___sigreturn14 250define SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13 251 252# errno 253define EFAULT EFAULT 254define ENAMETOOLONG ENAMETOOLONG 255 256# clock registers 257define CLKSR CLKSR 258define CLKMSB1 CLKMSB1 259define CLKMSB3 CLKMSB3 260 261# SVR4 binary compatibility 262ifdef COMPAT_SVR4 263define SVR4_SIGF_HANDLER offsetof(struct svr4_sigframe, sf_handler) 264define SVR4_SIGF_UC offsetof(struct svr4_sigframe, sf_uc) 265define SVR4_SYS_context SVR4_SYS_context 266define SVR4_SYS_exit SVR4_SYS_exit 267define SVR4_SETCONTEXT SVR4_SETCONTEXT 268endif 269