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: releng/5.2/sys/sparc64/sparc64/genassym.c 119396 2003-08-24 06:23:36Z jmg $
28 */
29
30 #include "opt_kstack_pages.h"
31
32 #include <sys/param.h>
33 #include <sys/assym.h>
34 #include <sys/errno.h>
35 #include <sys/ktr.h>
36 #include <sys/proc.h>
37 #include <sys/queue.h>
38 #include <sys/lock.h>
39 #include <sys/mutex.h>
40 #include <sys/signal.h>
41 #include <sys/smp.h>
42 #include <sys/systm.h>
43 #include <sys/ucontext.h>
44 #include <sys/user.h>
45 #include <sys/ucontext.h>
46 #include <sys/vmmeter.h>
47
48 #include <vm/vm.h>
49 #include <vm/vm_param.h>
50 #include <vm/vm_kern.h>
51 #include <vm/vm_page.h>
52 #include <vm/vm_map.h>
53
54 #include <machine/asi.h>
55 #include <machine/cache.h>
56 #include <machine/vmparam.h>
57 #include <machine/cpufunc.h>
58 #include <machine/fp.h>
59 #include <machine/frame.h>
60 #include <machine/fsr.h>
61 #include <machine/intr_machdep.h>
62 #include <machine/lsu.h>
63 #include <machine/pcb.h>
64 #include <machine/pstate.h>
65 #include <machine/setjmp.h>
66 #include <machine/sigframe.h>
67 #include <machine/smp.h>
68 #include <machine/tte.h>
69 #include <machine/tlb.h>
70 #include <machine/tsb.h>
71 #include <machine/tstate.h>
72 #include <machine/upa.h>
73 #include <machine/utrap.h>
74
75 ASSYM(KERNBASE, KERNBASE);
76 ASSYM(VM_MIN_PROM_ADDRESS, VM_MIN_PROM_ADDRESS);
77
78 ASSYM(EFAULT, EFAULT);
79 ASSYM(ENAMETOOLONG, ENAMETOOLONG);
80
81 ASSYM(KSTACK_PAGES, KSTACK_PAGES);
82 ASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES);
83 ASSYM(PCPU_PAGES, PCPU_PAGES);
84 ASSYM(UAREA_PAGES, UAREA_PAGES);
85
86 ASSYM(PIL_TICK, PIL_TICK);
87
88 ASSYM(FPRS_DL, FPRS_DL);
89 ASSYM(FPRS_DU, FPRS_DU);
90 ASSYM(FPRS_FEF, FPRS_FEF);
91
92 ASSYM(LSU_VW, LSU_VW);
93 ASSYM(LSU_IC, LSU_IC);
94 ASSYM(LSU_DC, LSU_DC);
95
96 ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT);
97
98 ASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT);
99 ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS);
100 ASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY);
101 ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT);
102 ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE);
103 ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK);
104
105 ASSYM(TSB_BUCKET_MASK, TSB_BUCKET_MASK);
106 ASSYM(TSB_BUCKET_SHIFT, TSB_BUCKET_SHIFT);
107
108 ASSYM(INT_SHIFT, INT_SHIFT);
109 ASSYM(PTR_SHIFT, PTR_SHIFT);
110
111 ASSYM(PAGE_SHIFT, PAGE_SHIFT);
112 ASSYM(PAGE_SHIFT_8K, PAGE_SHIFT_8K);
113 ASSYM(PAGE_SHIFT_4M, PAGE_SHIFT_4M);
114 ASSYM(PAGE_SIZE, PAGE_SIZE);
115
116 ASSYM(CPU_CLKSYNC, CPU_CLKSYNC);
117 ASSYM(CPU_INIT, CPU_INIT);
118
119 ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid));
120 ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu));
121 ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state));
122 ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick));
123 ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver));
124 ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes));
125
126 ASSYM(DC_TAG_SHIFT, DC_TAG_SHIFT);
127 ASSYM(DC_TAG_MASK, DC_TAG_MASK);
128 ASSYM(DC_VALID_SHIFT, DC_VALID_SHIFT);
129 ASSYM(DC_VALID_MASK, DC_VALID_MASK);
130 ASSYM(IC_TAG_SHIFT, IC_TAG_SHIFT);
131 ASSYM(IC_TAG_MASK, IC_TAG_MASK);
132 ASSYM(IC_VALID_SHIFT, IC_VALID_SHIFT);
133 ASSYM(IC_VALID_MASK, IC_VALID_MASK);
134
135 ASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size));
136 ASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize));
137 ASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size));
138 ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize));
139
140 ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa));
141
142 ASSYM(KTR_PROC, KTR_PROC);
143 ASSYM(KTR_TRAP, KTR_TRAP);
144 ASSYM(KTR_SMP, KTR_SMP);
145 ASSYM(KTR_SYSC, KTR_SYSC);
146 ASSYM(KTR_INTR, KTR_INTR);
147 ASSYM(KTR_CT1, KTR_CT1);
148 ASSYM(KTR_CT2, KTR_CT2);
149 ASSYM(KTR_CT3, KTR_CT3);
150 ASSYM(KTR_CT4, KTR_CT4);
151 ASSYM(KTR_CT5, KTR_CT5);
152 ASSYM(KTR_CT6, KTR_CT6);
153 ASSYM(KTR_CT7, KTR_CT7);
154 ASSYM(KTR_CT8, KTR_CT8);
155
156 ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry));
157 ASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line));
158 ASSYM(KTR_FILE, offsetof(struct ktr_entry, ktr_file));
159 ASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc));
160 ASSYM(KTR_CPU, offsetof(struct ktr_entry, ktr_cpu));
161 ASSYM(KTR_TIMESTAMP, offsetof(struct ktr_entry, ktr_timestamp));
162 ASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parms[0]));
163 ASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parms[1]));
164 ASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parms[2]));
165 ASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parms[3]));
166 ASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4]));
167 ASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5]));
168
169 ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn));
170 ASSYM(TTE_DATA, offsetof(struct tte, tte_data));
171 ASSYM(TTE_SHIFT, TTE_SHIFT);
172
173 ASSYM(TD_EXEC, TD_EXEC);
174 ASSYM(TD_REF, TD_REF);
175 ASSYM(TD_SW, TD_SW);
176 ASSYM(TD_V, TD_V);
177 ASSYM(TD_8K, TD_8K);
178 ASSYM(TD_CP, TD_CP);
179 ASSYM(TD_CV, TD_CV);
180 ASSYM(TD_L, TD_L);
181 ASSYM(TD_W, TD_W);
182
183 ASSYM(TS_MIN, TS_MIN);
184 ASSYM(TS_MAX, TS_MAX);
185
186 ASSYM(TV_SIZE_BITS, TV_SIZE_BITS);
187
188 ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
189
190 ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
191 ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
192 ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
193 ASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask));
194 ASSYM(PC_IRHEAD, offsetof(struct pcpu, pc_irhead));
195 ASSYM(PC_IRTAIL, offsetof(struct pcpu, pc_irtail));
196 ASSYM(PC_IRFREE, offsetof(struct pcpu, pc_irfree));
197 ASSYM(PC_MID, offsetof(struct pcpu, pc_mid));
198 ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
199 ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
200 ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min));
201 ASSYM(PC_VMSPACE, offsetof(struct pcpu, pc_vmspace));
202 ASSYM(PC_SIZEOF, sizeof(struct pcpu));
203
204 ASSYM(IH_SHIFT, IH_SHIFT);
205
206 ASSYM(IRSR_BUSY, IRSR_BUSY);
207
208 ASSYM(IR_NEXT, offsetof(struct intr_request, ir_next));
209 ASSYM(IR_FUNC, offsetof(struct intr_request, ir_func));
210 ASSYM(IR_ARG, offsetof(struct intr_request, ir_arg));
211 ASSYM(IR_PRI, offsetof(struct intr_request, ir_pri));
212 ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec));
213
214 ASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask));
215 ASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap));
216 ASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));
217 ASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end));
218 ASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va));
219
220 ASSYM(IV_SHIFT, IV_SHIFT);
221 ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
222 ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
223 ASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
224
225 ASSYM(IV_NAMLEN, IV_NAMLEN);
226 ASSYM(IV_MAX, IV_MAX);
227
228 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
229 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
230
231 ASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap));
232
233 ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock));
234
235 ASSYM(P_COMM, offsetof(struct proc, p_comm));
236 ASSYM(P_MD, offsetof(struct proc, p_md));
237 ASSYM(P_PID, offsetof(struct proc, p_pid));
238 ASSYM(P_SFLAG, offsetof(struct proc, p_sflag));
239 ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
240
241 ASSYM(RW_SHIFT, RW_SHIFT);
242
243 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
244
245 ASSYM(TD_FRAME, offsetof(struct thread, td_frame));
246 ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
247 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
248 ASSYM(TD_PROC, offsetof(struct thread, td_proc));
249
250 ASSYM(PCB_SIZEOF, sizeof(struct pcb));
251 ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
252 ASSYM(PCB_KFP, offsetof(struct pcb, pcb_kfp));
253 ASSYM(PCB_UFP, offsetof(struct pcb, pcb_ufp));
254 ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
255 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
256 ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
257 ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
258 ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
259 ASSYM(PCB_FEF, PCB_FEF);
260
261 ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
262 ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
263 ASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
264 ASSYM(PM_TSB, offsetof(struct pmap, pm_tsb));
265
266 ASSYM(SF_UC, offsetof(struct sigframe, sf_uc));
267
268 ASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP]));
269 ASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC]));
270 ASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP]));
271 ASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG]));
272 ASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK]));
273
274 ASSYM(TF_G0, offsetof(struct trapframe, tf_global[0]));
275 ASSYM(TF_G1, offsetof(struct trapframe, tf_global[1]));
276 ASSYM(TF_G2, offsetof(struct trapframe, tf_global[2]));
277 ASSYM(TF_G3, offsetof(struct trapframe, tf_global[3]));
278 ASSYM(TF_G4, offsetof(struct trapframe, tf_global[4]));
279 ASSYM(TF_G5, offsetof(struct trapframe, tf_global[5]));
280 ASSYM(TF_G6, offsetof(struct trapframe, tf_global[6]));
281 ASSYM(TF_G7, offsetof(struct trapframe, tf_global[7]));
282 ASSYM(TF_O0, offsetof(struct trapframe, tf_out[0]));
283 ASSYM(TF_O1, offsetof(struct trapframe, tf_out[1]));
284 ASSYM(TF_O2, offsetof(struct trapframe, tf_out[2]));
285 ASSYM(TF_O3, offsetof(struct trapframe, tf_out[3]));
286 ASSYM(TF_O4, offsetof(struct trapframe, tf_out[4]));
287 ASSYM(TF_O5, offsetof(struct trapframe, tf_out[5]));
288 ASSYM(TF_O6, offsetof(struct trapframe, tf_out[6]));
289 ASSYM(TF_O7, offsetof(struct trapframe, tf_out[7]));
290 ASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs));
291 ASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr));
292 ASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr));
293 ASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level));
294 ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
295 ASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar));
296 ASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr));
297 ASSYM(TF_TAR, offsetof(struct trapframe, tf_tar));
298 ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
299 ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc));
300 ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
301 ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
302 ASSYM(TF_Y, offsetof(struct trapframe, tf_y));
303 ASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
304 ASSYM(TF_SIZEOF, sizeof(struct trapframe));
305
306 ASSYM(UT_MAX, UT_MAX);
Cache object: 45505eda066d626970bd78d429f4b656
|