netinet{,6}: Assert in{,6}_inithead() are only used for system routing tables.
[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.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
38 * $FreeBSD: src/sys/i386/i386/genassym.c,v 1.86.2.3 2002/03/03 05:42:49 nyan Exp $
d7f50089
YY
39 */
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/assym.h>
44#include <sys/interrupt.h>
45#include <sys/buf.h>
46#include <sys/proc.h>
47#include <sys/errno.h>
48#include <sys/mount.h>
49#include <sys/socket.h>
50#include <sys/lock.h>
51#include <sys/resourcevar.h>
52#include <machine/frame.h>
53#include <machine/bootinfo.h>
54#include <machine/tss.h>
55#include <sys/vmmeter.h>
56#include <sys/machintr.h>
57#include <vm/vm.h>
58#include <vm/vm_param.h>
59#include <vm/pmap.h>
60#include <vm/vm_map.h>
61#include <net/if.h>
62#include <netinet/in.h>
63#include <vfs/nfs/nfsv2.h>
64#include <vfs/nfs/rpcv2.h>
65#include <vfs/nfs/nfs.h>
66#include <vfs/nfs/nfsdiskless.h>
67
46d4e165 68#include <machine_base/apic/apicreg.h>
566d27d4 69#include <machine_base/apic/ioapic_abi.h>
d7f50089
YY
70#include <machine/segments.h>
71#include <machine/sigframe.h>
72#include <machine/globaldata.h>
c8fe38ae 73#include <machine/specialreg.h>
d7f50089 74#include <machine/pcb.h>
c2fb025d 75#include <machine/pmap.h>
d7f50089
YY
76
77ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
78ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
79ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
cc694a4a 80ASSYM(PM_ACTIVE_LOCK, offsetof(struct pmap, pm_active_lock));
d7f50089 81
c8fe38ae 82ASSYM(LWP_VMSPACE, offsetof(struct lwp, lwp_vmspace));
46d4e165
JG
83ASSYM(V_IPI, offsetof(struct vmmeter, v_ipi));
84ASSYM(V_TIMER, offsetof(struct vmmeter, v_timer));
d7f50089
YY
85ASSYM(UPAGES, UPAGES);
86ASSYM(PAGE_SIZE, PAGE_SIZE);
87ASSYM(NPTEPG, NPTEPG);
88ASSYM(NPDEPG, NPDEPG);
89ASSYM(PDESIZE, PDESIZE);
90ASSYM(PTESIZE, PTESIZE);
91ASSYM(PAGE_SHIFT, PAGE_SHIFT);
92ASSYM(PAGE_MASK, PAGE_MASK);
93ASSYM(PDRSHIFT, PDRSHIFT);
94ASSYM(USRSTACK, USRSTACK);
95ASSYM(KERNBASE, KERNBASE);
96
c8fe38ae
MD
97ASSYM(V_TRAP, offsetof(struct vmmeter, v_trap));
98ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall));
99ASSYM(V_SENDSYS, offsetof(struct vmmeter, v_sendsys));
100ASSYM(V_WAITSYS, offsetof(struct vmmeter, v_waitsys));
101ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
102ASSYM(V_FORWARDED_INTS, offsetof(struct vmmeter, v_forwarded_ints));
103ASSYM(V_FORWARDED_HITS, offsetof(struct vmmeter, v_forwarded_hits));
104ASSYM(V_FORWARDED_MISSES, offsetof(struct vmmeter, v_forwarded_misses));
105
d7f50089
YY
106ASSYM(MAXCOMLEN, MAXCOMLEN);
107ASSYM(EFAULT, EFAULT);
108ASSYM(ENAMETOOLONG, ENAMETOOLONG);
48ffc236 109ASSYM(VM_MAX_USER_ADDRESS, VM_MAX_USER_ADDRESS);
c8fe38ae 110
d7f50089 111ASSYM(GD_CURTHREAD, offsetof(struct mdglobaldata, mi.gd_curthread));
c8fe38ae
MD
112ASSYM(GD_CNT, offsetof(struct mdglobaldata, mi.gd_cnt));
113ASSYM(GD_CPUID, offsetof(struct mdglobaldata, mi.gd_cpuid));
c2fb025d 114ASSYM(GD_CPUMASK, offsetof(struct mdglobaldata, mi.gd_cpumask));
433c75c3 115ASSYM(GD_SAMPLE_PC, offsetof(struct mdglobaldata, mi.gd_sample_pc));
c8fe38ae
MD
116
117ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3));
118ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15));
119ASSYM(PCB_R14, offsetof(struct pcb, pcb_r14));
120ASSYM(PCB_R13, offsetof(struct pcb, pcb_r13));
121ASSYM(PCB_R12, offsetof(struct pcb, pcb_r12));
122ASSYM(PCB_RSI, offsetof(struct pcb, pcb_rsi));
123ASSYM(PCB_RBP, offsetof(struct pcb, pcb_rbp));
124ASSYM(PCB_RSP, offsetof(struct pcb, pcb_rsp));
125ASSYM(PCB_RBX, offsetof(struct pcb, pcb_rbx));
126ASSYM(PCB_RIP, offsetof(struct pcb, pcb_rip));
b2b3ffcd 127ASSYM(TSS_RSP0, offsetof(struct x86_64tss, tss_rsp0));
0855a2af
JG
128
129ASSYM(PCB_DR0, offsetof(struct pcb, pcb_dr0));
130ASSYM(PCB_DR1, offsetof(struct pcb, pcb_dr1));
131ASSYM(PCB_DR2, offsetof(struct pcb, pcb_dr2));
132ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3));
133ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6));
134ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7));
135ASSYM(PCB_DBREGS, PCB_DBREGS);
c8fe38ae 136ASSYM(PCB_EXT, offsetof(struct pcb, pcb_ext));
c8fe38ae 137ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
d7f50089 138ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
93ad6da2 139ASSYM(PCB_ONFAULT_SP, offsetof(struct pcb, pcb_onfault_sp));
c8fe38ae
MD
140ASSYM(PCB_FSBASE, offsetof(struct pcb, pcb_fsbase));
141ASSYM(PCB_GSBASE, offsetof(struct pcb, pcb_gsbase));
c4f8086e 142ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save));
c8fe38ae 143
46d4e165 144ASSYM(PCB_SIZE, sizeof(struct pcb));
c4f8086e 145ASSYM(PCB_SAVEFPU_SIZE, sizeof(union savefpu));
46d4e165 146
c8fe38ae
MD
147ASSYM(TF_R15, offsetof(struct trapframe, tf_r15));
148ASSYM(TF_R14, offsetof(struct trapframe, tf_r14));
149ASSYM(TF_R13, offsetof(struct trapframe, tf_r13));
150ASSYM(TF_R12, offsetof(struct trapframe, tf_r12));
151ASSYM(TF_R11, offsetof(struct trapframe, tf_r11));
152ASSYM(TF_R10, offsetof(struct trapframe, tf_r10));
153ASSYM(TF_R9, offsetof(struct trapframe, tf_r9));
154ASSYM(TF_R8, offsetof(struct trapframe, tf_r8));
155ASSYM(TF_RDI, offsetof(struct trapframe, tf_rdi));
156ASSYM(TF_RSI, offsetof(struct trapframe, tf_rsi));
157ASSYM(TF_RBP, offsetof(struct trapframe, tf_rbp));
158ASSYM(TF_RBX, offsetof(struct trapframe, tf_rbx));
159ASSYM(TF_RDX, offsetof(struct trapframe, tf_rdx));
160ASSYM(TF_RCX, offsetof(struct trapframe, tf_rcx));
161ASSYM(TF_RAX, offsetof(struct trapframe, tf_rax));
162
163ASSYM(TF_TRAPNO, offsetof(struct trapframe, tf_trapno));
5b9f6cc4 164ASSYM(TF_XFLAGS, offsetof(struct trapframe, tf_xflags));
c8fe38ae
MD
165ASSYM(TF_ADDR, offsetof(struct trapframe, tf_addr));
166ASSYM(TF_ERR, offsetof(struct trapframe, tf_err));
167ASSYM(TF_FLAGS, offsetof(struct trapframe, tf_flags));
168
169ASSYM(TF_RIP, offsetof(struct trapframe, tf_rip));
170ASSYM(TF_CS, offsetof(struct trapframe, tf_cs));
171ASSYM(TF_RFLAGS, offsetof(struct trapframe, tf_rflags));
172ASSYM(TF_RSP, offsetof(struct trapframe, tf_rsp));
173ASSYM(TF_SS, offsetof(struct trapframe, tf_ss));
174ASSYM(TF_SIZE, sizeof(struct trapframe));
d7f50089
YY
175
176ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler));
177ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
178
c8fe38ae
MD
179ASSYM(TD_PROC, offsetof(struct thread, td_proc));
180ASSYM(TD_LWP, offsetof(struct thread, td_lwp));
181ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
182ASSYM(TD_SP, offsetof(struct thread, td_sp));
183ASSYM(TD_PRI, offsetof(struct thread, td_pri));
f9235b6d 184ASSYM(TD_CRITCOUNT, offsetof(struct thread, td_critcount));
c8fe38ae
MD
185ASSYM(TD_MACH, offsetof(struct thread, td_mach));
186ASSYM(TD_WCHAN, offsetof(struct thread, td_wchan));
187ASSYM(TD_NEST_COUNT, offsetof(struct thread, td_nest_count));
c8fe38ae 188ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
a86ce0cd
MD
189ASSYM(TD_TYPE, offsetof(struct thread, td_type));
190
c4f8086e 191ASSYM(TD_SAVEFPU, offsetof(struct thread, td_savefpu));
c8fe38ae
MD
192ASSYM(TDF_RUNNING, TDF_RUNNING);
193ASSYM(TDF_USINGFP, TDF_USINGFP);
194ASSYM(TDF_KERNELFP, TDF_KERNELFP);
195
196ASSYM(FIRST_SOFTINT, FIRST_SOFTINT);
197ASSYM(MDGLOBALDATA_BASEALLOC_PAGES, MDGLOBALDATA_BASEALLOC_PAGES);
198
199ASSYM(GD_PRIVATE_TSS, offsetof(struct mdglobaldata, gd_private_tss));
200ASSYM(GD_SCRATCH_RSP, offsetof(struct mdglobaldata, gd_scratch_rsp));
c8fe38ae
MD
201ASSYM(GD_USER_FS, offsetof(struct mdglobaldata, gd_user_fs));
202ASSYM(GD_USER_GS, offsetof(struct mdglobaldata, gd_user_gs));
203ASSYM(GD_INTR_NESTING_LEVEL, offsetof(struct mdglobaldata, mi.gd_intr_nesting_level));
204
9611ff20 205ASSYM(GD_IPENDING, offsetof(struct mdglobaldata, gd_ipending));
c8fe38ae
MD
206ASSYM(GD_SPENDING, offsetof(struct mdglobaldata, gd_spending));
207ASSYM(GD_COMMON_TSS, offsetof(struct mdglobaldata, gd_common_tss));
208ASSYM(GD_COMMON_TSSD, offsetof(struct mdglobaldata, gd_common_tssd));
209ASSYM(GD_TSS_GDT, offsetof(struct mdglobaldata, gd_tss_gdt));
210ASSYM(GD_NPXTHREAD, offsetof(struct mdglobaldata, gd_npxthread));
211ASSYM(GD_FPU_LOCK, offsetof(struct mdglobaldata, gd_fpu_lock));
212ASSYM(GD_SAVEFPU, offsetof(struct mdglobaldata, gd_savefpu));
da23a592 213ASSYM(GD_OTHER_CPUS, offsetof(struct mdglobaldata, mi.gd_other_cpus));
c8fe38ae
MD
214ASSYM(GD_SS_EFLAGS, offsetof(struct mdglobaldata, gd_ss_eflags));
215ASSYM(GD_REQFLAGS, offsetof(struct mdglobaldata, mi.gd_reqflags));
216
217ASSYM(RQF_IPIQ, RQF_IPIQ);
218ASSYM(RQF_INTPEND, RQF_INTPEND);
219ASSYM(RQF_AST_OWEUPC, RQF_AST_OWEUPC);
220ASSYM(RQF_AST_SIGNAL, RQF_AST_SIGNAL);
221ASSYM(RQF_AST_USER_RESCHED, RQF_AST_USER_RESCHED);
222ASSYM(RQF_AST_LWKT_RESCHED, RQF_AST_LWKT_RESCHED);
46d4e165 223ASSYM(RQF_TIMER, RQF_TIMER);
c8fe38ae 224ASSYM(RQF_AST_MASK, RQF_AST_MASK);
f2081646 225ASSYM(RQF_QUICKRET, RQF_QUICKRET);
c8fe38ae 226
46d4e165
JG
227ASSYM(LA_EOI, offsetof(struct LAPIC, eoi));
228
d7f50089
YY
229ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL));
230ASSYM(KDSEL, GSEL(GDATA_SEL, SEL_KPL));
c8fe38ae
MD
231ASSYM(KUCSEL, GSEL(GUCODE_SEL, SEL_UPL));
232ASSYM(KUDSEL, GSEL(GUDATA_SEL, SEL_UPL));
bfc09ba0 233/*ASSYM(SEL_RPL_MASK, SEL_RPL_MASK);*/
d7f50089 234
c8fe38ae
MD
235ASSYM(MSR_GSBASE, MSR_GSBASE);
236ASSYM(MSR_KGSBASE, MSR_KGSBASE);
237ASSYM(MSR_FSBASE, MSR_FSBASE);
238
35b2edcb 239ASSYM(MACHINTR_INTREN, offsetof(struct machintr_abi, intr_enable));
d7f50089 240
d7f50089 241ASSYM(TDPRI_INT_SUPPORT, TDPRI_INT_SUPPORT);
cc694a4a
MD
242ASSYM(CPULOCK_EXCLBIT, CPULOCK_EXCLBIT);
243ASSYM(CPULOCK_EXCL, CPULOCK_EXCL);
244ASSYM(CPULOCK_INCR, CPULOCK_INCR);
245ASSYM(CPULOCK_CNTMASK, CPULOCK_CNTMASK);
46d4e165 246
06c66eb2
MD
247ASSYM(CPUMASK_ELEMENTS, CPUMASK_ELEMENTS);
248
5ac5ccd2
SZ
249ASSYM(IOAPIC_IRQI_ADDR, offsetof(struct ioapic_irqinfo, io_addr));
250ASSYM(IOAPIC_IRQI_IDX, offsetof(struct ioapic_irqinfo, io_idx));
251ASSYM(IOAPIC_IRQI_FLAGS, offsetof(struct ioapic_irqinfo, io_flags));
252ASSYM(IOAPIC_IRQI_SIZE, sizeof(struct ioapic_irqinfo));
253ASSYM(IOAPIC_IRQI_SZSHIFT, IOAPIC_IRQI_SZSHIFT);
254ASSYM(IOAPIC_IRQI_FLAG_LEVEL, IOAPIC_IRQI_FLAG_LEVEL);
255ASSYM(IOAPIC_IRQI_FLAG_MASKED, IOAPIC_IRQI_FLAG_MASKED);