genassym.c revision 93949
180709Sjake/*- 280709Sjake * Copyright (c) 2001 Jake Burkholder. 380709Sjake * All rights reserved. 480709Sjake * 580709Sjake * Redistribution and use in source and binary forms, with or without 680709Sjake * modification, are permitted provided that the following conditions 780709Sjake * are met: 880709Sjake * 1. Redistributions of source code must retain the above copyright 980709Sjake * notice, this list of conditions and the following disclaimer. 1080709Sjake * 2. Redistributions in binary form must reproduce the above copyright 1180709Sjake * notice, this list of conditions and the following disclaimer in the 1280709Sjake * documentation and/or other materials provided with the distribution. 1380709Sjake * 1481337Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1580709Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1680709Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1781337Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1880709Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1980709Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2080709Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2180709Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2280709Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2380709Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2480709Sjake * SUCH DAMAGE. 2580709Sjake * 2680709Sjake * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 2780709Sjake * $FreeBSD: head/sys/sparc64/sparc64/genassym.c 93949 2002-04-06 08:40:59Z jake $ 2880709Sjake */ 2980709Sjake 3080709Sjake#include <sys/param.h> 3180709Sjake#include <sys/assym.h> 3280709Sjake#include <sys/errno.h> 3382910Sjake#include <sys/ktr.h> 3480709Sjake#include <sys/proc.h> 3580709Sjake#include <sys/queue.h> 3686527Sjake#include <sys/signal.h> 3791783Sjake#include <sys/smp.h> 3891613Sjake#include <sys/systm.h> 3991613Sjake#include <sys/ucontext.h> 4080709Sjake#include <sys/user.h> 4191176Sjake#include <sys/ucontext.h> 4284186Sjake#include <sys/vmmeter.h> 4380709Sjake 4480709Sjake#include <vm/vm.h> 4581381Sjake#include <vm/vm_param.h> 4681381Sjake#include <vm/vm_kern.h> 4781381Sjake#include <vm/vm_page.h> 4881381Sjake#include <vm/vm_map.h> 4980709Sjake 5080709Sjake#include <machine/asi.h> 5180709Sjake#include <machine/vmparam.h> 5280709Sjake#include <machine/cpufunc.h> 5381135Stmm#include <machine/fp.h> 5480709Sjake#include <machine/frame.h> 5586527Sjake#include <machine/fsr.h> 5681614Sjake#include <machine/intr_machdep.h> 5788657Sjake#include <machine/lsu.h> 5880709Sjake#include <machine/pcb.h> 5980709Sjake#include <machine/pstate.h> 6080709Sjake#include <machine/setjmp.h> 6182910Sjake#include <machine/sigframe.h> 6289052Sjake#include <machine/smp.h> 6380709Sjake#include <machine/pv.h> 6480709Sjake#include <machine/tte.h> 6580709Sjake#include <machine/tlb.h> 6680709Sjake#include <machine/tsb.h> 6782010Sjake#include <machine/tstate.h> 6891617Sjake#include <machine/upa.h> 6988788Sjake#include <machine/utrap.h> 7080709Sjake 7183756SjakeASSYM(KERNBASE, KERNBASE); 7283756Sjake 7380709SjakeASSYM(EFAULT, EFAULT); 7480709SjakeASSYM(ENAMETOOLONG, ENAMETOOLONG); 7580709Sjake 7683366SjulianASSYM(KSTACK_PAGES, KSTACK_PAGES); 7784186SjakeASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES); 7891360SjakeASSYM(PCPU_PAGES, PCPU_PAGES); 7983366SjulianASSYM(UAREA_PAGES, UAREA_PAGES); 8080709SjakeASSYM(PAGE_SIZE, PAGE_SIZE); 8180709Sjake 8282910SjakeASSYM(PIL_TICK, PIL_TICK); 8380709Sjake 8481135StmmASSYM(FPRS_DL, FPRS_DL); 8581135StmmASSYM(FPRS_DU, FPRS_DU); 8681135StmmASSYM(FPRS_FEF, FPRS_FEF); 8781135Stmm 8888657SjakeASSYM(LSU_VW, LSU_VW); 8988657Sjake 9091224SjakeASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT); 9191224Sjake 9281381SjakeASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); 9391783SjakeASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY); 9489052SjakeASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT); 9588657SjakeASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE); 9681381Sjake 9789052SjakeASSYM(TLB_DTLB, TLB_DTLB); 9889052SjakeASSYM(TLB_ITLB, TLB_ITLB); 9989052Sjake 10088657SjakeASSYM(TSB_BUCKET_ADDRESS_BITS, TSB_BUCKET_ADDRESS_BITS); 10188657SjakeASSYM(TSB_BUCKET_SHIFT, TSB_BUCKET_SHIFT); 10291224SjakeASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK); 10380709Sjake 10491336SjakeASSYM(INT_SHIFT, INT_SHIFT); 10591336SjakeASSYM(PTR_SHIFT, PTR_SHIFT); 10691336Sjake 10780709SjakeASSYM(PAGE_SHIFT, PAGE_SHIFT); 10880709SjakeASSYM(PAGE_MASK, PAGE_MASK); 10980709Sjake 11091617SjakeASSYM(CPU_CLKSYNC, CPU_CLKSYNC); 11191617SjakeASSYM(CPU_INIT, CPU_INIT); 11289052Sjake 11389052SjakeASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid)); 11491783SjakeASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu)); 11589052SjakeASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state)); 11691617SjakeASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick)); 11791617SjakeASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); 11891617SjakeASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes)); 11989052Sjake 12085244SjakeASSYM(KTR_PROC, KTR_PROC); 12184186SjakeASSYM(KTR_TRAP, KTR_TRAP); 12289052SjakeASSYM(KTR_SMP, KTR_SMP); 12384186SjakeASSYM(KTR_SYSC, KTR_SYSC); 12484186SjakeASSYM(KTR_INTR, KTR_INTR); 12582910SjakeASSYM(KTR_CT1, KTR_CT1); 12685244SjakeASSYM(KTR_CT2, KTR_CT2); 12785244SjakeASSYM(KTR_CT3, KTR_CT3); 12885244SjakeASSYM(KTR_CT4, KTR_CT4); 12991532SjakeASSYM(KTR_CT5, KTR_CT5); 13091532SjakeASSYM(KTR_CT6, KTR_CT6); 13191532SjakeASSYM(KTR_CT7, KTR_CT7); 13291532SjakeASSYM(KTR_CT8, KTR_CT8); 13382910Sjake 13482910SjakeASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); 13593949SjakeASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line)); 13693949SjakeASSYM(KTR_FILE, offsetof(struct ktr_entry, ktr_file)); 13782910SjakeASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc)); 13892199SjakeASSYM(KTR_CPU, offsetof(struct ktr_entry, ktr_cpu)); 13993503SjakeASSYM(KTR_TIMESTAMP, offsetof(struct ktr_entry, ktr_timestamp)); 14093503SjakeASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parms[0])); 14193503SjakeASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parms[1])); 14293503SjakeASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parms[2])); 14393503SjakeASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parms[3])); 14493503SjakeASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4])); 14593503SjakeASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5])); 14682910Sjake 14791224SjakeASSYM(TTE_VPN, offsetof(struct tte, tte_vpn)); 14880709SjakeASSYM(TTE_DATA, offsetof(struct tte, tte_data)); 14981381SjakeASSYM(TTE_SHIFT, TTE_SHIFT); 15080709Sjake 15181614SjakeASSYM(TD_EXEC, TD_EXEC); 15280709SjakeASSYM(TD_REF, TD_REF); 15388657SjakeASSYM(TD_SW, TD_SW); 15488657SjakeASSYM(TD_L, TD_L); 15580709SjakeASSYM(TD_W, TD_W); 15680709Sjake 15784186SjakeASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); 15884186Sjake 15987702SjhbASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); 16087702SjhbASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); 16187702SjhbASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); 16291337SjakeASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask)); 16389052SjakeASSYM(PC_IQ, offsetof(struct pcpu, pc_iq)); 16489052SjakeASSYM(PC_MID, offsetof(struct pcpu, pc_mid)); 16591613SjakeASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx)); 16691613SjakeASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max)); 16791613SjakeASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min)); 16891617SjakeASSYM(PC_VMSPACE, offsetof(struct pcpu, pc_vmspace)); 16989052SjakeASSYM(PC_SIZEOF, sizeof(struct pcpu)); 17080709Sjake 17184186SjakeASSYM(IH_SHIFT, IH_SHIFT); 17284186Sjake 17381614SjakeASSYM(IQ_MASK, IQ_MASK); 17481614SjakeASSYM(IQ_HEAD, offsetof(struct intr_queue, iq_head)); 17581614SjakeASSYM(IQ_TAIL, offsetof(struct intr_queue, iq_tail)); 17681614Sjake 17781614SjakeASSYM(IQE_SHIFT, IQE_SHIFT); 17881614SjakeASSYM(IQE_TAG, offsetof(struct iqe, iqe_tag)); 17981614SjakeASSYM(IQE_PRI, offsetof(struct iqe, iqe_pri)); 18081614SjakeASSYM(IQE_VEC, offsetof(struct iqe, iqe_vec)); 18181614SjakeASSYM(IQE_FUNC, offsetof(struct iqe, iqe_func)); 18281614SjakeASSYM(IQE_ARG, offsetof(struct iqe, iqe_arg)); 18381614Sjake 18492199SjakeASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask)); 18589052SjakeASSYM(ITA_TLB, offsetof(struct ipi_tlb_args, ita_tlb)); 18691783SjakeASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap)); 18789052SjakeASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start)); 18889052SjakeASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end)); 18989052SjakeASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va)); 19089052Sjake 19181614SjakeASSYM(IV_SHIFT, IV_SHIFT); 19281614SjakeASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func)); 19381614SjakeASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg)); 19481614SjakeASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri)); 19581614Sjake 19685244SjakeASSYM(NIV, NIV); 19785244Sjake 19883366SjulianASSYM(KEF_ASTPENDING, KEF_ASTPENDING); 19983366SjulianASSYM(KEF_NEEDRESCHED, KEF_NEEDRESCHED); 20082910Sjake 20188788SjakeASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap)); 20288788Sjake 20391613SjakeASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock)); 20491613Sjake 20582910SjakeASSYM(P_COMM, offsetof(struct proc, p_comm)); 20688657SjakeASSYM(P_MD, offsetof(struct proc, p_md)); 20788657SjakeASSYM(P_PID, offsetof(struct proc, p_pid)); 20882910SjakeASSYM(P_SFLAG, offsetof(struct proc, p_sflag)); 20980709SjakeASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); 21080709Sjake 21188657SjakeASSYM(RW_SHIFT, RW_SHIFT); 21288657Sjake 21383366SjulianASSYM(KE_FLAGS, offsetof(struct kse, ke_flags)); 21483366Sjulian 21583366SjulianASSYM(TD_FRAME, offsetof(struct thread, td_frame)); 21683366SjulianASSYM(TD_KSE, offsetof(struct thread, td_kse)); 21783366SjulianASSYM(TD_KSTACK, offsetof(struct thread, td_kstack)); 21883366SjulianASSYM(TD_PCB, offsetof(struct thread, td_pcb)); 21983366SjulianASSYM(TD_PROC, offsetof(struct thread, td_proc)); 22083366Sjulian 22184186SjakeASSYM(PCB_SIZEOF, sizeof(struct pcb)); 22281135StmmASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate)); 22380709SjakeASSYM(PCB_FP, offsetof(struct pcb, pcb_fp)); 22480709SjakeASSYM(PCB_PC, offsetof(struct pcb, pcb_pc)); 22582010SjakeASSYM(PCB_Y, offsetof(struct pcb, pcb_pc)); 22680709SjakeASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); 22782910SjakeASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved)); 22882910SjakeASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp)); 22982910SjakeASSYM(PCB_RW, offsetof(struct pcb, pcb_rw)); 23080709Sjake 23181381SjakeASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); 23288657SjakeASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); 23381381SjakeASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context)); 23488657SjakeASSYM(PM_TSB, offsetof(struct pmap, pm_tsb)); 23581381Sjake 23681135StmmASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0])); 23781135StmmASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1])); 23881135StmmASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2])); 23981135StmmASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3])); 24081135Stmm 24180709SjakeASSYM(CCFSZ, sizeof(struct frame)); 24280709SjakeASSYM(SPOFF, SPOFF); 24380709Sjake 24482910SjakeASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); 24582010Sjake 24688657SjakeASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP])); 24788657SjakeASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC])); 24888657SjakeASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP])); 24988657SjakeASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG])); 25088657SjakeASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK])); 25180709Sjake 25280709SjakeASSYM(TF_G0, offsetof(struct trapframe, tf_global[0])); 25380709SjakeASSYM(TF_G1, offsetof(struct trapframe, tf_global[1])); 25480709SjakeASSYM(TF_G2, offsetof(struct trapframe, tf_global[2])); 25580709SjakeASSYM(TF_G3, offsetof(struct trapframe, tf_global[3])); 25680709SjakeASSYM(TF_G4, offsetof(struct trapframe, tf_global[4])); 25780709SjakeASSYM(TF_G5, offsetof(struct trapframe, tf_global[5])); 25880709SjakeASSYM(TF_G6, offsetof(struct trapframe, tf_global[6])); 25980709SjakeASSYM(TF_G7, offsetof(struct trapframe, tf_global[7])); 26080709SjakeASSYM(TF_O0, offsetof(struct trapframe, tf_out[0])); 26180709SjakeASSYM(TF_O1, offsetof(struct trapframe, tf_out[1])); 26280709SjakeASSYM(TF_O2, offsetof(struct trapframe, tf_out[2])); 26380709SjakeASSYM(TF_O3, offsetof(struct trapframe, tf_out[3])); 26480709SjakeASSYM(TF_O4, offsetof(struct trapframe, tf_out[4])); 26580709SjakeASSYM(TF_O5, offsetof(struct trapframe, tf_out[5])); 26680709SjakeASSYM(TF_O6, offsetof(struct trapframe, tf_out[6])); 26780709SjakeASSYM(TF_O7, offsetof(struct trapframe, tf_out[7])); 26888657SjakeASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr)); 26988657SjakeASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar)); 27088657SjakeASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level)); 27188657SjakeASSYM(TF_TAR, offsetof(struct trapframe, tf_tar)); 27288657SjakeASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); 27388657SjakeASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); 27480709SjakeASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); 27588657SjakeASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr)); 27680709SjakeASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); 27788657SjakeASSYM(TF_Y, offsetof(struct trapframe, tf_y)); 27888657SjakeASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs)); 27988657SjakeASSYM(TF_PIL, offsetof(struct trapframe, tf_pil)); 28082910SjakeASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate)); 28180709SjakeASSYM(TF_SIZEOF, sizeof(struct trapframe)); 28288788Sjake 28388788SjakeASSYM(UT_MAX, UT_MAX); 284