genassym.c revision 100771
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 100771 2002-07-27 21:57:38Z jake $ 28 */ 29 30#include <sys/param.h> 31#include <sys/assym.h> 32#include <sys/errno.h> 33#include <sys/gmon.h> 34#include <sys/ktr.h> 35#include <sys/proc.h> 36#include <sys/queue.h> 37#include <sys/signal.h> 38#include <sys/smp.h> 39#include <sys/systm.h> 40#include <sys/ucontext.h> 41#include <sys/user.h> 42#include <sys/ucontext.h> 43#include <sys/vmmeter.h> 44 45#include <vm/vm.h> 46#include <vm/vm_param.h> 47#include <vm/vm_kern.h> 48#include <vm/vm_page.h> 49#include <vm/vm_map.h> 50 51#include <machine/asi.h> 52#include <machine/cache.h> 53#include <machine/vmparam.h> 54#include <machine/cpufunc.h> 55#include <machine/fp.h> 56#include <machine/frame.h> 57#include <machine/fsr.h> 58#include <machine/intr_machdep.h> 59#include <machine/lsu.h> 60#include <machine/pcb.h> 61#include <machine/pstate.h> 62#include <machine/setjmp.h> 63#include <machine/sigframe.h> 64#include <machine/smp.h> 65#include <machine/tte.h> 66#include <machine/tlb.h> 67#include <machine/tsb.h> 68#include <machine/tstate.h> 69#include <machine/upa.h> 70#include <machine/utrap.h> 71 72ASSYM(KERNBASE, KERNBASE); 73 74ASSYM(EFAULT, EFAULT); 75ASSYM(ENAMETOOLONG, ENAMETOOLONG); 76 77ASSYM(KSTACK_PAGES, KSTACK_PAGES); 78ASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES); 79ASSYM(PCPU_PAGES, PCPU_PAGES); 80ASSYM(UAREA_PAGES, UAREA_PAGES); 81ASSYM(PAGE_SIZE, PAGE_SIZE); 82 83ASSYM(PIL_TICK, PIL_TICK); 84 85ASSYM(FPRS_DL, FPRS_DL); 86ASSYM(FPRS_DU, FPRS_DU); 87ASSYM(FPRS_FEF, FPRS_FEF); 88 89ASSYM(LSU_VW, LSU_VW); 90 91ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT); 92 93ASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT); 94ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); 95ASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY); 96ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT); 97ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE); 98ASSYM(TLB_DIRECT_MASK, TLB_DIRECT_MASK); 99ASSYM(TLB_DIRECT_UNCACHEABLE, TLB_DIRECT_UNCACHEABLE); 100ASSYM(TLB_DIRECT_SHIFT, TLB_DIRECT_SHIFT); 101 102ASSYM(TSB_BUCKET_ADDRESS_BITS, TSB_BUCKET_ADDRESS_BITS); 103ASSYM(TSB_BUCKET_SHIFT, TSB_BUCKET_SHIFT); 104ASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK); 105 106ASSYM(INT_SHIFT, INT_SHIFT); 107ASSYM(PTR_SHIFT, PTR_SHIFT); 108 109ASSYM(PAGE_SHIFT, PAGE_SHIFT); 110ASSYM(PAGE_MASK, PAGE_MASK); 111 112ASSYM(CPU_CLKSYNC, CPU_CLKSYNC); 113ASSYM(CPU_INIT, CPU_INIT); 114 115ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid)); 116ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu)); 117ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state)); 118ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick)); 119ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); 120ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes)); 121 122ASSYM(DC_TAG_SHIFT, DC_TAG_SHIFT); 123ASSYM(DC_TAG_MASK, DC_TAG_MASK); 124ASSYM(DC_VALID_SHIFT, DC_VALID_SHIFT); 125ASSYM(DC_VALID_MASK, DC_VALID_MASK); 126ASSYM(IC_TAG_SHIFT, IC_TAG_SHIFT); 127ASSYM(IC_TAG_MASK, IC_TAG_MASK); 128ASSYM(IC_VALID_SHIFT, IC_VALID_SHIFT); 129ASSYM(IC_VALID_MASK, IC_VALID_MASK); 130 131ASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size)); 132ASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize)); 133ASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size)); 134ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize)); 135 136ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa)); 137 138ASSYM(GMON_PROF_OFF, GMON_PROF_OFF); 139ASSYM(GMON_PROF_HIRES, GMON_PROF_HIRES); 140ASSYM(GM_STATE, offsetof(struct gmonparam, state)); 141 142ASSYM(KTR_PROC, KTR_PROC); 143ASSYM(KTR_TRAP, KTR_TRAP); 144ASSYM(KTR_SMP, KTR_SMP); 145ASSYM(KTR_SYSC, KTR_SYSC); 146ASSYM(KTR_INTR, KTR_INTR); 147ASSYM(KTR_CT1, KTR_CT1); 148ASSYM(KTR_CT2, KTR_CT2); 149ASSYM(KTR_CT3, KTR_CT3); 150ASSYM(KTR_CT4, KTR_CT4); 151ASSYM(KTR_CT5, KTR_CT5); 152ASSYM(KTR_CT6, KTR_CT6); 153ASSYM(KTR_CT7, KTR_CT7); 154ASSYM(KTR_CT8, KTR_CT8); 155 156ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); 157ASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line)); 158ASSYM(KTR_FILE, offsetof(struct ktr_entry, ktr_file)); 159ASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc)); 160ASSYM(KTR_CPU, offsetof(struct ktr_entry, ktr_cpu)); 161ASSYM(KTR_TIMESTAMP, offsetof(struct ktr_entry, ktr_timestamp)); 162ASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parms[0])); 163ASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parms[1])); 164ASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parms[2])); 165ASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parms[3])); 166ASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4])); 167ASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5])); 168 169ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn)); 170ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); 171ASSYM(TTE_SHIFT, TTE_SHIFT); 172 173ASSYM(TD_EXEC, TD_EXEC); 174ASSYM(TD_REF, TD_REF); 175ASSYM(TD_SW, TD_SW); 176ASSYM(TD_V, TD_V); 177ASSYM(TD_8K, TD_8K); 178ASSYM(TD_CP, TD_CP); 179ASSYM(TD_CV, TD_CV); 180ASSYM(TD_L, TD_L); 181ASSYM(TD_W, TD_W); 182 183ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); 184 185ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); 186ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); 187ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); 188ASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask)); 189ASSYM(PC_IRHEAD, offsetof(struct pcpu, pc_irhead)); 190ASSYM(PC_IRTAIL, offsetof(struct pcpu, pc_irtail)); 191ASSYM(PC_IRFREE, offsetof(struct pcpu, pc_irfree)); 192ASSYM(PC_MID, offsetof(struct pcpu, pc_mid)); 193ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx)); 194ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max)); 195ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min)); 196ASSYM(PC_VMSPACE, offsetof(struct pcpu, pc_vmspace)); 197ASSYM(PC_SIZEOF, sizeof(struct pcpu)); 198 199ASSYM(IH_SHIFT, IH_SHIFT); 200 201ASSYM(IRSR_BUSY, IRSR_BUSY); 202 203ASSYM(IR_NEXT, offsetof(struct intr_request, ir_next)); 204ASSYM(IR_FUNC, offsetof(struct intr_request, ir_func)); 205ASSYM(IR_ARG, offsetof(struct intr_request, ir_arg)); 206ASSYM(IR_PRI, offsetof(struct intr_request, ir_pri)); 207ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec)); 208 209ASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask)); 210ASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap)); 211ASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start)); 212ASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end)); 213ASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va)); 214 215ASSYM(IV_SHIFT, IV_SHIFT); 216ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func)); 217ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg)); 218ASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri)); 219 220ASSYM(IV_MAX, IV_MAX); 221 222ASSYM(KEF_ASTPENDING, KEF_ASTPENDING); 223ASSYM(KEF_NEEDRESCHED, KEF_NEEDRESCHED); 224 225ASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap)); 226 227ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock)); 228 229ASSYM(P_COMM, offsetof(struct proc, p_comm)); 230ASSYM(P_MD, offsetof(struct proc, p_md)); 231ASSYM(P_PID, offsetof(struct proc, p_pid)); 232ASSYM(P_SFLAG, offsetof(struct proc, p_sflag)); 233ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); 234 235ASSYM(RW_SHIFT, RW_SHIFT); 236 237ASSYM(KE_FLAGS, offsetof(struct kse, ke_flags)); 238 239ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); 240ASSYM(TD_KSE, offsetof(struct thread, td_kse)); 241ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack)); 242ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); 243ASSYM(TD_PROC, offsetof(struct thread, td_proc)); 244 245ASSYM(PCB_SIZEOF, sizeof(struct pcb)); 246ASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate)); 247ASSYM(PCB_FP, offsetof(struct pcb, pcb_fp)); 248ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc)); 249ASSYM(PCB_Y, offsetof(struct pcb, pcb_pc)); 250ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); 251ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved)); 252ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp)); 253ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw)); 254 255ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); 256ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); 257ASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context)); 258ASSYM(PM_TSB, offsetof(struct pmap, pm_tsb)); 259 260ASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0])); 261ASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1])); 262ASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2])); 263ASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3])); 264 265ASSYM(CCFSZ, sizeof(struct frame)); 266ASSYM(SPOFF, SPOFF); 267 268ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); 269 270ASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP])); 271ASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC])); 272ASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP])); 273ASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG])); 274ASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK])); 275 276ASSYM(TF_G0, offsetof(struct trapframe, tf_global[0])); 277ASSYM(TF_G1, offsetof(struct trapframe, tf_global[1])); 278ASSYM(TF_G2, offsetof(struct trapframe, tf_global[2])); 279ASSYM(TF_G3, offsetof(struct trapframe, tf_global[3])); 280ASSYM(TF_G4, offsetof(struct trapframe, tf_global[4])); 281ASSYM(TF_G5, offsetof(struct trapframe, tf_global[5])); 282ASSYM(TF_G6, offsetof(struct trapframe, tf_global[6])); 283ASSYM(TF_G7, offsetof(struct trapframe, tf_global[7])); 284ASSYM(TF_O0, offsetof(struct trapframe, tf_out[0])); 285ASSYM(TF_O1, offsetof(struct trapframe, tf_out[1])); 286ASSYM(TF_O2, offsetof(struct trapframe, tf_out[2])); 287ASSYM(TF_O3, offsetof(struct trapframe, tf_out[3])); 288ASSYM(TF_O4, offsetof(struct trapframe, tf_out[4])); 289ASSYM(TF_O5, offsetof(struct trapframe, tf_out[5])); 290ASSYM(TF_O6, offsetof(struct trapframe, tf_out[6])); 291ASSYM(TF_O7, offsetof(struct trapframe, tf_out[7])); 292ASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr)); 293ASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar)); 294ASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level)); 295ASSYM(TF_TAR, offsetof(struct trapframe, tf_tar)); 296ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); 297ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); 298ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); 299ASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr)); 300ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); 301ASSYM(TF_Y, offsetof(struct trapframe, tf_y)); 302ASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs)); 303ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil)); 304ASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate)); 305ASSYM(TF_SIZEOF, sizeof(struct trapframe)); 306 307ASSYM(UT_MAX, UT_MAX); 308