genassym.c revision 91783
12340Sbde/*-
250476Speter * Copyright (c) 2001 Jake Burkholder.
31638Srgrimes * All rights reserved.
42340Sbde *
578347Sobrien * Redistribution and use in source and binary forms, with or without
61638Srgrimes * modification, are permitted provided that the following conditions
7209024Simp * are met:
8209024Simp * 1. Redistributions of source code must retain the above copyright
9209024Simp *    notice, this list of conditions and the following disclaimer.
10215149Sdim * 2. Redistributions in binary form must reproduce the above copyright
11215149Sdim *    notice, this list of conditions and the following disclaimer in the
12215149Sdim *    documentation and/or other materials provided with the distribution.
13215149Sdim *
14215149Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15209024Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16239272Sgonzo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17209024Simp * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18209024Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19241298Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20241298Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21241298Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22241298Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2319343Ssteve * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2419343Ssteve * SUCH DAMAGE.
2519343Ssteve *
2619343Ssteve *	from: @(#)genassym.c	5.11 (Berkeley) 5/10/91
2719343Ssteve * $FreeBSD: head/sys/sparc64/sparc64/genassym.c 91783 2002-03-07 06:01:40Z jake $
2819343Ssteve */
2919343Ssteve
3019343Ssteve#include <sys/param.h>
3119343Ssteve#include <sys/assym.h>
3219343Ssteve#include <sys/errno.h>
3319343Ssteve#include <sys/ktr.h>
3419343Ssteve#include <sys/proc.h>
35117173Sru#include <sys/queue.h>
3619343Ssteve#include <sys/signal.h>
371638Srgrimes#include <sys/smp.h>
382340Sbde#include <sys/systm.h>
3919343Ssteve#include <sys/ucontext.h>
4019343Ssteve#include <sys/user.h>
4119343Ssteve#include <sys/ucontext.h>
42243934Seadler#include <sys/vmmeter.h>
4319343Ssteve
442340Sbde#include <vm/vm.h>
451638Srgrimes#include <vm/vm_param.h>
462340Sbde#include <vm/vm_kern.h>
472340Sbde#include <vm/vm_page.h>
48217100Skib#include <vm/vm_map.h>
491638Srgrimes#include <vm/vm_zone.h>
5019343Ssteve
5119343Ssteve#include <machine/asi.h>
52125445Sbde#include <machine/vmparam.h>
5319343Ssteve#include <machine/cpufunc.h>
542340Sbde#include <machine/fp.h>
55209024Simp#include <machine/frame.h>
56177865Sobrien#include <machine/fsr.h>
57173375Scognet#include <machine/intr_machdep.h>
58177865Sobrien#include <machine/lsu.h>
5919343Ssteve#include <machine/pcb.h>
60173850Sjb#include <machine/pstate.h>
61173850Sjb#include <machine/setjmp.h>
62173375Scognet#include <machine/sigframe.h>
63173850Sjb#include <machine/smp.h>
64202807Ssepotvin#include <machine/pv.h>
651638Srgrimes#include <machine/tte.h>
66179184Sjb#include <machine/tlb.h>
67179184Sjb#include <machine/tsb.h>
68179184Sjb#include <machine/tstate.h>
69179184Sjb#include <machine/upa.h>
70179184Sjb#include <machine/utrap.h>
71212422Srpaulo
72179184SjbASSYM(KERNBASE, KERNBASE);
73179184Sjb
74179184SjbASSYM(EFAULT, EFAULT);
75206082SnetchildASSYM(ENAMETOOLONG, ENAMETOOLONG);
76206082Snetchild
77206082SnetchildASSYM(KSTACK_PAGES, KSTACK_PAGES);
78179184SjbASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES);
79179184SjbASSYM(PCPU_PAGES, PCPU_PAGES);
802419SpaulASSYM(UAREA_PAGES, UAREA_PAGES);
81204024SmarcelASSYM(PAGE_SIZE, PAGE_SIZE);
82202807Ssepotvin
831638SrgrimesASSYM(PIL_TICK, PIL_TICK);
842340Sbde
851638SrgrimesASSYM(FPRS_DL, FPRS_DL);
86125119SruASSYM(FPRS_DU, FPRS_DU);
872340SbdeASSYM(FPRS_FEF, FPRS_FEF);
882340Sbde
892340SbdeASSYM(LSU_VW, LSU_VW);
902340Sbde
912340SbdeASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT);
922340Sbde
932340SbdeASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS);
942340SbdeASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY);
952340SbdeASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT);
962340SbdeASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE);
971638Srgrimes
98133369ShartiASSYM(TLB_DTLB, TLB_DTLB);
99133369ShartiASSYM(TLB_ITLB, TLB_ITLB);
100133369Sharti
101133369ShartiASSYM(TSB_BUCKET_ADDRESS_BITS, TSB_BUCKET_ADDRESS_BITS);
102133369ShartiASSYM(TSB_BUCKET_SHIFT, TSB_BUCKET_SHIFT);
103133369ShartiASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK);
10419343Ssteve
10519343SsteveASSYM(INT_SHIFT, INT_SHIFT);
10619343SsteveASSYM(PTR_SHIFT, PTR_SHIFT);
10719343Ssteve
1082340SbdeASSYM(PAGE_SHIFT, PAGE_SHIFT);
1092340SbdeASSYM(PAGE_MASK, PAGE_MASK);
11019343Ssteve
1112340SbdeASSYM(CPU_CLKSYNC, CPU_CLKSYNC);
1121638SrgrimesASSYM(CPU_INIT, CPU_INIT);
1135257Sache
1145257SacheASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid));
1152340SbdeASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu));
1162340SbdeASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state));
1171638SrgrimesASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick));
1182340SbdeASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver));
1192340SbdeASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes));
1201638Srgrimes
1212340SbdeASSYM(KTR_PROC, KTR_PROC);
12292813SruASSYM(KTR_TRAP, KTR_TRAP);
12392491SmarkmASSYM(KTR_SMP, KTR_SMP);
12492491SmarkmASSYM(KTR_SYSC, KTR_SYSC);
125120485SmarkmASSYM(KTR_INTR, KTR_INTR);
12692491SmarkmASSYM(KTR_CT1, KTR_CT1);
1271638SrgrimesASSYM(KTR_CT2, KTR_CT2);
1282340SbdeASSYM(KTR_CT3, KTR_CT3);
1291638SrgrimesASSYM(KTR_CT4, KTR_CT4);
130234575SimpASSYM(KTR_CT5, KTR_CT5);
131234575SimpASSYM(KTR_CT6, KTR_CT6);
132234575SimpASSYM(KTR_CT7, KTR_CT7);
13336054SbdeASSYM(KTR_CT8, KTR_CT8);
13436054Sbde
13536054SbdeASSYM(KTR_SIZEOF, sizeof(struct ktr_entry));
136244236SemasteASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc));
137244236SemasteASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parm1));
1382340SbdeASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parm2));
1392340SbdeASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parm3));
1401638SrgrimesASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parm4));
1412340SbdeASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parm5));
1422340SbdeASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parm6));
143244366Semaste
1441638SrgrimesASSYM(TTE_VPN, offsetof(struct tte, tte_vpn));
1452340SbdeASSYM(TTE_DATA, offsetof(struct tte, tte_data));
1462340SbdeASSYM(TTE_SHIFT, TTE_SHIFT);
1472340Sbde
14819343SsteveASSYM(TD_EXEC, TD_EXEC);
14919343SsteveASSYM(TD_REF, TD_REF);
15019343SsteveASSYM(TD_SW, TD_SW);
1512340SbdeASSYM(TD_L, TD_L);
15219343SsteveASSYM(TD_W, TD_W);
1532340Sbde
15419343SsteveASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
155129163Sbde
15619343SsteveASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
15719343SsteveASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
15819343SsteveASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
15919343SsteveASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask));
16019343SsteveASSYM(PC_IQ, offsetof(struct pcpu, pc_iq));
16119343SsteveASSYM(PC_MID, offsetof(struct pcpu, pc_mid));
16219343SsteveASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
16311613SbdeASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
16419481SalexASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min));
165228137SfjoeASSYM(PC_VMSPACE, offsetof(struct pcpu, pc_vmspace));
16619343SsteveASSYM(PC_SIZEOF, sizeof(struct pcpu));
16719343Ssteve
16819481SalexASSYM(IH_SHIFT, IH_SHIFT);
169228137Sfjoe
17019343SsteveASSYM(IQ_MASK, IQ_MASK);
17119343SsteveASSYM(IQ_HEAD, offsetof(struct intr_queue, iq_head));
172211243SwillASSYM(IQ_TAIL, offsetof(struct intr_queue, iq_tail));
17319343Ssteve
17419343SsteveASSYM(IQE_SHIFT, IQE_SHIFT);
17519343SsteveASSYM(IQE_TAG, offsetof(struct iqe, iqe_tag));
17619343SsteveASSYM(IQE_PRI, offsetof(struct iqe, iqe_pri));
17719343SsteveASSYM(IQE_VEC, offsetof(struct iqe, iqe_vec));
17819481SalexASSYM(IQE_FUNC, offsetof(struct iqe, iqe_func));
179228137SfjoeASSYM(IQE_ARG, offsetof(struct iqe, iqe_arg));
18019343Ssteve
18119343SsteveASSYM(ILA_LEVEL, offsetof(struct ipi_level_args, ila_level));
18219481Salex
183228137SfjoeASSYM(ITA_TLB, offsetof(struct ipi_tlb_args, ita_tlb));
18419343SsteveASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap));
18519343SsteveASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));
18619481SalexASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end));
18719481SalexASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va));
18839208Sobrien
18919343SsteveASSYM(IV_SHIFT, IV_SHIFT);
190228137SfjoeASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
19119343SsteveASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
19219343SsteveASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
19319481Salex
19419481SalexASSYM(NIV, NIV);
19539208Sobrien
19619343SsteveASSYM(KEF_ASTPENDING, KEF_ASTPENDING);
197228137SfjoeASSYM(KEF_NEEDRESCHED, KEF_NEEDRESCHED);
19819343Ssteve
19919343SsteveASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap));
20019481Salex
20119343SsteveASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock));
20219343Ssteve
20319343SsteveASSYM(P_COMM, offsetof(struct proc, p_comm));
20419481SalexASSYM(P_MD, offsetof(struct proc, p_md));
20519343SsteveASSYM(P_PID, offsetof(struct proc, p_pid));
20619343SsteveASSYM(P_SFLAG, offsetof(struct proc, p_sflag));
20719343SsteveASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
20819481Salex
20919481SalexASSYM(RW_SHIFT, RW_SHIFT);
21039208Sobrien
21119343SsteveASSYM(KE_FLAGS, offsetof(struct kse, ke_flags));
21219343Ssteve
21319481SalexASSYM(TD_FRAME, offsetof(struct thread, td_frame));
21419481SalexASSYM(TD_KSE, offsetof(struct thread, td_kse));
21539208SobrienASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
21619343SsteveASSYM(TD_PCB, offsetof(struct thread, td_pcb));
21719343SsteveASSYM(TD_PROC, offsetof(struct thread, td_proc));
21819343Ssteve
21919343SsteveASSYM(PCB_SIZEOF, sizeof(struct pcb));
22019343SsteveASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate));
22111613SbdeASSYM(PCB_FP, offsetof(struct pcb, pcb_fp));
222211243SwillASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
22311613SbdeASSYM(PCB_Y, offsetof(struct pcb, pcb_pc));
22411613SbdeASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
225103713SmarkmASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
226103713SmarkmASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
227103713SmarkmASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
228103713Smarkm
229103713SmarkmASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
230103713SmarkmASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
231103713SmarkmASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
232103713SmarkmASSYM(PM_TSB, offsetof(struct pmap, pm_tsb));
23377817Sobrien
23477817SobrienASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0]));
235228137SfjoeASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1]));
23677817SobrienASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2]));
2371638SrgrimesASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3]));
2381638Srgrimes
239228137SfjoeASSYM(CCFSZ, sizeof(struct frame));
2401638SrgrimesASSYM(SPOFF, SPOFF);
24177817Sobrien
24277817SobrienASSYM(SF_UC, offsetof(struct sigframe, sf_uc));
24377817Sobrien
24436673SdtASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP]));
2451844SwollmanASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC]));
2461844SwollmanASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP]));
24736054SbdeASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG]));
24836054SbdeASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK]));
249228137Sfjoe
25036054SbdeASSYM(TF_G0, offsetof(struct trapframe, tf_global[0]));
2511638SrgrimesASSYM(TF_G1, offsetof(struct trapframe, tf_global[1]));
2521638SrgrimesASSYM(TF_G2, offsetof(struct trapframe, tf_global[2]));
253228137SfjoeASSYM(TF_G3, offsetof(struct trapframe, tf_global[3]));
2541638SrgrimesASSYM(TF_G4, offsetof(struct trapframe, tf_global[4]));
25577818SobrienASSYM(TF_G5, offsetof(struct trapframe, tf_global[5]));
25677818SobrienASSYM(TF_G6, offsetof(struct trapframe, tf_global[6]));
25777818SobrienASSYM(TF_G7, offsetof(struct trapframe, tf_global[7]));
25877818SobrienASSYM(TF_O0, offsetof(struct trapframe, tf_out[0]));
2591638SrgrimesASSYM(TF_O1, offsetof(struct trapframe, tf_out[1]));
2601638SrgrimesASSYM(TF_O2, offsetof(struct trapframe, tf_out[2]));
2611638SrgrimesASSYM(TF_O3, offsetof(struct trapframe, tf_out[3]));
2623292SrgrimesASSYM(TF_O4, offsetof(struct trapframe, tf_out[4]));
263217100SkibASSYM(TF_O5, offsetof(struct trapframe, tf_out[5]));
264228137SfjoeASSYM(TF_O6, offsetof(struct trapframe, tf_out[6]));
2653292SrgrimesASSYM(TF_O7, offsetof(struct trapframe, tf_out[7]));
266117173SruASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr));
267217100SkibASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar));
268228137SfjoeASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level));
269117173SruASSYM(TF_TAR, offsetof(struct trapframe, tf_tar));
270117173SruASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
2711638SrgrimesASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc));
272228137SfjoeASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
2731638SrgrimesASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr));
27416068SphkASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
2751638SrgrimesASSYM(TF_Y, offsetof(struct trapframe, tf_y));
27616068SphkASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs));
27716068SphkASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
27839208SobrienASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
279228137SfjoeASSYM(TF_SIZEOF, sizeof(struct trapframe));
2801638Srgrimes
2811638SrgrimesASSYM(UPA_CR_MID_SHIFT, UPA_CR_MID_SHIFT);
28215959SphkASSYM(UPA_CR_MID_SIZE, UPA_CR_MID_SIZE);
28315959Sphk
28439208SobrienASSYM(UT_MAX, UT_MAX);
285228137Sfjoe