genassym.c revision 225900
180709Sjake/*-
280709Sjake * Copyright (c) 2001 Jake Burkholder.
380709Sjake * All rights reserved.
480709Sjake *
580709Sjake * Redistribution and use in source and binary forms, with or without
680709Sjake * modification, are permitted provided that the following conditions
780709Sjake * are met:
880709Sjake * 1. Redistributions of source code must retain the above copyright
980709Sjake *    notice, this list of conditions and the following disclaimer.
1080709Sjake * 2. Redistributions in binary form must reproduce the above copyright
1180709Sjake *    notice, this list of conditions and the following disclaimer in the
1280709Sjake *    documentation and/or other materials provided with the distribution.
1380709Sjake *
1481337Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1580709Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1680709Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1781337Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1880709Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1980709Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2080709Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2180709Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2280709Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2380709Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2480709Sjake * SUCH DAMAGE.
2580709Sjake *
2680709Sjake *	from: @(#)genassym.c	5.11 (Berkeley) 5/10/91
2780709Sjake */
2880709Sjake
29145153Smarius#include <sys/cdefs.h>
30145153Smarius__FBSDID("$FreeBSD: head/sys/sparc64/sparc64/genassym.c 225900 2011-10-01 13:16:01Z marius $");
31145153Smarius
32118239Speter#include "opt_kstack_pages.h"
33118239Speter
3480709Sjake#include <sys/param.h>
3580709Sjake#include <sys/assym.h>
3682910Sjake#include <sys/ktr.h>
3780709Sjake#include <sys/proc.h>
3891783Sjake#include <sys/smp.h>
3984186Sjake#include <sys/vmmeter.h>
40222813Sattilio#include <sys/_cpuset.h>
4180709Sjake
4280709Sjake#include <vm/vm.h>
4381381Sjake#include <vm/vm_page.h>
4481381Sjake#include <vm/vm_map.h>
4580709Sjake
4697001Sjake#include <machine/cache.h>
4780709Sjake#include <machine/pcb.h>
4880709Sjake#include <machine/setjmp.h>
4989052Sjake#include <machine/smp.h>
50166105Smarius#include <machine/tlb.h>
5180709Sjake#include <machine/tte.h>
52166105Smarius#include <machine/vmparam.h>
5380709Sjake
5483756SjakeASSYM(KERNBASE, KERNBASE);
5583756Sjake
5683366SjulianASSYM(KSTACK_PAGES, KSTACK_PAGES);
5791360SjakeASSYM(PCPU_PAGES, PCPU_PAGES);
5880709Sjake
5991224SjakeASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT);
6091224Sjake
61222813SattilioASSYM(_NCPUBITS, _NCPUBITS);
62222813Sattilio
63182768SmariusASSYM(TLB_DEMAP_ALL, TLB_DEMAP_ALL);
64182768SmariusASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT);
6581381SjakeASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS);
66182768SmariusASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE);
6791783SjakeASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY);
6881381Sjake
6991336SjakeASSYM(INT_SHIFT, INT_SHIFT);
7091336SjakeASSYM(PTR_SHIFT, PTR_SHIFT);
7191336Sjake
7280709SjakeASSYM(PAGE_SHIFT, PAGE_SHIFT);
73102040SjakeASSYM(PAGE_SHIFT_8K, PAGE_SHIFT_8K);
74102040SjakeASSYM(PAGE_SHIFT_4M, PAGE_SHIFT_4M);
75102040SjakeASSYM(PAGE_SIZE, PAGE_SIZE);
76163146SkmacyASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M);
7780709Sjake
78183142Smarius#ifdef SMP
7991783SjakeASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu));
8089052SjakeASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state));
81182730SmariusASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid));
82182730SmariusASSYM(CSA_STICK, offsetof(struct cpu_start_args, csa_stick));
8391617SjakeASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick));
84182730SmariusASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes));
8591617SjakeASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver));
86166105Smarius#endif
8797001Sjake
8897001SjakeASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size));
8997001SjakeASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize));
9097001SjakeASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size));
9197001SjakeASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize));
9297001Sjake
9382910SjakeASSYM(KTR_SIZEOF, sizeof(struct ktr_entry));
9493949SjakeASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line));
9593949SjakeASSYM(KTR_FILE, offsetof(struct ktr_entry, ktr_file));
9682910SjakeASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc));
9792199SjakeASSYM(KTR_CPU, offsetof(struct ktr_entry, ktr_cpu));
9893503SjakeASSYM(KTR_TIMESTAMP, offsetof(struct ktr_entry, ktr_timestamp));
9993503SjakeASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parms[0]));
10093503SjakeASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parms[1]));
10193503SjakeASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parms[2]));
10293503SjakeASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parms[3]));
10393503SjakeASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4]));
10493503SjakeASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5]));
10582910Sjake
106163146SkmacyASSYM(TTE_SHIFT, TTE_SHIFT);
10791224SjakeASSYM(TTE_VPN, offsetof(struct tte, tte_vpn));
10880709SjakeASSYM(TTE_DATA, offsetof(struct tte, tte_data));
10980709Sjake
110182916SmariusASSYM(TD_V, TD_V);
11181614SjakeASSYM(TD_EXEC, TD_EXEC);
11280709SjakeASSYM(TD_REF, TD_REF);
11388657SjakeASSYM(TD_SW, TD_SW);
114182916SmariusASSYM(TD_L, TD_L);
115100771SjakeASSYM(TD_CP, TD_CP);
116100771SjakeASSYM(TD_CV, TD_CV);
11780709SjakeASSYM(TD_W, TD_W);
11880709Sjake
119102040SjakeASSYM(TS_MIN, TS_MIN);
120102040SjakeASSYM(TS_MAX, TS_MAX);
121182916SmariusASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT);
122205258SmariusASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MASK);
123216803SmariusASSYM(TLB_DIRECT_ADDRESS_MASK, TLB_DIRECT_ADDRESS_MASK);
124163146SkmacyASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK);
125102040SjakeASSYM(TV_SIZE_BITS, TV_SIZE_BITS);
126166105Smarius
12784186SjakeASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
12884186Sjake
129210176SmavASSYM(MAXCOMLEN, MAXCOMLEN);
13087702SjhbASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
13187702SjhbASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
13287702SjhbASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
13397265SjakeASSYM(PC_IRHEAD, offsetof(struct pcpu, pc_irhead));
13497265SjakeASSYM(PC_IRTAIL, offsetof(struct pcpu, pc_irtail));
13597265SjakeASSYM(PC_IRFREE, offsetof(struct pcpu, pc_irfree));
136163146SkmacyASSYM(PC_CNT, offsetof(struct pcpu, pc_cnt));
137163146SkmacyASSYM(PC_SIZEOF, sizeof(struct pcpu));
138163146Skmacy
139182689SmariusASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache));
14089052SjakeASSYM(PC_MID, offsetof(struct pcpu, pc_mid));
141182689SmariusASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap));
14291613SjakeASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
14391613SjakeASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
14491613SjakeASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min));
14580709Sjake
14697265SjakeASSYM(IR_NEXT, offsetof(struct intr_request, ir_next));
14797265SjakeASSYM(IR_FUNC, offsetof(struct intr_request, ir_func));
14897265SjakeASSYM(IR_ARG, offsetof(struct intr_request, ir_arg));
14997265SjakeASSYM(IR_PRI, offsetof(struct intr_request, ir_pri));
15097265SjakeASSYM(IR_VEC, offsetof(struct intr_request, ir_vec));
15181614Sjake
152225900Smarius#ifdef SMP
153211073SmariusASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa));
154211073Smarius
155211071SmariusASSYM(IRA_MASK, offsetof(struct ipi_rd_args, ira_mask));
156211071SmariusASSYM(IRA_VAL, offsetof(struct ipi_rd_args, ira_val));
157211071Smarius
15892199SjakeASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask));
15991783SjakeASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap));
16089052SjakeASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));
16189052SjakeASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end));
16289052SjakeASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va));
163183142Smarius#endif
16489052Sjake
16581614SjakeASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
16681614SjakeASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
16781614SjakeASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
16881614Sjake
169111032SjulianASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
170111032SjulianASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
17182910Sjake
17288788SjakeASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap));
17388788Sjake
17482910SjakeASSYM(P_COMM, offsetof(struct proc, p_comm));
17588657SjakeASSYM(P_MD, offsetof(struct proc, p_md));
17688657SjakeASSYM(P_PID, offsetof(struct proc, p_pid));
17780709SjakeASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
17880709Sjake
179111032SjulianASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
18083366SjulianASSYM(TD_FRAME, offsetof(struct thread, td_frame));
18183366SjulianASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
182203185SmariusASSYM(TD_LOCK, offsetof(struct thread, td_lock));
18383366SjulianASSYM(TD_PCB, offsetof(struct thread, td_pcb));
18483366SjulianASSYM(TD_PROC, offsetof(struct thread, td_proc));
185163146SkmacyASSYM(TD_MD, offsetof(struct thread, td_md));
186163146SkmacyASSYM(MD_SAVED_PIL, offsetof(struct mdthread, md_saved_pil));
18783366Sjulian
18884186SjakeASSYM(PCB_SIZEOF, sizeof(struct pcb));
189113023SjakeASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
190113023SjakeASSYM(PCB_KFP, offsetof(struct pcb, pcb_kfp));
191112920SjakeASSYM(PCB_UFP, offsetof(struct pcb, pcb_ufp));
192113023SjakeASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
193112924SjakeASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
19482910SjakeASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
195113023SjakeASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
196113023SjakeASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
197163965SkmacyASSYM(PCB_PAD, offsetof(struct pcb, pcb_pad));
198163146Skmacy
19981381SjakeASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
20088657SjakeASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
20181381SjakeASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
20288657SjakeASSYM(PM_TSB, offsetof(struct pmap, pm_tsb));
20381381Sjake
20488657SjakeASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP]));
20588657SjakeASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC]));
20688657SjakeASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP]));
20788657SjakeASSYM(_JB_SIGFLAG, offsetof(struct _jmp_buf, _jb[_JB_SIGFLAG]));
20888657SjakeASSYM(_JB_SIGMASK, offsetof(struct _jmp_buf, _jb[_JB_SIGMASK]));
20980709Sjake
21080709SjakeASSYM(TF_G0, offsetof(struct trapframe, tf_global[0]));
21180709SjakeASSYM(TF_G1, offsetof(struct trapframe, tf_global[1]));
21280709SjakeASSYM(TF_G2, offsetof(struct trapframe, tf_global[2]));
21380709SjakeASSYM(TF_G3, offsetof(struct trapframe, tf_global[3]));
21480709SjakeASSYM(TF_G4, offsetof(struct trapframe, tf_global[4]));
21580709SjakeASSYM(TF_G5, offsetof(struct trapframe, tf_global[5]));
21680709SjakeASSYM(TF_G6, offsetof(struct trapframe, tf_global[6]));
21780709SjakeASSYM(TF_G7, offsetof(struct trapframe, tf_global[7]));
21880709SjakeASSYM(TF_O0, offsetof(struct trapframe, tf_out[0]));
21980709SjakeASSYM(TF_O1, offsetof(struct trapframe, tf_out[1]));
22080709SjakeASSYM(TF_O2, offsetof(struct trapframe, tf_out[2]));
22180709SjakeASSYM(TF_O3, offsetof(struct trapframe, tf_out[3]));
22280709SjakeASSYM(TF_O4, offsetof(struct trapframe, tf_out[4]));
22380709SjakeASSYM(TF_O5, offsetof(struct trapframe, tf_out[5]));
22480709SjakeASSYM(TF_O6, offsetof(struct trapframe, tf_out[6]));
22580709SjakeASSYM(TF_O7, offsetof(struct trapframe, tf_out[7]));
226105733SjakeASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs));
22788657SjakeASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr));
228105733SjakeASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr));
229163146SkmacyASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
230105733SjakeASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level));
23188657SjakeASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar));
232105733SjakeASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr));
23388657SjakeASSYM(TF_TAR, offsetof(struct trapframe, tf_tar));
234163152SkmacyASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
235163152SkmacyASSYM(TF_Y, offsetof(struct trapframe, tf_y));
23688657SjakeASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
23788657SjakeASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc));
23880709SjakeASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
23982910SjakeASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
24080709SjakeASSYM(TF_SIZEOF, sizeof(struct trapframe));
24188788Sjake
242163146SkmacyASSYM(VM_MIN_DIRECT_ADDRESS, VM_MIN_DIRECT_ADDRESS);
243163146SkmacyASSYM(VM_MIN_PROM_ADDRESS, VM_MIN_PROM_ADDRESS);
244163146SkmacyASSYM(VM_MAX_PROM_ADDRESS, VM_MAX_PROM_ADDRESS);
245