1# $NetBSD: genassym.cf,v 1.1 2024/01/02 07:41:02 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# @(#)genassym.c 8.3 (Berkeley) 1/4/94 32# 33 34include <sys/param.h> 35include <sys/buf.h> 36include <sys/proc.h> 37include <sys/mbuf.h> 38include <sys/msgbuf.h> 39include <sys/queue.h> 40include <sys/syscall.h> 41 42include <uvm/uvm_extern.h> 43 44include <machine/cpu.h> 45include <machine/fcode.h> 46include <machine/psl.h> 47include <machine/pcb.h> 48include <machine/pte.h> 49 50# MMU options 51define M68K_MMU_MOTOROLA 1 52 53# values for mmutype 54define MMU_68060 MMU_68060 55define MMU_68040 MMU_68040 56define MMU_68030 MMU_68030 57define MMU_68851 MMU_68851 58 59# values for cputype 60define CPU_68020 CPU_68020 61define CPU_68030 CPU_68030 62define CPU_68040 CPU_68040 63define CPU_68060 CPU_68060 64 65# values for fputype 66define FPU_68881 FPU_68881 67define FPU_68882 FPU_68882 68define FPU_68040 FPU_68040 69define FPU_68060 FPU_68060 70 71# values for ectype 72define EC_PHYS EC_PHYS 73define EC_NONE EC_NONE 74define EC_VIRT EC_VIRT 75 76define UPAGES UPAGES 77define USPACE USPACE 78define PAGE_SIZE PAGE_SIZE 79define PGSHIFT PGSHIFT 80define USRSTACK USRSTACK 81export VM_MAX_KERNEL_ADDRESS 82 83# MMU configuration constants (from pmap.h) 84export MMU51_SRP_BITS 85export MMU51_CRP_BITS 86export MMU51_TCR_BITS 87export MMU40_TCR_BITS 88 89export VIRT68K_TT30_IO 90export VIRT68K_TT40_IO 91 92# lwp & proc fields and values 93define L_PCB offsetof(struct lwp, l_addr) 94define L_PROC offsetof(struct lwp, l_proc) 95define L_MD_REGS offsetof(struct lwp, l_md.md_regs) 96define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) 97define P_FLAG offsetof(struct proc, p_flag) 98define P_RASLIST offsetof(struct proc, p_raslist) 99define P_VMSPACE offsetof(struct proc, p_vmspace) 100 101# interrupt/fault metering 102define CI_NINTR offsetof(struct cpu_info, ci_data.cpu_nintr) 103 104# PSL values (should just include psl.h?) 105define PSL_S PSL_S 106define PSL_IPL7 PSL_IPL7 107define PSL_LOWIPL PSL_LOWIPL 108define PSL_HIGHIPL PSL_HIGHIPL 109define PSL_USER PSL_USER 110define PSL_TS PSL_T | PSL_S 111define SPL1 PSL_S | PSL_IPL1 112define SPL2 PSL_S | PSL_IPL2 113define SPL3 PSL_S | PSL_IPL3 114define SPL4 PSL_S | PSL_IPL4 115define SPL5 PSL_S | PSL_IPL5 116define SPL6 PSL_S | PSL_IPL6 117 118# magic 119define FC_USERD FC_USERD 120define CACHE_ON CACHE_ON 121define CACHE_OFF CACHE_OFF 122define CACHE40_OFF CACHE40_OFF 123define CACHE_CLR CACHE_CLR 124define IC_CLEAR IC_CLEAR 125define DC_CLEAR DC_CLEAR 126define IC60_CUBC IC60_CUBC 127define IC60_CABC IC60_CABC 128 129# pte/ste bits 130define PG_V PG_V 131define PG_NV PG_NV 132define PG_RO PG_RO 133define PG_RW PG_RW 134define PG_CI PG_CI 135define PG_PROT PG_PROT 136define PG_FRAME PG_FRAME 137define SG_V SG_V 138define SG_NV SG_NV 139define SG_RW SG_RW 140define SG_FRAME SG_FRAME 141define SG_ISHIFT SG_ISHIFT 142 143# pcb fields 144define PCB_PS offsetof(struct pcb, pcb_ps) 145define PCB_USP offsetof(struct pcb, pcb_usp) 146define PCB_REGS offsetof(struct pcb, pcb_regs) 147define PCB_ONFAULT offsetof(struct pcb, pcb_onfault) 148define PCB_FPCTX offsetof(struct pcb, pcb_fpregs) 149define SIZEOF_PCB sizeof(struct pcb) 150 151# frame offsets 152define TF_PC offsetof(struct frame, f_pc) 153 154# exception frame offset/sizes 155define FR_SP offsetof(struct frame, f_regs[15]) 156define FR_HW offsetof(struct frame, f_sr) 157define FR_ADJ offsetof(struct frame, f_stackadj) 158define FR_SIZE sizeof(struct trapframe) 159 160# FP frame offsets 161define FPF_REGS offsetof(struct fpframe, fpf_regs[0]) 162define FPF_FPCR offsetof(struct fpframe, fpf_fpcr) 163define FPF_FPSR offsetof(struct fpframe, fpf_fpsr) 164define FPF_FPI offsetof(struct fpframe, fpf_fpiar) 165 166# system calls 167define SYS_exit SYS_exit 168define SYS_execve SYS_execve 169define SYS_compat_16___sigreturn14 SYS_compat_16___sigreturn14 170define SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13 171 172# errno 173define EFAULT EFAULT 174define ENAMETOOLONG ENAMETOOLONG 175