genassym.c revision 81337
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 81337 2001-08-09 02:32:05Z obrien $ 28 */ 29 30#include <sys/param.h> 31#include <sys/assym.h> 32#include <sys/errno.h> 33#include <sys/proc.h> 34#include <sys/queue.h> 35#include <sys/user.h> 36 37#include <vm/vm.h> 38#include <vm/pmap.h> 39 40#include <machine/asi.h> 41#include <machine/vmparam.h> 42#include <machine/cpufunc.h> 43#include <machine/fp.h> 44#include <machine/frame.h> 45#include <machine/globals.h> 46#include <machine/pcb.h> 47#include <machine/pstate.h> 48#include <machine/setjmp.h> 49#include <machine/pv.h> 50#include <machine/tte.h> 51#include <machine/tlb.h> 52#include <machine/tsb.h> 53 54/* 55 * XXX: gas, as of version 2.11.2, does not know this ASI (and some other 56 * UltraSparc specific ones). This definition will probably get us into trouble 57 * as soon as they are added. 58 */ 59ASSYM(ASI_BLK_S, ASI_BLK_S); 60 61ASSYM(EFAULT, EFAULT); 62ASSYM(ENAMETOOLONG, ENAMETOOLONG); 63 64ASSYM(UPAGES, UPAGES); 65ASSYM(PAGE_SIZE, PAGE_SIZE); 66 67ASSYM(PSTATE_AG, PSTATE_AG); 68ASSYM(PSTATE_IE, PSTATE_IE); 69ASSYM(PSTATE_PRIV, PSTATE_PRIV); 70ASSYM(PSTATE_PEF, PSTATE_PEF); 71ASSYM(PSTATE_MG, PSTATE_MG); 72ASSYM(PSTATE_IG, PSTATE_IG); 73 74ASSYM(TSTATE_AG, TSTATE_AG); 75ASSYM(TSTATE_IE, TSTATE_IE); 76ASSYM(TSTATE_PRIV, TSTATE_PRIV); 77ASSYM(TSTATE_PEF, TSTATE_PEF); 78ASSYM(TSTATE_MG, TSTATE_MG); 79ASSYM(TSTATE_IG, TSTATE_IG); 80 81ASSYM(FPRS_DL, FPRS_DL); 82ASSYM(FPRS_DU, FPRS_DU); 83ASSYM(FPRS_FEF, FPRS_FEF); 84 85ASSYM(TTE_SHIFT, TTE_SHIFT); 86ASSYM(STTE_SHIFT, STTE_SHIFT); 87ASSYM(TSB_PRIMARY_BUCKET_SHIFT, TSB_PRIMARY_BUCKET_SHIFT); 88ASSYM(TSB_KERNEL_MIN_ADDRESS, TSB_KERNEL_MIN_ADDRESS); 89ASSYM(TSB_MASK_WIDTH, TSB_MASK_WIDTH); 90ASSYM(TSB_SECONDARY_BUCKET_SHIFT, TSB_SECONDARY_BUCKET_SHIFT); 91ASSYM(TSB_BUCKET_SPREAD_SHIFT, TSB_BUCKET_SPREAD_SHIFT); 92ASSYM(TSB_SECONDARY_STTE_MASK, TSB_SECONDARY_STTE_MASK); 93ASSYM(TSB_SECONDARY_STTE_SHIFT, TSB_SECONDARY_STTE_SHIFT); 94ASSYM(TSB_LEVEL1_BUCKET_MASK, TSB_LEVEL1_BUCKET_MASK); 95ASSYM(TSB_LEVEL1_BUCKET_SHIFT, TSB_LEVEL1_BUCKET_SHIFT); 96ASSYM(TSB_1M_STTE_SHIFT, TSB_1M_STTE_SHIFT); 97ASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK); 98 99ASSYM(PAGE_SHIFT, PAGE_SHIFT); 100ASSYM(PAGE_MASK, PAGE_MASK); 101 102ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); 103ASSYM(TTE_TAG, offsetof(struct tte, tte_tag)); 104ASSYM(ST_TTE, offsetof(struct stte, st_tte)); 105ASSYM(STTE_SIZEOF, sizeof(struct stte)); 106 107ASSYM(TD_VA_LOW_MASK, TD_VA_LOW_MASK); 108ASSYM(TD_VA_LOW_SHIFT, TD_VA_LOW_SHIFT); 109ASSYM(TD_MOD, TD_MOD); 110ASSYM(TD_REF, TD_REF); 111ASSYM(TD_W, TD_W); 112 113ASSYM(TT_VA_MASK, TT_VA_MASK); 114ASSYM(TT_VA_SHIFT, TT_VA_SHIFT); 115ASSYM(TT_CTX_SHIFT, TT_CTX_SHIFT); 116 117ASSYM(GD_CURPROC, offsetof(struct globaldata, gd_curproc)); 118ASSYM(GD_CURPCB, offsetof(struct globaldata, gd_curpcb)); 119 120ASSYM(JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP])); 121ASSYM(JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC])); 122ASSYM(JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP])); 123 124ASSYM(P_ADDR, offsetof(struct proc, p_addr)); 125ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); 126ASSYM(P_FRAME, offsetof(struct proc, p_frame)); 127 128ASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate)); 129ASSYM(PCB_FP, offsetof(struct pcb, pcb_fp)); 130ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc)); 131ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); 132 133ASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0])); 134ASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1])); 135ASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2])); 136ASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3])); 137ASSYM(FP_FSR, offsetof(struct fpstate, fp_fsr)); 138ASSYM(FP_FPRS, offsetof(struct fpstate, fp_fprs)); 139 140ASSYM(F_L0, offsetof(struct frame, f_local[0])); 141ASSYM(F_L1, offsetof(struct frame, f_local[1])); 142ASSYM(F_L2, offsetof(struct frame, f_local[2])); 143ASSYM(F_L3, offsetof(struct frame, f_local[3])); 144ASSYM(F_L4, offsetof(struct frame, f_local[4])); 145ASSYM(F_L5, offsetof(struct frame, f_local[5])); 146ASSYM(F_L6, offsetof(struct frame, f_local[6])); 147ASSYM(F_L7, offsetof(struct frame, f_local[7])); 148ASSYM(F_I0, offsetof(struct frame, f_in[0])); 149ASSYM(F_I1, offsetof(struct frame, f_in[1])); 150ASSYM(F_I2, offsetof(struct frame, f_in[2])); 151ASSYM(F_I3, offsetof(struct frame, f_in[3])); 152ASSYM(F_I4, offsetof(struct frame, f_in[4])); 153ASSYM(F_I5, offsetof(struct frame, f_in[5])); 154ASSYM(F_I6, offsetof(struct frame, f_in[6])); 155ASSYM(F_I7, offsetof(struct frame, f_in[7])); 156ASSYM(CCFSZ, sizeof(struct frame)); 157ASSYM(SPOFF, SPOFF); 158 159ASSYM(KF_FP, offsetof(struct kdbframe, kf_fp)); 160ASSYM(KF_SIZEOF, sizeof(struct kdbframe)); 161 162ASSYM(MF_SFAR, offsetof(struct mmuframe, mf_sfar)); 163ASSYM(MF_SFSR, offsetof(struct mmuframe, mf_sfsr)); 164ASSYM(MF_TAR, offsetof(struct mmuframe, mf_tar)); 165ASSYM(MF_SIZEOF, sizeof(struct mmuframe)); 166 167ASSYM(TF_G0, offsetof(struct trapframe, tf_global[0])); 168ASSYM(TF_G1, offsetof(struct trapframe, tf_global[1])); 169ASSYM(TF_G2, offsetof(struct trapframe, tf_global[2])); 170ASSYM(TF_G3, offsetof(struct trapframe, tf_global[3])); 171ASSYM(TF_G4, offsetof(struct trapframe, tf_global[4])); 172ASSYM(TF_G5, offsetof(struct trapframe, tf_global[5])); 173ASSYM(TF_G6, offsetof(struct trapframe, tf_global[6])); 174ASSYM(TF_G7, offsetof(struct trapframe, tf_global[7])); 175ASSYM(TF_O0, offsetof(struct trapframe, tf_out[0])); 176ASSYM(TF_O1, offsetof(struct trapframe, tf_out[1])); 177ASSYM(TF_O2, offsetof(struct trapframe, tf_out[2])); 178ASSYM(TF_O3, offsetof(struct trapframe, tf_out[3])); 179ASSYM(TF_O4, offsetof(struct trapframe, tf_out[4])); 180ASSYM(TF_O5, offsetof(struct trapframe, tf_out[5])); 181ASSYM(TF_O6, offsetof(struct trapframe, tf_out[6])); 182ASSYM(TF_O7, offsetof(struct trapframe, tf_out[7])); 183ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); 184ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); 185ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); 186ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); 187ASSYM(TF_ARG, offsetof(struct trapframe, tf_arg)); 188ASSYM(TF_SIZEOF, sizeof(struct trapframe)); 189 190ASSYM(U_PCB, offsetof(struct user, u_pcb)); 191