genassym.c revision 91617
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 91617 2002-03-04 07:12:36Z 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/signal.h> 37#include <sys/systm.h> 38#include <sys/ucontext.h> 39#include <sys/user.h> 40#include <sys/ucontext.h> 41#include <sys/vmmeter.h> 42 43#include <vm/vm.h> 44#include <vm/vm_param.h> 45#include <vm/vm_kern.h> 46#include <vm/vm_page.h> 47#include <vm/vm_map.h> 48#include <vm/vm_zone.h> 49 50#include <machine/asi.h> 51#include <machine/vmparam.h> 52#include <machine/cpufunc.h> 53#include <machine/fp.h> 54#include <machine/frame.h> 55#include <machine/fsr.h> 56#include <machine/intr_machdep.h> 57#include <machine/lsu.h> 58#include <machine/pcb.h> 59#include <machine/pstate.h> 60#include <machine/setjmp.h> 61#include <machine/sigframe.h> 62#include <machine/smp.h> 63#include <machine/pv.h> 64#include <machine/tte.h> 65#include <machine/tlb.h> 66#include <machine/tsb.h> 67#include <machine/tstate.h> 68#include <machine/upa.h> 69#include <machine/utrap.h> 70 71ASSYM(KERNBASE, KERNBASE); 72 73ASSYM(EFAULT, EFAULT); 74ASSYM(ENAMETOOLONG, ENAMETOOLONG); 75 76ASSYM(KSTACK_PAGES, KSTACK_PAGES); 77ASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES); 78ASSYM(PCPU_PAGES, PCPU_PAGES); 79ASSYM(UAREA_PAGES, UAREA_PAGES); 80ASSYM(PAGE_SIZE, PAGE_SIZE); 81 82ASSYM(PIL_TICK, PIL_TICK); 83 84ASSYM(FPRS_DL, FPRS_DL); 85ASSYM(FPRS_DU, FPRS_DU); 86ASSYM(FPRS_FEF, FPRS_FEF); 87 88ASSYM(LSU_VW, LSU_VW); 89 90ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT); 91 92ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); 93ASSYM(TLB_DEMAP_SECONDARY, TLB_DEMAP_SECONDARY); 94ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT); 95ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE); 96 97ASSYM(TLB_DTLB, TLB_DTLB); 98ASSYM(TLB_ITLB, TLB_ITLB); 99 100ASSYM(TSB_BUCKET_ADDRESS_BITS, TSB_BUCKET_ADDRESS_BITS); 101ASSYM(TSB_BUCKET_SHIFT, TSB_BUCKET_SHIFT); 102ASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK); 103 104ASSYM(INT_SHIFT, INT_SHIFT); 105ASSYM(PTR_SHIFT, PTR_SHIFT); 106 107ASSYM(PAGE_SHIFT, PAGE_SHIFT); 108ASSYM(PAGE_MASK, PAGE_MASK); 109 110ASSYM(CPU_CLKSYNC, CPU_CLKSYNC); 111ASSYM(CPU_INIT, CPU_INIT); 112 113ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid)); 114ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state)); 115ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick)); 116ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); 117ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes)); 118 119ASSYM(KTR_PROC, KTR_PROC); 120ASSYM(KTR_TRAP, KTR_TRAP); 121ASSYM(KTR_SMP, KTR_SMP); 122ASSYM(KTR_SYSC, KTR_SYSC); 123ASSYM(KTR_INTR, KTR_INTR); 124ASSYM(KTR_CT1, KTR_CT1); 125ASSYM(KTR_CT2, KTR_CT2); 126ASSYM(KTR_CT3, KTR_CT3); 127ASSYM(KTR_CT4, KTR_CT4); 128ASSYM(KTR_CT5, KTR_CT5); 129ASSYM(KTR_CT6, KTR_CT6); 130ASSYM(KTR_CT7, KTR_CT7); 131ASSYM(KTR_CT8, KTR_CT8); 132 133ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); 134ASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc)); 135ASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parm1)); 136ASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parm2)); 137ASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parm3)); 138ASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parm4)); 139ASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parm5)); 140ASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parm6)); 141 142ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn)); 143ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); 144ASSYM(TTE_SHIFT, TTE_SHIFT); 145 146ASSYM(TD_EXEC, TD_EXEC); 147ASSYM(TD_REF, TD_REF); 148ASSYM(TD_SW, TD_SW); 149ASSYM(TD_L, TD_L); 150ASSYM(TD_W, TD_W); 151 152ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); 153 154ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); 155ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); 156ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); 157ASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask)); 158ASSYM(PC_IQ, offsetof(struct pcpu, pc_iq)); 159ASSYM(PC_MID, offsetof(struct pcpu, pc_mid)); 160ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx)); 161ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max)); 162ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min)); 163ASSYM(PC_VMSPACE, offsetof(struct pcpu, pc_vmspace)); 164ASSYM(PC_SIZEOF, sizeof(struct pcpu)); 165 166ASSYM(IH_SHIFT, IH_SHIFT); 167 168ASSYM(IQ_MASK, IQ_MASK); 169ASSYM(IQ_HEAD, offsetof(struct intr_queue, iq_head)); 170ASSYM(IQ_TAIL, offsetof(struct intr_queue, iq_tail)); 171 172ASSYM(IQE_SHIFT, IQE_SHIFT); 173ASSYM(IQE_TAG, offsetof(struct iqe, iqe_tag)); 174ASSYM(IQE_PRI, offsetof(struct iqe, iqe_pri)); 175ASSYM(IQE_VEC, offsetof(struct iqe, iqe_vec)); 176ASSYM(IQE_FUNC, offsetof(struct iqe, iqe_func)); 177ASSYM(IQE_ARG, offsetof(struct iqe, iqe_arg)); 178 179ASSYM(ILA_LEVEL, offsetof(struct ipi_level_args, ila_level)); 180 181ASSYM(ITA_TLB, offsetof(struct ipi_tlb_args, ita_tlb)); 182ASSYM(ITA_CTX, offsetof(struct ipi_tlb_args, ita_ctx)); 183ASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start)); 184ASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end)); 185ASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va)); 186 187ASSYM(IV_SHIFT, IV_SHIFT); 188ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func)); 189ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg)); 190ASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri)); 191 192ASSYM(NIV, NIV); 193 194ASSYM(KEF_ASTPENDING, KEF_ASTPENDING); 195ASSYM(KEF_NEEDRESCHED, KEF_NEEDRESCHED); 196 197ASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap)); 198 199ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock)); 200 201ASSYM(P_COMM, offsetof(struct proc, p_comm)); 202ASSYM(P_MD, offsetof(struct proc, p_md)); 203ASSYM(P_PID, offsetof(struct proc, p_pid)); 204ASSYM(P_SFLAG, offsetof(struct proc, p_sflag)); 205ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); 206 207ASSYM(RW_SHIFT, RW_SHIFT); 208 209ASSYM(KE_FLAGS, offsetof(struct kse, ke_flags)); 210 211ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); 212ASSYM(TD_KSE, offsetof(struct thread, td_kse)); 213ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack)); 214ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); 215ASSYM(TD_PROC, offsetof(struct thread, td_proc)); 216 217ASSYM(PCB_SIZEOF, sizeof(struct pcb)); 218ASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate)); 219ASSYM(PCB_FP, offsetof(struct pcb, pcb_fp)); 220ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc)); 221ASSYM(PCB_Y, offsetof(struct pcb, pcb_pc)); 222ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); 223ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved)); 224ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp)); 225ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw)); 226 227ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); 228ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); 229ASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context)); 230ASSYM(PM_TSB, offsetof(struct pmap, pm_tsb)); 231 232ASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0])); 233ASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1])); 234ASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2])); 235ASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3])); 236 237ASSYM(CCFSZ, sizeof(struct frame)); 238ASSYM(SPOFF, SPOFF); 239 240ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); 241 242ASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP])); 243ASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC])); 244ASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP])); 245ASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG])); 246ASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK])); 247 248ASSYM(TF_G0, offsetof(struct trapframe, tf_global[0])); 249ASSYM(TF_G1, offsetof(struct trapframe, tf_global[1])); 250ASSYM(TF_G2, offsetof(struct trapframe, tf_global[2])); 251ASSYM(TF_G3, offsetof(struct trapframe, tf_global[3])); 252ASSYM(TF_G4, offsetof(struct trapframe, tf_global[4])); 253ASSYM(TF_G5, offsetof(struct trapframe, tf_global[5])); 254ASSYM(TF_G6, offsetof(struct trapframe, tf_global[6])); 255ASSYM(TF_G7, offsetof(struct trapframe, tf_global[7])); 256ASSYM(TF_O0, offsetof(struct trapframe, tf_out[0])); 257ASSYM(TF_O1, offsetof(struct trapframe, tf_out[1])); 258ASSYM(TF_O2, offsetof(struct trapframe, tf_out[2])); 259ASSYM(TF_O3, offsetof(struct trapframe, tf_out[3])); 260ASSYM(TF_O4, offsetof(struct trapframe, tf_out[4])); 261ASSYM(TF_O5, offsetof(struct trapframe, tf_out[5])); 262ASSYM(TF_O6, offsetof(struct trapframe, tf_out[6])); 263ASSYM(TF_O7, offsetof(struct trapframe, tf_out[7])); 264ASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr)); 265ASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar)); 266ASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level)); 267ASSYM(TF_TAR, offsetof(struct trapframe, tf_tar)); 268ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); 269ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); 270ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); 271ASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr)); 272ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); 273ASSYM(TF_Y, offsetof(struct trapframe, tf_y)); 274ASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs)); 275ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil)); 276ASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate)); 277ASSYM(TF_SIZEOF, sizeof(struct trapframe)); 278 279ASSYM(UPA_CR_MID_SHIFT, UPA_CR_MID_SHIFT); 280ASSYM(UPA_CR_MID_SIZE, UPA_CR_MID_SIZE); 281 282ASSYM(UT_MAX, UT_MAX); 283