genassym.c revision 87702
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 87702 2001-12-11 23:33:44Z jhb $
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/vmmeter.h>
39
40#include <vm/vm.h>
41#include <vm/vm_param.h>
42#include <vm/vm_kern.h>
43#include <vm/vm_page.h>
44#include <vm/vm_map.h>
45
46#include <machine/asi.h>
47#include <machine/vmparam.h>
48#include <machine/cpufunc.h>
49#include <machine/fp.h>
50#include <machine/frame.h>
51#include <machine/fsr.h>
52#include <machine/intr_machdep.h>
53#include <machine/pcb.h>
54#include <machine/pstate.h>
55#include <machine/setjmp.h>
56#include <machine/sigframe.h>
57#include <machine/pv.h>
58#include <machine/tte.h>
59#include <machine/tlb.h>
60#include <machine/tsb.h>
61#include <machine/tstate.h>
62
63ASSYM(KERNBASE, KERNBASE);
64
65ASSYM(EFAULT, EFAULT);
66ASSYM(ENAMETOOLONG, ENAMETOOLONG);
67
68ASSYM(KSTACK_PAGES, KSTACK_PAGES);
69ASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES);
70ASSYM(UAREA_PAGES, UAREA_PAGES);
71ASSYM(PAGE_SIZE, PAGE_SIZE);
72
73ASSYM(PIL_TICK, PIL_TICK);
74
75ASSYM(FPRS_DL, FPRS_DL);
76ASSYM(FPRS_DU, FPRS_DU);
77ASSYM(FPRS_FEF, FPRS_FEF);
78
79ASSYM(TLB_DAR_TSB_USER_PRIMARY, TLB_DAR_SLOT(TLB_SLOT_TSB_USER_PRIMARY));
80ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS);
81
82ASSYM(TSB_USER_MIN_ADDRESS, TSB_USER_MIN_ADDRESS);
83ASSYM(TSB_PRIMARY_BUCKET_SHIFT, TSB_PRIMARY_BUCKET_SHIFT);
84ASSYM(TSB_PRIMARY_MASK_WIDTH, TSB_MASK_WIDTH);
85ASSYM(TSB_PRIMARY_STTE_MASK, TSB_PRIMARY_STTE_MASK);
86ASSYM(TSB_PRIMARY_STTE_SHIFT, TSB_PRIMARY_STTE_SHIFT);
87ASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK);
88ASSYM(TSB_KERNEL_VA_MASK, TSB_KERNEL_VA_MASK);
89
90ASSYM(PAGE_SHIFT, PAGE_SHIFT);
91ASSYM(PAGE_MASK, PAGE_MASK);
92
93ASSYM(KTR_COMPILE, KTR_COMPILE);
94ASSYM(KTR_PROC, KTR_PROC);
95ASSYM(KTR_TRAP, KTR_TRAP);
96ASSYM(KTR_SYSC, KTR_SYSC);
97ASSYM(KTR_INTR, KTR_INTR);
98ASSYM(KTR_CT1, KTR_CT1);
99ASSYM(KTR_CT2, KTR_CT2);
100ASSYM(KTR_CT3, KTR_CT3);
101ASSYM(KTR_CT4, KTR_CT4);
102
103ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry));
104ASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc));
105ASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parm1));
106ASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parm2));
107ASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parm3));
108ASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parm4));
109ASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parm5));
110
111ASSYM(TTE_DATA, offsetof(struct tte, tte_data));
112ASSYM(TTE_TAG, offsetof(struct tte, tte_tag));
113ASSYM(TTE_SHIFT, TTE_SHIFT);
114ASSYM(ST_TTE, offsetof(struct stte, st_tte));
115ASSYM(STTE_SHIFT, STTE_SHIFT);
116ASSYM(STTE_SIZEOF, sizeof(struct stte));
117
118ASSYM(TD_VA_LOW_MASK, TD_VA_LOW_MASK);
119ASSYM(TD_VA_LOW_SHIFT, TD_VA_LOW_SHIFT);
120ASSYM(TD_EXEC, TD_EXEC);
121ASSYM(TD_INIT, TD_INIT);
122ASSYM(TD_REF, TD_REF);
123ASSYM(TD_W, TD_W);
124
125ASSYM(TT_VA_MASK, TT_VA_MASK);
126ASSYM(TT_VA_SHIFT, TT_VA_SHIFT);
127ASSYM(TT_CTX_SHIFT, TT_CTX_SHIFT);
128
129ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
130
131ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
132ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
133ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
134
135ASSYM(IH_SHIFT, IH_SHIFT);
136ASSYM(IH_FUNC, offsetof(struct intr_handler, ih_func));
137
138ASSYM(IQ_MASK, IQ_MASK);
139ASSYM(IQ_HEAD, offsetof(struct intr_queue, iq_head));
140ASSYM(IQ_TAIL, offsetof(struct intr_queue, iq_tail));
141
142ASSYM(IQE_SHIFT, IQE_SHIFT);
143ASSYM(IQE_TAG, offsetof(struct iqe, iqe_tag));
144ASSYM(IQE_PRI, offsetof(struct iqe, iqe_pri));
145ASSYM(IQE_VEC, offsetof(struct iqe, iqe_vec));
146ASSYM(IQE_FUNC, offsetof(struct iqe, iqe_func));
147ASSYM(IQE_ARG, offsetof(struct iqe, iqe_arg));
148
149ASSYM(IV_SHIFT, IV_SHIFT);
150ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
151ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
152ASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
153
154ASSYM(NIV, NIV);
155
156ASSYM(KEF_ASTPENDING, KEF_ASTPENDING);
157ASSYM(KEF_NEEDRESCHED, KEF_NEEDRESCHED);
158
159ASSYM(P_COMM, offsetof(struct proc, p_comm));
160ASSYM(P_SFLAG, offsetof(struct proc, p_sflag));
161ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
162
163ASSYM(KE_FLAGS, offsetof(struct kse, ke_flags));
164
165ASSYM(TD_FRAME, offsetof(struct thread, td_frame));
166ASSYM(TD_KSE, offsetof(struct thread, td_kse));
167ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
168ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
169ASSYM(TD_PROC, offsetof(struct thread, td_proc));
170
171ASSYM(PCB_SIZEOF, sizeof(struct pcb));
172ASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate));
173ASSYM(PCB_FP, offsetof(struct pcb, pcb_fp));
174ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
175ASSYM(PCB_Y, offsetof(struct pcb, pcb_pc));
176ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
177ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
178ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
179ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
180
181ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
182ASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
183ASSYM(PM_STTE, offsetof(struct pmap, pm_stte));
184
185ASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0]));
186ASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1]));
187ASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2]));
188ASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3]));
189ASSYM(FP_FSR, offsetof(struct fpstate, fp_fsr));
190ASSYM(FP_FPRS, offsetof(struct fpstate, fp_fprs));
191
192ASSYM(CCFSZ, sizeof(struct frame));
193ASSYM(SPOFF, SPOFF);
194
195ASSYM(SF_UC, offsetof(struct sigframe, sf_uc));
196
197ASSYM(MF_SFAR, offsetof(struct mmuframe, mf_sfar));
198ASSYM(MF_SFSR, offsetof(struct mmuframe, mf_sfsr));
199ASSYM(MF_TAR, offsetof(struct mmuframe, mf_tar));
200ASSYM(MF_SIZEOF, sizeof(struct mmuframe));
201
202ASSYM(UC_SIZEOF, sizeof(ucontext_t));
203ASSYM(UC_SIGMASK, offsetof(ucontext_t, uc_sigmask));
204ASSYM(UC_MC, offsetof(ucontext_t, uc_mcontext));
205
206ASSYM(MC_G1, offsetof(mcontext_t, mc_global[1]));
207ASSYM(MC_O0, offsetof(mcontext_t, mc_out[0]));
208ASSYM(MC_O6, offsetof(mcontext_t, mc_out[6]));
209ASSYM(MC_O7, offsetof(mcontext_t, mc_out[7]));
210ASSYM(MC_TPC, offsetof(mcontext_t, mc_tpc));
211ASSYM(MC_TNPC, offsetof(mcontext_t, mc_tnpc));
212
213ASSYM(TF_G0, offsetof(struct trapframe, tf_global[0]));
214ASSYM(TF_G1, offsetof(struct trapframe, tf_global[1]));
215ASSYM(TF_G2, offsetof(struct trapframe, tf_global[2]));
216ASSYM(TF_G3, offsetof(struct trapframe, tf_global[3]));
217ASSYM(TF_G4, offsetof(struct trapframe, tf_global[4]));
218ASSYM(TF_G5, offsetof(struct trapframe, tf_global[5]));
219ASSYM(TF_G6, offsetof(struct trapframe, tf_global[6]));
220ASSYM(TF_G7, offsetof(struct trapframe, tf_global[7]));
221ASSYM(TF_O0, offsetof(struct trapframe, tf_out[0]));
222ASSYM(TF_O1, offsetof(struct trapframe, tf_out[1]));
223ASSYM(TF_O2, offsetof(struct trapframe, tf_out[2]));
224ASSYM(TF_O3, offsetof(struct trapframe, tf_out[3]));
225ASSYM(TF_O4, offsetof(struct trapframe, tf_out[4]));
226ASSYM(TF_O5, offsetof(struct trapframe, tf_out[5]));
227ASSYM(TF_O6, offsetof(struct trapframe, tf_out[6]));
228ASSYM(TF_O7, offsetof(struct trapframe, tf_out[7]));
229ASSYM(TF_SP, offsetof(struct trapframe, tf_sp));
230ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
231ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
232ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc));
233ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
234ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
235ASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
236ASSYM(TF_ARG, offsetof(struct trapframe, tf_arg));
237ASSYM(TF_SIZEOF, sizeof(struct trapframe));
238