Kind of sync makewhatis.local with FreeBSD. Ignore r/o directories.
[dragonfly.git] / sys / platform / pc64 / x86_64 / genassym.c
CommitLineData
d7f50089
YY
1/*-
2 * Copyright (c) 1982, 1990 The Regents of the University of California.
c8fe38ae 3 * Copyright (c) 2008 The DragonFly Project.
d7f50089
YY
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * William Jolitz.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
2c64e990 17 * 3. Neither the name of the University nor the names of its contributors
d7f50089
YY
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
34 * $FreeBSD: src/sys/i386/i386/genassym.c,v 1.86.2.3 2002/03/03 05:42:49 nyan Exp $
d7f50089
YY
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/assym.h>
40#include <sys/interrupt.h>
41#include <sys/buf.h>
42#include <sys/proc.h>
43#include <sys/errno.h>
44#include <sys/mount.h>
45#include <sys/socket.h>
46#include <sys/lock.h>
47#include <sys/resourcevar.h>
48#include <machine/frame.h>
49#include <machine/bootinfo.h>
50#include <machine/tss.h>
51#include <sys/vmmeter.h>
52#include <sys/machintr.h>
53#include <vm/vm.h>
54#include <vm/vm_param.h>
55#include <vm/pmap.h>
56#include <vm/vm_map.h>
57#include <net/if.h>
58#include <netinet/in.h>
59#include <vfs/nfs/nfsv2.h>
60#include <vfs/nfs/rpcv2.h>
61#include <vfs/nfs/nfs.h>
62#include <vfs/nfs/nfsdiskless.h>
63
46d4e165 64#include <machine_base/apic/apicreg.h>
566d27d4 65#include <machine_base/apic/ioapic_abi.h>
d7f50089
YY
66#include <machine/segments.h>
67#include <machine/sigframe.h>
68#include <machine/globaldata.h>
c8fe38ae 69#include <machine/specialreg.h>
d7f50089 70#include <machine/pcb.h>
c2fb025d 71#include <machine/pmap.h>
d7f50089
YY
72
73ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
74ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
75ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
cc694a4a 76ASSYM(PM_ACTIVE_LOCK, offsetof(struct pmap, pm_active_lock));
d7f50089 77
c8fe38ae 78ASSYM(LWP_VMSPACE, offsetof(struct lwp, lwp_vmspace));
46d4e165
JG
79ASSYM(V_IPI, offsetof(struct vmmeter, v_ipi));
80ASSYM(V_TIMER, offsetof(struct vmmeter, v_timer));
d7f50089
YY
81ASSYM(UPAGES, UPAGES);
82ASSYM(PAGE_SIZE, PAGE_SIZE);
83ASSYM(NPTEPG, NPTEPG);
84ASSYM(NPDEPG, NPDEPG);
85ASSYM(PDESIZE, PDESIZE);
86ASSYM(PTESIZE, PTESIZE);
87ASSYM(PAGE_SHIFT, PAGE_SHIFT);
88ASSYM(PAGE_MASK, PAGE_MASK);
89ASSYM(PDRSHIFT, PDRSHIFT);
90ASSYM(USRSTACK, USRSTACK);
91ASSYM(KERNBASE, KERNBASE);
92
c8fe38ae
MD
93ASSYM(V_TRAP, offsetof(struct vmmeter, v_trap));
94ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall));
c8fe38ae 95ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
c8fe38ae 96
d7f50089
YY
97ASSYM(MAXCOMLEN, MAXCOMLEN);
98ASSYM(EFAULT, EFAULT);
99ASSYM(ENAMETOOLONG, ENAMETOOLONG);
48ffc236 100ASSYM(VM_MAX_USER_ADDRESS, VM_MAX_USER_ADDRESS);
c8fe38ae 101
d7f50089 102ASSYM(GD_CURTHREAD, offsetof(struct mdglobaldata, mi.gd_curthread));
c8fe38ae
MD
103ASSYM(GD_CNT, offsetof(struct mdglobaldata, mi.gd_cnt));
104ASSYM(GD_CPUID, offsetof(struct mdglobaldata, mi.gd_cpuid));
c2fb025d 105ASSYM(GD_CPUMASK, offsetof(struct mdglobaldata, mi.gd_cpumask));
e47e3dba 106ASSYM(GD_NPOLL, offsetof(struct mdglobaldata, mi.gd_npoll));
433c75c3 107ASSYM(GD_SAMPLE_PC, offsetof(struct mdglobaldata, mi.gd_sample_pc));
e32d3244 108ASSYM(GD_SAMPLE_SP, offsetof(struct mdglobaldata, mi.gd_sample_sp));
ee89e80b
MD
109ASSYM(GD_CPUMASK_SIMPLE, offsetof(struct mdglobaldata, mi.gd_cpumask_simple));
110ASSYM(GD_CPUMASK_OFFSET, offsetof(struct mdglobaldata, mi.gd_cpumask_offset));
30c6fbb5 111ASSYM(GD_IRESERVED, offsetof(struct mdglobaldata, mi.gd_ireserved[0]));
c8fe38ae 112
4611d87f 113ASSYM(PCB_CR3_ISO, offsetof(struct pcb, pcb_cr3_iso));
c8fe38ae
MD
114ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3));
115ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15));
116ASSYM(PCB_R14, offsetof(struct pcb, pcb_r14));
117ASSYM(PCB_R13, offsetof(struct pcb, pcb_r13));
118ASSYM(PCB_R12, offsetof(struct pcb, pcb_r12));
119ASSYM(PCB_RSI, offsetof(struct pcb, pcb_rsi));
120ASSYM(PCB_RBP, offsetof(struct pcb, pcb_rbp));
121ASSYM(PCB_RSP, offsetof(struct pcb, pcb_rsp));
122ASSYM(PCB_RBX, offsetof(struct pcb, pcb_rbx));
123ASSYM(PCB_RIP, offsetof(struct pcb, pcb_rip));
b2b3ffcd 124ASSYM(TSS_RSP0, offsetof(struct x86_64tss, tss_rsp0));
0855a2af
JG
125
126ASSYM(PCB_DR0, offsetof(struct pcb, pcb_dr0));
127ASSYM(PCB_DR1, offsetof(struct pcb, pcb_dr1));
128ASSYM(PCB_DR2, offsetof(struct pcb, pcb_dr2));
129ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3));
130ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6));
131ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7));
4611d87f 132
0855a2af 133ASSYM(PCB_DBREGS, PCB_DBREGS);
4611d87f 134ASSYM(PCB_ISOMMU, PCB_ISOMMU);
375bb03e
MD
135
136#if 0 /* we get this from specialreg.h */
137ASSYM(SPEC_CTRL_IBRS, SPEC_CTRL_IBRS);
138ASSYM(SPEC_CTRL_STIBP, SPEC_CTRL_STIBP);
139#endif
140ASSYM(SPEC_CTRL_DUMMY_IBPB, SPEC_CTRL_DUMMY_IBPB);
141ASSYM(SPEC_CTRL_DUMMY_ENABLE, SPEC_CTRL_DUMMY_ENABLE);
4611d87f 142
c8fe38ae 143ASSYM(PCB_EXT, offsetof(struct pcb, pcb_ext));
c8fe38ae 144ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
d7f50089 145ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
93ad6da2 146ASSYM(PCB_ONFAULT_SP, offsetof(struct pcb, pcb_onfault_sp));
c8fe38ae
MD
147ASSYM(PCB_FSBASE, offsetof(struct pcb, pcb_fsbase));
148ASSYM(PCB_GSBASE, offsetof(struct pcb, pcb_gsbase));
c4f8086e 149ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save));
c8fe38ae 150
46d4e165 151ASSYM(PCB_SIZE, sizeof(struct pcb));
c4f8086e 152ASSYM(PCB_SAVEFPU_SIZE, sizeof(union savefpu));
46d4e165 153
c8fe38ae
MD
154ASSYM(TF_R15, offsetof(struct trapframe, tf_r15));
155ASSYM(TF_R14, offsetof(struct trapframe, tf_r14));
156ASSYM(TF_R13, offsetof(struct trapframe, tf_r13));
157ASSYM(TF_R12, offsetof(struct trapframe, tf_r12));
158ASSYM(TF_R11, offsetof(struct trapframe, tf_r11));
159ASSYM(TF_R10, offsetof(struct trapframe, tf_r10));
160ASSYM(TF_R9, offsetof(struct trapframe, tf_r9));
161ASSYM(TF_R8, offsetof(struct trapframe, tf_r8));
162ASSYM(TF_RDI, offsetof(struct trapframe, tf_rdi));
163ASSYM(TF_RSI, offsetof(struct trapframe, tf_rsi));
164ASSYM(TF_RBP, offsetof(struct trapframe, tf_rbp));
165ASSYM(TF_RBX, offsetof(struct trapframe, tf_rbx));
166ASSYM(TF_RDX, offsetof(struct trapframe, tf_rdx));
167ASSYM(TF_RCX, offsetof(struct trapframe, tf_rcx));
168ASSYM(TF_RAX, offsetof(struct trapframe, tf_rax));
169
170ASSYM(TF_TRAPNO, offsetof(struct trapframe, tf_trapno));
5b9f6cc4 171ASSYM(TF_XFLAGS, offsetof(struct trapframe, tf_xflags));
c8fe38ae
MD
172ASSYM(TF_ADDR, offsetof(struct trapframe, tf_addr));
173ASSYM(TF_ERR, offsetof(struct trapframe, tf_err));
174ASSYM(TF_FLAGS, offsetof(struct trapframe, tf_flags));
175
176ASSYM(TF_RIP, offsetof(struct trapframe, tf_rip));
177ASSYM(TF_CS, offsetof(struct trapframe, tf_cs));
178ASSYM(TF_RFLAGS, offsetof(struct trapframe, tf_rflags));
179ASSYM(TF_RSP, offsetof(struct trapframe, tf_rsp));
180ASSYM(TF_SS, offsetof(struct trapframe, tf_ss));
181ASSYM(TF_SIZE, sizeof(struct trapframe));
d7f50089
YY
182
183ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler));
184ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
185
c8fe38ae
MD
186ASSYM(TD_PROC, offsetof(struct thread, td_proc));
187ASSYM(TD_LWP, offsetof(struct thread, td_lwp));
188ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
189ASSYM(TD_SP, offsetof(struct thread, td_sp));
190ASSYM(TD_PRI, offsetof(struct thread, td_pri));
f9235b6d 191ASSYM(TD_CRITCOUNT, offsetof(struct thread, td_critcount));
c8fe38ae
MD
192ASSYM(TD_MACH, offsetof(struct thread, td_mach));
193ASSYM(TD_WCHAN, offsetof(struct thread, td_wchan));
194ASSYM(TD_NEST_COUNT, offsetof(struct thread, td_nest_count));
c8fe38ae 195ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
a86ce0cd 196ASSYM(TD_TYPE, offsetof(struct thread, td_type));
ee89e80b 197ASSYM(TD_PREEMPTED, offsetof(struct thread, td_preempted));
e5aace14 198ASSYM(TD_FPU_HEUR, offsetof(struct thread, td_fpu_heur));
a86ce0cd 199
c4f8086e 200ASSYM(TD_SAVEFPU, offsetof(struct thread, td_savefpu));
c8fe38ae
MD
201ASSYM(TDF_RUNNING, TDF_RUNNING);
202ASSYM(TDF_USINGFP, TDF_USINGFP);
203ASSYM(TDF_KERNELFP, TDF_KERNELFP);
ee89e80b 204ASSYM(TDF_PREEMPT_DONE, TDF_PREEMPT_DONE);
e5aace14 205ASSYM(TDF_FPU_HEUR, TDF_FPU_HEUR);
c8fe38ae
MD
206
207ASSYM(FIRST_SOFTINT, FIRST_SOFTINT);
208ASSYM(MDGLOBALDATA_BASEALLOC_PAGES, MDGLOBALDATA_BASEALLOC_PAGES);
209
210ASSYM(GD_PRIVATE_TSS, offsetof(struct mdglobaldata, gd_private_tss));
9e24b495 211ASSYM(GD_COMMON_TSS, offsetof(struct privatespace, common_tss));
4611d87f 212ASSYM(GD_TRAMPOLINE, offsetof(struct privatespace, trampoline));
c693df0e
MD
213ASSYM(GD_DEBUG1, offsetof(struct mdglobaldata, mi.gd_debug1));
214ASSYM(GD_DEBUG2, offsetof(struct mdglobaldata, mi.gd_debug2));
c8fe38ae
MD
215ASSYM(GD_USER_FS, offsetof(struct mdglobaldata, gd_user_fs));
216ASSYM(GD_USER_GS, offsetof(struct mdglobaldata, gd_user_gs));
217ASSYM(GD_INTR_NESTING_LEVEL, offsetof(struct mdglobaldata, mi.gd_intr_nesting_level));
218
4611d87f 219ASSYM(TR_CR2, offsetof(struct trampframe, tr_cr2));
8ed06571
MD
220ASSYM(TR_RAX, offsetof(struct trampframe, tr_rax));
221ASSYM(TR_RCX, offsetof(struct trampframe, tr_rcx));
222ASSYM(TR_RDX, offsetof(struct trampframe, tr_rdx));
4611d87f
MD
223ASSYM(TR_ERR, offsetof(struct trampframe, tr_err));
224ASSYM(TR_RIP, offsetof(struct trampframe, tr_rip));
225ASSYM(TR_CS, offsetof(struct trampframe, tr_cs));
226ASSYM(TR_RFLAGS, offsetof(struct trampframe, tr_rflags));
227ASSYM(TR_RSP, offsetof(struct trampframe, tr_rsp));
228ASSYM(TR_SS, offsetof(struct trampframe, tr_ss));
fc921477
MD
229ASSYM(TR_PCB_RSP, offsetof(struct trampframe, tr_pcb_rsp));
230ASSYM(TR_PCB_FLAGS, offsetof(struct trampframe, tr_pcb_flags));
231ASSYM(TR_PCB_CR3_ISO, offsetof(struct trampframe, tr_pcb_cr3_iso));
232ASSYM(TR_PCB_CR3, offsetof(struct trampframe, tr_pcb_cr3));
375bb03e 233ASSYM(TR_PCB_SPEC_CTRL, offsetof(struct trampframe, tr_pcb_spec_ctrl[0]));
85b33048
MD
234ASSYM(TR_PCB_GS_KERNEL, offsetof(struct trampframe, tr_pcb_gs_kernel));
235ASSYM(TR_PCB_GS_SAVED, offsetof(struct trampframe, tr_pcb_gs_saved));
236ASSYM(TR_PCB_CR3_SAVED, offsetof(struct trampframe, tr_pcb_cr3_saved));
4611d87f 237
9611ff20 238ASSYM(GD_IPENDING, offsetof(struct mdglobaldata, gd_ipending));
c8fe38ae 239ASSYM(GD_SPENDING, offsetof(struct mdglobaldata, gd_spending));
c8fe38ae
MD
240ASSYM(GD_COMMON_TSSD, offsetof(struct mdglobaldata, gd_common_tssd));
241ASSYM(GD_TSS_GDT, offsetof(struct mdglobaldata, gd_tss_gdt));
242ASSYM(GD_NPXTHREAD, offsetof(struct mdglobaldata, gd_npxthread));
243ASSYM(GD_FPU_LOCK, offsetof(struct mdglobaldata, gd_fpu_lock));
244ASSYM(GD_SAVEFPU, offsetof(struct mdglobaldata, gd_savefpu));
da23a592 245ASSYM(GD_OTHER_CPUS, offsetof(struct mdglobaldata, mi.gd_other_cpus));
c8fe38ae
MD
246ASSYM(GD_SS_EFLAGS, offsetof(struct mdglobaldata, gd_ss_eflags));
247ASSYM(GD_REQFLAGS, offsetof(struct mdglobaldata, mi.gd_reqflags));
248
249ASSYM(RQF_IPIQ, RQF_IPIQ);
250ASSYM(RQF_INTPEND, RQF_INTPEND);
251ASSYM(RQF_AST_OWEUPC, RQF_AST_OWEUPC);
252ASSYM(RQF_AST_SIGNAL, RQF_AST_SIGNAL);
253ASSYM(RQF_AST_USER_RESCHED, RQF_AST_USER_RESCHED);
254ASSYM(RQF_AST_LWKT_RESCHED, RQF_AST_LWKT_RESCHED);
46d4e165 255ASSYM(RQF_TIMER, RQF_TIMER);
c8fe38ae 256ASSYM(RQF_AST_MASK, RQF_AST_MASK);
f2081646 257ASSYM(RQF_QUICKRET, RQF_QUICKRET);
c8fe38ae 258
d7f50089
YY
259ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL));
260ASSYM(KDSEL, GSEL(GDATA_SEL, SEL_KPL));
c8fe38ae
MD
261ASSYM(KUCSEL, GSEL(GUCODE_SEL, SEL_UPL));
262ASSYM(KUDSEL, GSEL(GUDATA_SEL, SEL_UPL));
bfc09ba0 263/*ASSYM(SEL_RPL_MASK, SEL_RPL_MASK);*/
d7f50089 264
c8fe38ae
MD
265ASSYM(MSR_GSBASE, MSR_GSBASE);
266ASSYM(MSR_KGSBASE, MSR_KGSBASE);
267ASSYM(MSR_FSBASE, MSR_FSBASE);
268
35b2edcb 269ASSYM(MACHINTR_INTREN, offsetof(struct machintr_abi, intr_enable));
d7f50089 270
d7f50089 271ASSYM(TDPRI_INT_SUPPORT, TDPRI_INT_SUPPORT);
cc694a4a
MD
272ASSYM(CPULOCK_EXCLBIT, CPULOCK_EXCLBIT);
273ASSYM(CPULOCK_EXCL, CPULOCK_EXCL);
274ASSYM(CPULOCK_INCR, CPULOCK_INCR);
275ASSYM(CPULOCK_CNTMASK, CPULOCK_CNTMASK);
46d4e165 276
06c66eb2
MD
277ASSYM(CPUMASK_ELEMENTS, CPUMASK_ELEMENTS);
278
5ac5ccd2
SZ
279ASSYM(IOAPIC_IRQI_ADDR, offsetof(struct ioapic_irqinfo, io_addr));
280ASSYM(IOAPIC_IRQI_IDX, offsetof(struct ioapic_irqinfo, io_idx));
281ASSYM(IOAPIC_IRQI_FLAGS, offsetof(struct ioapic_irqinfo, io_flags));
282ASSYM(IOAPIC_IRQI_SIZE, sizeof(struct ioapic_irqinfo));
283ASSYM(IOAPIC_IRQI_SZSHIFT, IOAPIC_IRQI_SZSHIFT);
284ASSYM(IOAPIC_IRQI_FLAG_LEVEL, IOAPIC_IRQI_FLAG_LEVEL);
285ASSYM(IOAPIC_IRQI_FLAG_MASKED, IOAPIC_IRQI_FLAG_MASKED);