genassym.c revision 145153
1234848Smav/*-
2234848Smav * Copyright (c) 2001 Jake Burkholder.
3234848Smav * All rights reserved.
4234848Smav *
5234848Smav * Redistribution and use in source and binary forms, with or without
6234848Smav * modification, are permitted provided that the following conditions
7234848Smav * are met:
8234848Smav * 1. Redistributions of source code must retain the above copyright
9234848Smav *    notice, this list of conditions and the following disclaimer.
10234848Smav * 2. Redistributions in binary form must reproduce the above copyright
11234848Smav *    notice, this list of conditions and the following disclaimer in the
12234848Smav *    documentation and/or other materials provided with the distribution.
13234848Smav *
14234848Smav * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15234848Smav * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16234848Smav * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17234848Smav * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18234848Smav * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19234848Smav * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20234848Smav * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21234848Smav * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22234848Smav * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23234848Smav * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24234848Smav * SUCH DAMAGE.
25234848Smav *
26234848Smav *	from: @(#)genassym.c	5.11 (Berkeley) 5/10/91
27234848Smav */
28234848Smav
29234848Smav#include <sys/cdefs.h>
30234848Smav__FBSDID("$FreeBSD: head/sys/sparc64/sparc64/genassym.c 145153 2005-04-16 15:05:56Z marius $");
31234848Smav
32234848Smav#include "opt_kstack_pages.h"
33234848Smav
34234848Smav#include <sys/param.h>
35234848Smav#include <sys/assym.h>
36234848Smav#include <sys/errno.h>
37234848Smav#include <sys/ktr.h>
38234848Smav#include <sys/proc.h>
39234848Smav#include <sys/queue.h>
40234848Smav#include <sys/lock.h>
41234848Smav#include <sys/mutex.h>
42234848Smav#include <sys/signal.h>
43234848Smav#include <sys/smp.h>
44234848Smav#include <sys/systm.h>
45234848Smav#include <sys/ucontext.h>
46234848Smav#include <sys/ucontext.h>
47234848Smav#include <sys/vmmeter.h>
48234848Smav
49234848Smav#include <vm/vm.h>
50234848Smav#include <vm/vm_param.h>
51234848Smav#include <vm/vm_kern.h>
52234848Smav#include <vm/vm_page.h>
53234848Smav#include <vm/vm_map.h>
54234848Smav
55234848Smav#include <machine/asi.h>
56234848Smav#include <machine/cache.h>
57234848Smav#include <machine/vmparam.h>
58234848Smav#include <machine/cpufunc.h>
59234848Smav#include <machine/fp.h>
60234848Smav#include <machine/frame.h>
61234848Smav#include <machine/fsr.h>
62234848Smav#include <machine/intr_machdep.h>
63234848Smav#include <machine/lsu.h>
64234848Smav#include <machine/pcb.h>
65234848Smav#include <machine/pstate.h>
66234848Smav#include <machine/setjmp.h>
67234848Smav#include <machine/sigframe.h>
68234848Smav#include <machine/smp.h>
69234848Smav#include <machine/tte.h>
70234848Smav#include <machine/tlb.h>
71234848Smav#include <machine/tsb.h>
72234848Smav#include <machine/tstate.h>
73234848Smav#include <machine/upa.h>
74234848Smav#include <machine/utrap.h>
75234848Smav
76234848SmavASSYM(KERNBASE, KERNBASE);
77234848SmavASSYM(VM_MIN_PROM_ADDRESS, VM_MIN_PROM_ADDRESS);
78234848Smav
79234848SmavASSYM(EFAULT, EFAULT);
80234848SmavASSYM(ENAMETOOLONG, ENAMETOOLONG);
81234848Smav
82234848SmavASSYM(KSTACK_PAGES, KSTACK_PAGES);
83234848SmavASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES);
84234848SmavASSYM(PCPU_PAGES, PCPU_PAGES);
85234848Smav
86234848SmavASSYM(PIL_TICK, PIL_TICK);
87234848Smav
88234848SmavASSYM(FPRS_DL, FPRS_DL);
89234848SmavASSYM(FPRS_DU, FPRS_DU);
90234848SmavASSYM(FPRS_FEF, FPRS_FEF);
91234940Smav
92234848SmavASSYM(LSU_VW, LSU_VW);
93234868SmavASSYM(LSU_IC, LSU_IC);
94234848SmavASSYM(LSU_DC, LSU_DC);
95234848Smav
96234848SmavASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT);
97234848Smav
98234848SmavASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT);
99234940SmavASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS);
100234848SmavASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY);
101234848SmavASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT);
102234848SmavASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE);
103234848SmavASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK);
104234848Smav
105234848SmavASSYM(TSB_BUCKET_MASK, TSB_BUCKET_MASK);
106234848SmavASSYM(TSB_BUCKET_SHIFT, TSB_BUCKET_SHIFT);
107234848Smav
108234848SmavASSYM(INT_SHIFT, INT_SHIFT);
109234848SmavASSYM(PTR_SHIFT, PTR_SHIFT);
110234848Smav
111234940SmavASSYM(PAGE_SHIFT, PAGE_SHIFT);
112234848SmavASSYM(PAGE_SHIFT_8K, PAGE_SHIFT_8K);
113234848SmavASSYM(PAGE_SHIFT_4M, PAGE_SHIFT_4M);
114234848SmavASSYM(PAGE_SIZE, PAGE_SIZE);
115234848Smav
116234848SmavASSYM(CPU_CLKSYNC, CPU_CLKSYNC);
117234848SmavASSYM(CPU_INIT, CPU_INIT);
118234848Smav
119234848SmavASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid));
120234848SmavASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu));
121234848SmavASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state));
122234848SmavASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick));
123234848SmavASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver));
124234848SmavASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes));
125234848Smav
126234848SmavASSYM(DC_TAG_SHIFT, DC_TAG_SHIFT);
127234848SmavASSYM(DC_TAG_MASK, DC_TAG_MASK);
128240465SmavASSYM(DC_VALID_SHIFT, DC_VALID_SHIFT);
129234848SmavASSYM(DC_VALID_MASK, DC_VALID_MASK);
130234848SmavASSYM(IC_TAG_SHIFT, IC_TAG_SHIFT);
131234848SmavASSYM(IC_TAG_MASK, IC_TAG_MASK);
132234848SmavASSYM(IC_VALID_SHIFT, IC_VALID_SHIFT);
133234848SmavASSYM(IC_VALID_MASK, IC_VALID_MASK);
134234848Smav
135234848SmavASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size));
136234848SmavASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize));
137234848SmavASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size));
138234848SmavASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize));
139234848Smav
140234848SmavASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa));
141234848Smav
142234848SmavASSYM(KTR_PROC, KTR_PROC);
143234848SmavASSYM(KTR_TRAP, KTR_TRAP);
144234848SmavASSYM(KTR_SMP, KTR_SMP);
145234848SmavASSYM(KTR_SYSC, KTR_SYSC);
146234848SmavASSYM(KTR_INTR, KTR_INTR);
147234848SmavASSYM(KTR_CT1, KTR_CT1);
148234848SmavASSYM(KTR_CT2, KTR_CT2);
149234848SmavASSYM(KTR_CT3, KTR_CT3);
150234848SmavASSYM(KTR_CT4, KTR_CT4);
151234848SmavASSYM(KTR_CT5, KTR_CT5);
152234848SmavASSYM(KTR_CT6, KTR_CT6);
153234848SmavASSYM(KTR_CT7, KTR_CT7);
154234848SmavASSYM(KTR_CT8, KTR_CT8);
155234848Smav
156234848SmavASSYM(KTR_SIZEOF, sizeof(struct ktr_entry));
157234848SmavASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line));
158234848SmavASSYM(KTR_FILE, offsetof(struct ktr_entry, ktr_file));
159234848SmavASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc));
160234848SmavASSYM(KTR_CPU, offsetof(struct ktr_entry, ktr_cpu));
161234848SmavASSYM(KTR_TIMESTAMP, offsetof(struct ktr_entry, ktr_timestamp));
162234848SmavASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parms[0]));
163234848SmavASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parms[1]));
164234848SmavASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parms[2]));
165234848SmavASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parms[3]));
166234848SmavASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4]));
167234848SmavASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5]));
168234848Smav
169234848SmavASSYM(TTE_VPN, offsetof(struct tte, tte_vpn));
170234848SmavASSYM(TTE_DATA, offsetof(struct tte, tte_data));
171234848SmavASSYM(TTE_SHIFT, TTE_SHIFT);
172234848Smav
173234848SmavASSYM(TD_EXEC, TD_EXEC);
174234848SmavASSYM(TD_REF, TD_REF);
175234848SmavASSYM(TD_SW, TD_SW);
176234848SmavASSYM(TD_V, TD_V);
177234869SmavASSYM(TD_8K, TD_8K);
178234869SmavASSYM(TD_CP, TD_CP);
179234869SmavASSYM(TD_CV, TD_CV);
180234869SmavASSYM(TD_L, TD_L);
181234869SmavASSYM(TD_W, TD_W);
182234869Smav
183234869SmavASSYM(TS_MIN, TS_MIN);
184234899SmavASSYM(TS_MAX, TS_MAX);
185234899Smav
186234899SmavASSYM(TV_SIZE_BITS, TV_SIZE_BITS);
187234899Smav
188234848SmavASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
189234848Smav
190234848SmavASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
191234848SmavASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
192234848SmavASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
193234848SmavASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask));
194234848SmavASSYM(PC_IRHEAD, offsetof(struct pcpu, pc_irhead));
195234848SmavASSYM(PC_IRTAIL, offsetof(struct pcpu, pc_irtail));
196234848SmavASSYM(PC_IRFREE, offsetof(struct pcpu, pc_irfree));
197234848SmavASSYM(PC_MID, offsetof(struct pcpu, pc_mid));
198234848SmavASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
199234848SmavASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
200234848SmavASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min));
201234848SmavASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap));
202234848SmavASSYM(PC_CNT, offsetof(struct pcpu, pc_cnt));
203234848SmavASSYM(PC_SIZEOF, sizeof(struct pcpu));
204234848Smav
205234848SmavASSYM(IH_SHIFT, IH_SHIFT);
206234848Smav
207234848SmavASSYM(IRSR_BUSY, IRSR_BUSY);
208234848Smav
209234848SmavASSYM(IR_NEXT, offsetof(struct intr_request, ir_next));
210234848SmavASSYM(IR_FUNC, offsetof(struct intr_request, ir_func));
211234848SmavASSYM(IR_ARG, offsetof(struct intr_request, ir_arg));
212234848SmavASSYM(IR_PRI, offsetof(struct intr_request, ir_pri));
213234848SmavASSYM(IR_VEC, offsetof(struct intr_request, ir_vec));
214234848Smav
215234848SmavASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask));
216234848SmavASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap));
217234848SmavASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));
218234848SmavASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end));
219234848SmavASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va));
220234848Smav
221234848SmavASSYM(IV_SHIFT, IV_SHIFT);
222234848SmavASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
223234848SmavASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
224234848SmavASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
225234848Smav
226234848SmavASSYM(IV_NAMLEN, IV_NAMLEN);
227234848SmavASSYM(IV_MAX, IV_MAX);
228234848Smav
229234848SmavASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
230234848SmavASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
231234848Smav
232234848SmavASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap));
233234848Smav
234234848SmavASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock));
235234848Smav
236234848SmavASSYM(P_COMM, offsetof(struct proc, p_comm));
237234848SmavASSYM(P_MD, offsetof(struct proc, p_md));
238234848SmavASSYM(P_PID, offsetof(struct proc, p_pid));
239234848SmavASSYM(P_SFLAG, offsetof(struct proc, p_sflag));
240234848SmavASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
241234848Smav
242234848SmavASSYM(RW_SHIFT, RW_SHIFT);
243234848Smav
244234848SmavASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
245234848Smav
246234848SmavASSYM(TD_FRAME, offsetof(struct thread, td_frame));
247234848SmavASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
248234848SmavASSYM(TD_PCB, offsetof(struct thread, td_pcb));
249234848SmavASSYM(TD_PROC, offsetof(struct thread, td_proc));
250234848Smav
251234848SmavASSYM(PCB_SIZEOF, sizeof(struct pcb));
252234848SmavASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
253234848SmavASSYM(PCB_KFP, offsetof(struct pcb, pcb_kfp));
254234848SmavASSYM(PCB_UFP, offsetof(struct pcb, pcb_ufp));
255234848SmavASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
256234848SmavASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
257234848SmavASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
258234848SmavASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
259234848SmavASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
260234848SmavASSYM(PCB_FEF, PCB_FEF);
261234848Smav
262234848SmavASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
263234848SmavASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
264234848SmavASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
265234848SmavASSYM(PM_TSB, offsetof(struct pmap, pm_tsb));
266234848Smav
267234848SmavASSYM(SF_UC, offsetof(struct sigframe, sf_uc));
268234848Smav
269234848SmavASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP]));
270234869SmavASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC]));
271234848SmavASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP]));
272234848SmavASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG]));
273234848SmavASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK]));
274234848Smav
275234848SmavASSYM(TF_G0, offsetof(struct trapframe, tf_global[0]));
276234848SmavASSYM(TF_G1, offsetof(struct trapframe, tf_global[1]));
277234848SmavASSYM(TF_G2, offsetof(struct trapframe, tf_global[2]));
278234848SmavASSYM(TF_G3, offsetof(struct trapframe, tf_global[3]));
279234848SmavASSYM(TF_G4, offsetof(struct trapframe, tf_global[4]));
280234848SmavASSYM(TF_G5, offsetof(struct trapframe, tf_global[5]));
281234848SmavASSYM(TF_G6, offsetof(struct trapframe, tf_global[6]));
282234848SmavASSYM(TF_G7, offsetof(struct trapframe, tf_global[7]));
283234848SmavASSYM(TF_O0, offsetof(struct trapframe, tf_out[0]));
284234848SmavASSYM(TF_O1, offsetof(struct trapframe, tf_out[1]));
285234848SmavASSYM(TF_O2, offsetof(struct trapframe, tf_out[2]));
286234848SmavASSYM(TF_O3, offsetof(struct trapframe, tf_out[3]));
287234848SmavASSYM(TF_O4, offsetof(struct trapframe, tf_out[4]));
288234848SmavASSYM(TF_O5, offsetof(struct trapframe, tf_out[5]));
289234848SmavASSYM(TF_O6, offsetof(struct trapframe, tf_out[6]));
290234848SmavASSYM(TF_O7, offsetof(struct trapframe, tf_out[7]));
291234848SmavASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs));
292234869SmavASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr));
293234848SmavASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr));
294234848SmavASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level));
295234848SmavASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
296234848SmavASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar));
297234848SmavASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr));
298234848SmavASSYM(TF_TAR, offsetof(struct trapframe, tf_tar));
299234848SmavASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
300234848SmavASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc));
301234848SmavASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
302234848SmavASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
303234899SmavASSYM(TF_Y, offsetof(struct trapframe, tf_y));
304234899SmavASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
305234848SmavASSYM(TF_SIZEOF, sizeof(struct trapframe));
306234848Smav
307234848SmavASSYM(UT_MAX, UT_MAX);
308234848Smav