genassym.c revision 93503
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 93503 2002-04-01 05:35:26Z 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));
13582910SjakeASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc));
13692199SjakeASSYM(KTR_CPU, offsetof(struct ktr_entry, ktr_cpu));
13793503SjakeASSYM(KTR_TIMESTAMP, offsetof(struct ktr_entry, ktr_timestamp));
13893503SjakeASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parms[0]));
13993503SjakeASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parms[1]));
14093503SjakeASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parms[2]));
14193503SjakeASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parms[3]));
14293503SjakeASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4]));
14393503SjakeASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5]));
14482910Sjake
14591224SjakeASSYM(TTE_VPN, offsetof(struct tte, tte_vpn));
14680709SjakeASSYM(TTE_DATA, offsetof(struct tte, tte_data));
14781381SjakeASSYM(TTE_SHIFT, TTE_SHIFT);
14880709Sjake
14981614SjakeASSYM(TD_EXEC, TD_EXEC);
15080709SjakeASSYM(TD_REF, TD_REF);
15188657SjakeASSYM(TD_SW, TD_SW);
15288657SjakeASSYM(TD_L, TD_L);
15380709SjakeASSYM(TD_W, TD_W);
15480709Sjake
15584186SjakeASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
15684186Sjake
15787702SjhbASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
15887702SjhbASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
15987702SjhbASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
16091337SjakeASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask));
16189052SjakeASSYM(PC_IQ, offsetof(struct pcpu, pc_iq));
16289052SjakeASSYM(PC_MID, offsetof(struct pcpu, pc_mid));
16391613SjakeASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
16491613SjakeASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
16591613SjakeASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min));
16691617SjakeASSYM(PC_VMSPACE, offsetof(struct pcpu, pc_vmspace));
16789052SjakeASSYM(PC_SIZEOF, sizeof(struct pcpu));
16880709Sjake
16984186SjakeASSYM(IH_SHIFT, IH_SHIFT);
17084186Sjake
17181614SjakeASSYM(IQ_MASK, IQ_MASK);
17281614SjakeASSYM(IQ_HEAD, offsetof(struct intr_queue, iq_head));
17381614SjakeASSYM(IQ_TAIL, offsetof(struct intr_queue, iq_tail));
17481614Sjake
17581614SjakeASSYM(IQE_SHIFT, IQE_SHIFT);
17681614SjakeASSYM(IQE_TAG, offsetof(struct iqe, iqe_tag));
17781614SjakeASSYM(IQE_PRI, offsetof(struct iqe, iqe_pri));
17881614SjakeASSYM(IQE_VEC, offsetof(struct iqe, iqe_vec));
17981614SjakeASSYM(IQE_FUNC, offsetof(struct iqe, iqe_func));
18081614SjakeASSYM(IQE_ARG, offsetof(struct iqe, iqe_arg));
18181614Sjake
18292199SjakeASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask));
18389052SjakeASSYM(ITA_TLB, offsetof(struct ipi_tlb_args, ita_tlb));
18491783SjakeASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap));
18589052SjakeASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));
18689052SjakeASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end));
18789052SjakeASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va));
18889052Sjake
18981614SjakeASSYM(IV_SHIFT, IV_SHIFT);
19081614SjakeASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
19181614SjakeASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
19281614SjakeASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
19381614Sjake
19485244SjakeASSYM(NIV, NIV);
19585244Sjake
19683366SjulianASSYM(KEF_ASTPENDING, KEF_ASTPENDING);
19783366SjulianASSYM(KEF_NEEDRESCHED, KEF_NEEDRESCHED);
19882910Sjake
19988788SjakeASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap));
20088788Sjake
20191613SjakeASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock));
20291613Sjake
20382910SjakeASSYM(P_COMM, offsetof(struct proc, p_comm));
20488657SjakeASSYM(P_MD, offsetof(struct proc, p_md));
20588657SjakeASSYM(P_PID, offsetof(struct proc, p_pid));
20682910SjakeASSYM(P_SFLAG, offsetof(struct proc, p_sflag));
20780709SjakeASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
20880709Sjake
20988657SjakeASSYM(RW_SHIFT, RW_SHIFT);
21088657Sjake
21183366SjulianASSYM(KE_FLAGS, offsetof(struct kse, ke_flags));
21283366Sjulian
21383366SjulianASSYM(TD_FRAME, offsetof(struct thread, td_frame));
21483366SjulianASSYM(TD_KSE, offsetof(struct thread, td_kse));
21583366SjulianASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
21683366SjulianASSYM(TD_PCB, offsetof(struct thread, td_pcb));
21783366SjulianASSYM(TD_PROC, offsetof(struct thread, td_proc));
21883366Sjulian
21984186SjakeASSYM(PCB_SIZEOF, sizeof(struct pcb));
22081135StmmASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate));
22180709SjakeASSYM(PCB_FP, offsetof(struct pcb, pcb_fp));
22280709SjakeASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
22382010SjakeASSYM(PCB_Y, offsetof(struct pcb, pcb_pc));
22480709SjakeASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
22582910SjakeASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
22682910SjakeASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
22782910SjakeASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
22880709Sjake
22981381SjakeASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
23088657SjakeASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
23181381SjakeASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
23288657SjakeASSYM(PM_TSB, offsetof(struct pmap, pm_tsb));
23381381Sjake
23481135StmmASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0]));
23581135StmmASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1]));
23681135StmmASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2]));
23781135StmmASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3]));
23881135Stmm
23980709SjakeASSYM(CCFSZ, sizeof(struct frame));
24080709SjakeASSYM(SPOFF, SPOFF);
24180709Sjake
24282910SjakeASSYM(SF_UC, offsetof(struct sigframe, sf_uc));
24382010Sjake
24488657SjakeASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP]));
24588657SjakeASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC]));
24688657SjakeASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP]));
24788657SjakeASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG]));
24888657SjakeASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK]));
24980709Sjake
25080709SjakeASSYM(TF_G0, offsetof(struct trapframe, tf_global[0]));
25180709SjakeASSYM(TF_G1, offsetof(struct trapframe, tf_global[1]));
25280709SjakeASSYM(TF_G2, offsetof(struct trapframe, tf_global[2]));
25380709SjakeASSYM(TF_G3, offsetof(struct trapframe, tf_global[3]));
25480709SjakeASSYM(TF_G4, offsetof(struct trapframe, tf_global[4]));
25580709SjakeASSYM(TF_G5, offsetof(struct trapframe, tf_global[5]));
25680709SjakeASSYM(TF_G6, offsetof(struct trapframe, tf_global[6]));
25780709SjakeASSYM(TF_G7, offsetof(struct trapframe, tf_global[7]));
25880709SjakeASSYM(TF_O0, offsetof(struct trapframe, tf_out[0]));
25980709SjakeASSYM(TF_O1, offsetof(struct trapframe, tf_out[1]));
26080709SjakeASSYM(TF_O2, offsetof(struct trapframe, tf_out[2]));
26180709SjakeASSYM(TF_O3, offsetof(struct trapframe, tf_out[3]));
26280709SjakeASSYM(TF_O4, offsetof(struct trapframe, tf_out[4]));
26380709SjakeASSYM(TF_O5, offsetof(struct trapframe, tf_out[5]));
26480709SjakeASSYM(TF_O6, offsetof(struct trapframe, tf_out[6]));
26580709SjakeASSYM(TF_O7, offsetof(struct trapframe, tf_out[7]));
26688657SjakeASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr));
26788657SjakeASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar));
26888657SjakeASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level));
26988657SjakeASSYM(TF_TAR, offsetof(struct trapframe, tf_tar));
27088657SjakeASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
27188657SjakeASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc));
27280709SjakeASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
27388657SjakeASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr));
27480709SjakeASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
27588657SjakeASSYM(TF_Y, offsetof(struct trapframe, tf_y));
27688657SjakeASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs));
27788657SjakeASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
27882910SjakeASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
27980709SjakeASSYM(TF_SIZEOF, sizeof(struct trapframe));
28088788Sjake
28188788SjakeASSYM(UT_MAX, UT_MAX);
282