genassym.c revision 82910
1/*- 2 * Copyright (c) 2001 Jake Burkholder. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 27 * $FreeBSD: head/sys/sparc64/sparc64/genassym.c 82910 2001-09-03 23:19:18Z jake $ 28 */ 29 30#include <sys/param.h> 31#include <sys/assym.h> 32#include <sys/errno.h> 33#include <sys/ktr.h> 34#include <sys/proc.h> 35#include <sys/queue.h> 36#include <sys/user.h> 37 38#include <vm/vm.h> 39#include <vm/vm_param.h> 40#include <vm/vm_kern.h> 41#include <vm/vm_page.h> 42#include <vm/vm_map.h> 43 44#include <machine/asi.h> 45#include <machine/vmparam.h> 46#include <machine/cpufunc.h> 47#include <machine/fp.h> 48#include <machine/frame.h> 49#include <machine/globals.h> 50#include <machine/intr_machdep.h> 51#include <machine/pcb.h> 52#include <machine/pstate.h> 53#include <machine/setjmp.h> 54#include <machine/sigframe.h> 55#include <machine/pv.h> 56#include <machine/tte.h> 57#include <machine/tlb.h> 58#include <machine/tsb.h> 59#include <machine/tstate.h> 60 61/* 62 * XXX: gas, as of version 2.11.2, does not know this ASI (and some other 63 * UltraSparc specific ones). This definition will probably get us into trouble 64 * as soon as they are added. 65 */ 66ASSYM(ASI_BLK_S, ASI_BLK_S); 67 68ASSYM(EFAULT, EFAULT); 69ASSYM(ENAMETOOLONG, ENAMETOOLONG); 70 71ASSYM(UPAGES, UPAGES); 72ASSYM(PAGE_SIZE, PAGE_SIZE); 73 74ASSYM(PIL_TICK, PIL_TICK); 75 76ASSYM(FPRS_DL, FPRS_DL); 77ASSYM(FPRS_DU, FPRS_DU); 78ASSYM(FPRS_FEF, FPRS_FEF); 79 80ASSYM(TLB_DAR_TSB_USER_PRIMARY, TLB_DAR_SLOT(TLB_SLOT_TSB_USER_PRIMARY)); 81ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); 82 83ASSYM(TSB_USER_MIN_ADDRESS, TSB_USER_MIN_ADDRESS); 84ASSYM(TSB_PRIMARY_BUCKET_SHIFT, TSB_PRIMARY_BUCKET_SHIFT); 85ASSYM(TSB_KERNEL_MIN_ADDRESS, TSB_KERNEL_MIN_ADDRESS); 86ASSYM(TSB_PRIMARY_MASK_WIDTH, TSB_MASK_WIDTH); 87ASSYM(TSB_PRIMARY_STTE_MASK, TSB_PRIMARY_STTE_MASK); 88ASSYM(TSB_PRIMARY_STTE_SHIFT, TSB_PRIMARY_STTE_SHIFT); 89ASSYM(TSB_1M_STTE_SHIFT, TSB_1M_STTE_SHIFT); 90ASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK); 91 92ASSYM(PAGE_SHIFT, PAGE_SHIFT); 93ASSYM(PAGE_MASK, PAGE_MASK); 94 95ASSYM(KTR_COMPILE, KTR_COMPILE); 96ASSYM(KTR_CT1, KTR_CT1); 97ASSYM(KTR_CT2, KTR_CT2); 98 99ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); 100ASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc)); 101ASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parm1)); 102ASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parm2)); 103ASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parm3)); 104ASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parm4)); 105ASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parm5)); 106 107ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); 108ASSYM(TTE_TAG, offsetof(struct tte, tte_tag)); 109ASSYM(TTE_SHIFT, TTE_SHIFT); 110ASSYM(ST_TTE, offsetof(struct stte, st_tte)); 111ASSYM(STTE_SHIFT, STTE_SHIFT); 112ASSYM(STTE_SIZEOF, sizeof(struct stte)); 113 114ASSYM(TD_VA_LOW_MASK, TD_VA_LOW_MASK); 115ASSYM(TD_VA_LOW_SHIFT, TD_VA_LOW_SHIFT); 116ASSYM(TD_EXEC, TD_EXEC); 117ASSYM(TD_INIT, TD_INIT); 118ASSYM(TD_REF, TD_REF); 119ASSYM(TD_W, TD_W); 120 121ASSYM(TT_VA_MASK, TT_VA_MASK); 122ASSYM(TT_VA_SHIFT, TT_VA_SHIFT); 123ASSYM(TT_CTX_SHIFT, TT_CTX_SHIFT); 124 125ASSYM(GD_CURPROC, offsetof(struct globaldata, gd_curproc)); 126ASSYM(GD_CURPCB, offsetof(struct globaldata, gd_curpcb)); 127ASSYM(GD_CPUID, offsetof(struct globaldata, gd_cpuid)); 128 129ASSYM(GD_IQ, offsetof(struct globaldata, gd_iq)); 130ASSYM(GD_IVT, offsetof(struct globaldata, gd_ivt)); 131 132ASSYM(IQ_MASK, IQ_MASK); 133ASSYM(IQ_HEAD, offsetof(struct intr_queue, iq_head)); 134ASSYM(IQ_TAIL, offsetof(struct intr_queue, iq_tail)); 135 136ASSYM(IQE_SHIFT, IQE_SHIFT); 137ASSYM(IQE_TAG, offsetof(struct iqe, iqe_tag)); 138ASSYM(IQE_PRI, offsetof(struct iqe, iqe_pri)); 139ASSYM(IQE_VEC, offsetof(struct iqe, iqe_vec)); 140ASSYM(IQE_FUNC, offsetof(struct iqe, iqe_func)); 141ASSYM(IQE_ARG, offsetof(struct iqe, iqe_arg)); 142 143ASSYM(IV_SHIFT, IV_SHIFT); 144ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func)); 145ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg)); 146ASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri)); 147 148ASSYM(JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP])); 149ASSYM(JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC])); 150ASSYM(JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP])); 151 152ASSYM(PS_ASTPENDING, PS_ASTPENDING); 153ASSYM(PS_NEEDRESCHED, PS_NEEDRESCHED); 154 155ASSYM(P_ADDR, offsetof(struct proc, p_addr)); 156ASSYM(P_COMM, offsetof(struct proc, p_comm)); 157ASSYM(P_FRAME, offsetof(struct proc, p_frame)); 158ASSYM(P_SFLAG, offsetof(struct proc, p_sflag)); 159ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); 160 161ASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate)); 162ASSYM(PCB_FP, offsetof(struct pcb, pcb_fp)); 163ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc)); 164ASSYM(PCB_Y, offsetof(struct pcb, pcb_pc)); 165ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); 166ASSYM(PCB_CWP, offsetof(struct pcb, pcb_cwp)); 167ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved)); 168ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp)); 169ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw)); 170 171ASSYM(PCB_CWP_EMPTY, PCB_CWP_EMPTY); 172 173ASSYM(U_PCB, offsetof(struct user, u_pcb)); 174 175ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); 176ASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context)); 177ASSYM(PM_STTE, offsetof(struct pmap, pm_stte)); 178 179ASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0])); 180ASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1])); 181ASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2])); 182ASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3])); 183ASSYM(FP_FSR, offsetof(struct fpstate, fp_fsr)); 184ASSYM(FP_FPRS, offsetof(struct fpstate, fp_fprs)); 185 186ASSYM(CCFSZ, sizeof(struct frame)); 187ASSYM(SPOFF, SPOFF); 188 189ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); 190 191ASSYM(KF_FP, offsetof(struct kdbframe, kf_fp)); 192ASSYM(KF_SIZEOF, sizeof(struct kdbframe)); 193 194ASSYM(MF_SFAR, offsetof(struct mmuframe, mf_sfar)); 195ASSYM(MF_SFSR, offsetof(struct mmuframe, mf_sfsr)); 196ASSYM(MF_TAR, offsetof(struct mmuframe, mf_tar)); 197ASSYM(MF_SIZEOF, sizeof(struct mmuframe)); 198 199ASSYM(TF_G0, offsetof(struct trapframe, tf_global[0])); 200ASSYM(TF_G1, offsetof(struct trapframe, tf_global[1])); 201ASSYM(TF_G2, offsetof(struct trapframe, tf_global[2])); 202ASSYM(TF_G3, offsetof(struct trapframe, tf_global[3])); 203ASSYM(TF_G4, offsetof(struct trapframe, tf_global[4])); 204ASSYM(TF_G5, offsetof(struct trapframe, tf_global[5])); 205ASSYM(TF_G6, offsetof(struct trapframe, tf_global[6])); 206ASSYM(TF_G7, offsetof(struct trapframe, tf_global[7])); 207ASSYM(TF_O0, offsetof(struct trapframe, tf_out[0])); 208ASSYM(TF_O1, offsetof(struct trapframe, tf_out[1])); 209ASSYM(TF_O2, offsetof(struct trapframe, tf_out[2])); 210ASSYM(TF_O3, offsetof(struct trapframe, tf_out[3])); 211ASSYM(TF_O4, offsetof(struct trapframe, tf_out[4])); 212ASSYM(TF_O5, offsetof(struct trapframe, tf_out[5])); 213ASSYM(TF_O6, offsetof(struct trapframe, tf_out[6])); 214ASSYM(TF_O7, offsetof(struct trapframe, tf_out[7])); 215ASSYM(TF_SP, offsetof(struct trapframe, tf_sp)); 216ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil)); 217ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); 218ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); 219ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); 220ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); 221ASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate)); 222ASSYM(TF_ARG, offsetof(struct trapframe, tf_arg)); 223ASSYM(TF_SIZEOF, sizeof(struct trapframe)); 224