genassym.c revision 254065
1260154Sdelphij/*-
2260154Sdelphij * Copyright (c) 2001 Jake Burkholder.
3260154Sdelphij * All rights reserved.
4260154Sdelphij *
5260154Sdelphij * Redistribution and use in source and binary forms, with or without
6260154Sdelphij * modification, are permitted provided that the following conditions
7260154Sdelphij * are met:
8260154Sdelphij * 1. Redistributions of source code must retain the above copyright
9260154Sdelphij *    notice, this list of conditions and the following disclaimer.
10260154Sdelphij * 2. Redistributions in binary form must reproduce the above copyright
11260154Sdelphij *    notice, this list of conditions and the following disclaimer in the
12260154Sdelphij *    documentation and/or other materials provided with the distribution.
13260154Sdelphij *
14260154Sdelphij * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15260154Sdelphij * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16269006Sdelphij * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17260154Sdelphij * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18260154Sdelphij * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19260154Sdelphij * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20260154Sdelphij * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21260154Sdelphij * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22260154Sdelphij * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23260154Sdelphij * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24260154Sdelphij * SUCH DAMAGE.
25260154Sdelphij *
26260154Sdelphij *	from: @(#)genassym.c	5.11 (Berkeley) 5/10/91
27260154Sdelphij */
28260154Sdelphij
29260154Sdelphij#include <sys/cdefs.h>
30260154Sdelphij__FBSDID("$FreeBSD: head/sys/sparc64/sparc64/genassym.c 254065 2013-08-07 16:36:38Z kib $");
31260154Sdelphij
32260154Sdelphij#include "opt_kstack_pages.h"
33260154Sdelphij
34260154Sdelphij#include <sys/param.h>
35260154Sdelphij#include <sys/assym.h>
36260154Sdelphij#include <sys/ktr.h>
37260154Sdelphij#include <sys/proc.h>
38260154Sdelphij#include <sys/smp.h>
39260154Sdelphij#include <sys/vmmeter.h>
40260154Sdelphij#include <sys/_cpuset.h>
41260154Sdelphij
42260154Sdelphij#include <machine/atomic.h>
43260154Sdelphij#include <vm/vm.h>
44260154Sdelphij#include <vm/vm_page.h>
45260154Sdelphij#include <vm/vm_map.h>
46260154Sdelphij
47260154Sdelphij#include <machine/cache.h>
48260154Sdelphij#include <machine/pcb.h>
49260154Sdelphij#include <machine/setjmp.h>
50260154Sdelphij#include <machine/smp.h>
51260154Sdelphij#include <machine/tlb.h>
52260154Sdelphij#include <machine/tte.h>
53260154Sdelphij#include <machine/vmparam.h>
54260154Sdelphij
55260154SdelphijASSYM(KERNBASE, KERNBASE);
56260154Sdelphij
57260154SdelphijASSYM(KSTACK_PAGES, KSTACK_PAGES);
58260154SdelphijASSYM(PCPU_PAGES, PCPU_PAGES);
59260154Sdelphij
60260154SdelphijASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT);
61260154Sdelphij
62260154SdelphijASSYM(_NCPUBITS, _NCPUBITS);
63260154Sdelphij
64260154SdelphijASSYM(TLB_DEMAP_ALL, TLB_DEMAP_ALL);
65260154SdelphijASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT);
66260154SdelphijASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS);
67260154SdelphijASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE);
68277585SdelphijASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY);
69260154Sdelphij
70260154SdelphijASSYM(INT_SHIFT, INT_SHIFT);
71260154SdelphijASSYM(PTR_SHIFT, PTR_SHIFT);
72260154Sdelphij
73260154SdelphijASSYM(PAGE_SHIFT, PAGE_SHIFT);
74260154SdelphijASSYM(PAGE_SHIFT_8K, PAGE_SHIFT_8K);
75260154SdelphijASSYM(PAGE_SHIFT_4M, PAGE_SHIFT_4M);
76260154SdelphijASSYM(PAGE_SIZE, PAGE_SIZE);
77260154SdelphijASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M);
78260154Sdelphij
79260154Sdelphij#ifdef SMP
80260154SdelphijASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu));
81260154SdelphijASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state));
82260154SdelphijASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid));
83260154SdelphijASSYM(CSA_STICK, offsetof(struct cpu_start_args, csa_stick));
84260154SdelphijASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick));
85260154SdelphijASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes));
86260154SdelphijASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver));
87260154Sdelphij#endif
88260154Sdelphij
89260154SdelphijASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size));
90260154SdelphijASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize));
91260154SdelphijASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size));
92260154SdelphijASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize));
93260154Sdelphij
94260154SdelphijASSYM(KTR_SIZEOF, sizeof(struct ktr_entry));
95260154SdelphijASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line));
96260154SdelphijASSYM(KTR_FILE, offsetof(struct ktr_entry, ktr_file));
97260154SdelphijASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc));
98260154SdelphijASSYM(KTR_CPU, offsetof(struct ktr_entry, ktr_cpu));
99260154SdelphijASSYM(KTR_TIMESTAMP, offsetof(struct ktr_entry, ktr_timestamp));
100260154SdelphijASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parms[0]));
101260154SdelphijASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parms[1]));
102260154SdelphijASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parms[2]));
103260154SdelphijASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parms[3]));
104260154SdelphijASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4]));
105260154SdelphijASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5]));
106260154Sdelphij
107260154SdelphijASSYM(TTE_SHIFT, TTE_SHIFT);
108260154SdelphijASSYM(TTE_VPN, offsetof(struct tte, tte_vpn));
109260154SdelphijASSYM(TTE_DATA, offsetof(struct tte, tte_data));
110260154Sdelphij
111260154SdelphijASSYM(TD_V, TD_V);
112260154SdelphijASSYM(TD_EXEC, TD_EXEC);
113260154SdelphijASSYM(TD_REF, TD_REF);
114260154SdelphijASSYM(TD_SW, TD_SW);
115260154SdelphijASSYM(TD_L, TD_L);
116260154SdelphijASSYM(TD_CP, TD_CP);
117260154SdelphijASSYM(TD_CV, TD_CV);
118260154SdelphijASSYM(TD_W, TD_W);
119260154Sdelphij
120260154SdelphijASSYM(TS_MIN, TS_MIN);
121260154SdelphijASSYM(TS_MAX, TS_MAX);
122260154SdelphijASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT);
123288549SmavASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MASK);
124260154SdelphijASSYM(TLB_DIRECT_ADDRESS_MASK, TLB_DIRECT_ADDRESS_MASK);
125260154SdelphijASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK);
126260154SdelphijASSYM(TV_SIZE_BITS, TV_SIZE_BITS);
127260154Sdelphij
128260154SdelphijASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
129260154Sdelphij
130260154SdelphijASSYM(MAXCOMLEN, MAXCOMLEN);
131260154SdelphijASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
132260154SdelphijASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
133260154SdelphijASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
134260154SdelphijASSYM(PC_IRHEAD, offsetof(struct pcpu, pc_irhead));
135260154SdelphijASSYM(PC_IRTAIL, offsetof(struct pcpu, pc_irtail));
136260154SdelphijASSYM(PC_IRFREE, offsetof(struct pcpu, pc_irfree));
137260154SdelphijASSYM(PC_CNT, offsetof(struct pcpu, pc_cnt));
138260154SdelphijASSYM(PC_SIZEOF, sizeof(struct pcpu));
139260154Sdelphij
140260154SdelphijASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache));
141260154SdelphijASSYM(PC_MID, offsetof(struct pcpu, pc_mid));
142260154SdelphijASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap));
143260154SdelphijASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
144260154SdelphijASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
145260154SdelphijASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min));
146260154Sdelphij
147260154SdelphijASSYM(IR_NEXT, offsetof(struct intr_request, ir_next));
148260154SdelphijASSYM(IR_FUNC, offsetof(struct intr_request, ir_func));
149260154SdelphijASSYM(IR_ARG, offsetof(struct intr_request, ir_arg));
150260154SdelphijASSYM(IR_PRI, offsetof(struct intr_request, ir_pri));
151260154SdelphijASSYM(IR_VEC, offsetof(struct intr_request, ir_vec));
152260154Sdelphij
153260154Sdelphij#ifdef SMP
154260154SdelphijASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa));
155260154Sdelphij
156260154SdelphijASSYM(IRA_MASK, offsetof(struct ipi_rd_args, ira_mask));
157260154SdelphijASSYM(IRA_VAL, offsetof(struct ipi_rd_args, ira_val));
158260154Sdelphij
159260154SdelphijASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask));
160260154SdelphijASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap));
161260154SdelphijASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));
162260154SdelphijASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end));
163260154SdelphijASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va));
164260154Sdelphij#endif
165260154Sdelphij
166260154SdelphijASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
167260154SdelphijASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
168260154SdelphijASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
169260154Sdelphij
170260154SdelphijASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
171260154SdelphijASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
172260154Sdelphij
173260154SdelphijASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap));
174260154Sdelphij
175260154SdelphijASSYM(P_COMM, offsetof(struct proc, p_comm));
176260154SdelphijASSYM(P_MD, offsetof(struct proc, p_md));
177260154SdelphijASSYM(P_PID, offsetof(struct proc, p_pid));
178260154SdelphijASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
179260154Sdelphij
180260154SdelphijASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
181260154SdelphijASSYM(TD_FRAME, offsetof(struct thread, td_frame));
182260154SdelphijASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
183260154SdelphijASSYM(TD_LOCK, offsetof(struct thread, td_lock));
184260154SdelphijASSYM(TD_PCB, offsetof(struct thread, td_pcb));
185260154SdelphijASSYM(TD_PROC, offsetof(struct thread, td_proc));
186260154SdelphijASSYM(TD_MD, offsetof(struct thread, td_md));
187260154SdelphijASSYM(MD_SAVED_PIL, offsetof(struct mdthread, md_saved_pil));
188260154Sdelphij
189260154SdelphijASSYM(PCB_SIZEOF, sizeof(struct pcb));
190260154SdelphijASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
191260154SdelphijASSYM(PCB_KFP, offsetof(struct pcb, pcb_kfp));
192260154SdelphijASSYM(PCB_UFP, offsetof(struct pcb, pcb_ufp));
193260154SdelphijASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
194260154SdelphijASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
195260154SdelphijASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
196260154SdelphijASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
197260154SdelphijASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
198260154SdelphijASSYM(PCB_PAD, offsetof(struct pcb, pcb_pad));
199260154Sdelphij
200260154SdelphijASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
201260154SdelphijASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
202260154SdelphijASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
203260154SdelphijASSYM(PM_TSB, offsetof(struct pmap, pm_tsb));
204260154Sdelphij
205260154SdelphijASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP]));
206260154SdelphijASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC]));
207260154SdelphijASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP]));
208260154SdelphijASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG]));
209260154SdelphijASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK]));
210260154Sdelphij
211277585SdelphijASSYM(TF_G0, offsetof(struct trapframe, tf_global[0]));
212277585SdelphijASSYM(TF_G1, offsetof(struct trapframe, tf_global[1]));
213277585SdelphijASSYM(TF_G2, offsetof(struct trapframe, tf_global[2]));
214260154SdelphijASSYM(TF_G3, offsetof(struct trapframe, tf_global[3]));
215277585SdelphijASSYM(TF_G4, offsetof(struct trapframe, tf_global[4]));
216260154SdelphijASSYM(TF_G5, offsetof(struct trapframe, tf_global[5]));
217260154SdelphijASSYM(TF_G6, offsetof(struct trapframe, tf_global[6]));
218260154SdelphijASSYM(TF_G7, offsetof(struct trapframe, tf_global[7]));
219260154SdelphijASSYM(TF_O0, offsetof(struct trapframe, tf_out[0]));
220260154SdelphijASSYM(TF_O1, offsetof(struct trapframe, tf_out[1]));
221260154SdelphijASSYM(TF_O2, offsetof(struct trapframe, tf_out[2]));
222260154SdelphijASSYM(TF_O3, offsetof(struct trapframe, tf_out[3]));
223260154SdelphijASSYM(TF_O4, offsetof(struct trapframe, tf_out[4]));
224260154SdelphijASSYM(TF_O5, offsetof(struct trapframe, tf_out[5]));
225260154SdelphijASSYM(TF_O6, offsetof(struct trapframe, tf_out[6]));
226260154SdelphijASSYM(TF_O7, offsetof(struct trapframe, tf_out[7]));
227260154SdelphijASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs));
228260154SdelphijASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr));
229260154SdelphijASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr));
230260154SdelphijASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
231260154SdelphijASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level));
232260154SdelphijASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar));
233260154SdelphijASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr));
234260154SdelphijASSYM(TF_TAR, offsetof(struct trapframe, tf_tar));
235260154SdelphijASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
236260154SdelphijASSYM(TF_Y, offsetof(struct trapframe, tf_y));
237260154SdelphijASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
238260154SdelphijASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc));
239260154SdelphijASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
240260154SdelphijASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
241260154SdelphijASSYM(TF_SIZEOF, sizeof(struct trapframe));
242260154Sdelphij
243260154SdelphijASSYM(VM_MIN_DIRECT_ADDRESS, VM_MIN_DIRECT_ADDRESS);
244260154SdelphijASSYM(VM_MIN_PROM_ADDRESS, VM_MIN_PROM_ADDRESS);
245260154SdelphijASSYM(VM_MAX_PROM_ADDRESS, VM_MAX_PROM_ADDRESS);
246260154Sdelphij