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