2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2001 Jake Burkholder.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
31 #include <sys/cdefs.h>
32 __FBSDID("$FreeBSD$");
34 #include "opt_kstack_pages.h"
36 #include <sys/param.h>
37 #include <sys/assym.h>
41 #include <sys/vmmeter.h>
42 #include <sys/_cpuset.h>
44 #include <machine/atomic.h>
46 #include <vm/vm_page.h>
47 #include <vm/vm_map.h>
49 #include <machine/cache.h>
50 #include <machine/pcb.h>
51 #include <machine/setjmp.h>
52 #include <machine/smp.h>
53 #include <machine/tlb.h>
54 #include <machine/tte.h>
55 #include <machine/vmparam.h>
57 ASSYM(KERNBASE, KERNBASE);
59 ASSYM(KSTACK_PAGES, KSTACK_PAGES);
60 ASSYM(PCPU_PAGES, PCPU_PAGES);
62 ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT);
64 ASSYM(_NCPUBITS, _NCPUBITS);
66 ASSYM(TLB_DEMAP_ALL, TLB_DEMAP_ALL);
67 ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT);
68 ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS);
69 ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE);
70 ASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY);
72 ASSYM(INT_SHIFT, INT_SHIFT);
73 ASSYM(PTR_SHIFT, PTR_SHIFT);
75 ASSYM(PAGE_SHIFT, PAGE_SHIFT);
76 ASSYM(PAGE_SHIFT_8K, PAGE_SHIFT_8K);
77 ASSYM(PAGE_SHIFT_4M, PAGE_SHIFT_4M);
78 ASSYM(PAGE_SIZE, PAGE_SIZE);
79 ASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M);
82 ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu));
83 ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state));
84 ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid));
85 ASSYM(CSA_STICK, offsetof(struct cpu_start_args, csa_stick));
86 ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick));
87 ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes));
88 ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver));
91 ASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size));
92 ASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize));
93 ASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size));
94 ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize));
96 ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry));
97 ASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line));
98 ASSYM(KTR_FILE, offsetof(struct ktr_entry, ktr_file));
99 ASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc));
100 ASSYM(KTR_CPU, offsetof(struct ktr_entry, ktr_cpu));
101 ASSYM(KTR_TIMESTAMP, offsetof(struct ktr_entry, ktr_timestamp));
102 ASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parms[0]));
103 ASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parms[1]));
104 ASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parms[2]));
105 ASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parms[3]));
106 ASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4]));
107 ASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5]));
109 ASSYM(TTE_SHIFT, TTE_SHIFT);
110 ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn));
111 ASSYM(TTE_DATA, offsetof(struct tte, tte_data));
114 ASSYM(TD_EXEC, TD_EXEC);
115 ASSYM(TD_REF, TD_REF);
122 ASSYM(TS_MIN, TS_MIN);
123 ASSYM(TS_MAX, TS_MAX);
124 ASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT);
125 ASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MASK);
126 ASSYM(TLB_DIRECT_ADDRESS_MASK, TLB_DIRECT_ADDRESS_MASK);
127 ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK);
128 ASSYM(TV_SIZE_BITS, TV_SIZE_BITS);
130 ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
132 ASSYM(MAXCOMLEN, MAXCOMLEN);
133 ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
134 ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
135 ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
136 ASSYM(PC_IRHEAD, offsetof(struct pcpu, pc_irhead));
137 ASSYM(PC_IRTAIL, offsetof(struct pcpu, pc_irtail));
138 ASSYM(PC_IRFREE, offsetof(struct pcpu, pc_irfree));
139 ASSYM(PC_SIZEOF, sizeof(struct pcpu));
141 ASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache));
142 ASSYM(PC_MID, offsetof(struct pcpu, pc_mid));
143 ASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap));
144 ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
145 ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
146 ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min));
148 ASSYM(IR_NEXT, offsetof(struct intr_request, ir_next));
149 ASSYM(IR_FUNC, offsetof(struct intr_request, ir_func));
150 ASSYM(IR_ARG, offsetof(struct intr_request, ir_arg));
151 ASSYM(IR_PRI, offsetof(struct intr_request, ir_pri));
152 ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec));
155 ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa));
157 ASSYM(IRA_MASK, offsetof(struct ipi_rd_args, ira_mask));
158 ASSYM(IRA_VAL, offsetof(struct ipi_rd_args, ira_val));
160 ASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask));
161 ASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap));
162 ASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));
163 ASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end));
164 ASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va));
167 ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
168 ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
169 ASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
171 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
172 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
174 ASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap));
176 ASSYM(P_COMM, offsetof(struct proc, p_comm));
177 ASSYM(P_MD, offsetof(struct proc, p_md));
178 ASSYM(P_PID, offsetof(struct proc, p_pid));
179 ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
181 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
182 ASSYM(TD_FRAME, offsetof(struct thread, td_frame));
183 ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
184 ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
185 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
186 ASSYM(TD_PROC, offsetof(struct thread, td_proc));
187 ASSYM(TD_MD, offsetof(struct thread, td_md));
188 ASSYM(MD_SAVED_PIL, offsetof(struct mdthread, md_saved_pil));
190 ASSYM(PCB_SIZEOF, sizeof(struct pcb));
191 ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
192 ASSYM(PCB_KFP, offsetof(struct pcb, pcb_kfp));
193 ASSYM(PCB_UFP, offsetof(struct pcb, pcb_ufp));
194 ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
195 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
196 ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
197 ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
198 ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
199 ASSYM(PCB_PAD, offsetof(struct pcb, pcb_pad));
201 ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
202 ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
203 ASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
204 ASSYM(PM_TSB, offsetof(struct pmap, pm_tsb));
206 ASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP]));
207 ASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC]));
208 ASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP]));
209 ASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG]));
210 ASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK]));
212 ASSYM(TF_G0, offsetof(struct trapframe, tf_global[0]));
213 ASSYM(TF_G1, offsetof(struct trapframe, tf_global[1]));
214 ASSYM(TF_G2, offsetof(struct trapframe, tf_global[2]));
215 ASSYM(TF_G3, offsetof(struct trapframe, tf_global[3]));
216 ASSYM(TF_G4, offsetof(struct trapframe, tf_global[4]));
217 ASSYM(TF_G5, offsetof(struct trapframe, tf_global[5]));
218 ASSYM(TF_G6, offsetof(struct trapframe, tf_global[6]));
219 ASSYM(TF_G7, offsetof(struct trapframe, tf_global[7]));
220 ASSYM(TF_O0, offsetof(struct trapframe, tf_out[0]));
221 ASSYM(TF_O1, offsetof(struct trapframe, tf_out[1]));
222 ASSYM(TF_O2, offsetof(struct trapframe, tf_out[2]));
223 ASSYM(TF_O3, offsetof(struct trapframe, tf_out[3]));
224 ASSYM(TF_O4, offsetof(struct trapframe, tf_out[4]));
225 ASSYM(TF_O5, offsetof(struct trapframe, tf_out[5]));
226 ASSYM(TF_O6, offsetof(struct trapframe, tf_out[6]));
227 ASSYM(TF_O7, offsetof(struct trapframe, tf_out[7]));
228 ASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs));
229 ASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr));
230 ASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr));
231 ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
232 ASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level));
233 ASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar));
234 ASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr));
235 ASSYM(TF_TAR, offsetof(struct trapframe, tf_tar));
236 ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
237 ASSYM(TF_Y, offsetof(struct trapframe, tf_y));
238 ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
239 ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc));
240 ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
241 ASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
242 ASSYM(TF_SIZEOF, sizeof(struct trapframe));
244 ASSYM(VM_MIN_DIRECT_ADDRESS, VM_MIN_DIRECT_ADDRESS);
245 ASSYM(VM_MIN_PROM_ADDRESS, VM_MIN_PROM_ADDRESS);
246 ASSYM(VM_MAX_PROM_ADDRESS, VM_MAX_PROM_ADDRESS);