genassym.cf revision 1.63
11.63Sad#	$NetBSD: genassym.cf,v 1.63 2008/03/11 02:24:43 ad Exp $
21.9Smycroft
31.9Smycroft#
41.58Sad# Copyright (c) 1998, 2006, 2007 The NetBSD Foundation, Inc.
51.9Smycroft# All rights reserved.
61.9Smycroft#
71.9Smycroft# This code is derived from software contributed to The NetBSD Foundation
81.58Sad# by Charles M. Hannum, and by Andrew Doran.
91.9Smycroft#
101.9Smycroft# Redistribution and use in source and binary forms, with or without
111.9Smycroft# modification, are permitted provided that the following conditions
121.9Smycroft# are met:
131.9Smycroft# 1. Redistributions of source code must retain the above copyright
141.9Smycroft#    notice, this list of conditions and the following disclaimer.
151.9Smycroft# 2. Redistributions in binary form must reproduce the above copyright
161.9Smycroft#    notice, this list of conditions and the following disclaimer in the
171.9Smycroft#    documentation and/or other materials provided with the distribution.
181.9Smycroft# 3. All advertising materials mentioning features or use of this software
191.9Smycroft#    must display the following acknowledgement:
201.9Smycroft#        This product includes software developed by the NetBSD
211.9Smycroft#        Foundation, Inc. and its contributors.
221.9Smycroft# 4. Neither the name of The NetBSD Foundation nor the names of its
231.9Smycroft#    contributors may be used to endorse or promote products derived
241.9Smycroft#    from this software without specific prior written permission.
251.9Smycroft#
261.9Smycroft# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
271.9Smycroft# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
281.9Smycroft# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
291.9Smycroft# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
301.9Smycroft# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
311.9Smycroft# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
321.9Smycroft# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
331.9Smycroft# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
341.9Smycroft# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
351.9Smycroft# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
361.9Smycroft# POSSIBILITY OF SUCH DAMAGE.
371.9Smycroft#
381.1Smycroft
391.1Smycroft#
401.1Smycroft# Copyright (c) 1982, 1990 The Regents of the University of California.
411.1Smycroft# All rights reserved.
421.1Smycroft#
431.1Smycroft# This code is derived from software contributed to Berkeley by
441.1Smycroft# William Jolitz.
451.1Smycroft#
461.1Smycroft# Redistribution and use in source and binary forms, with or without
471.1Smycroft# modification, are permitted provided that the following conditions
481.1Smycroft# are met:
491.1Smycroft# 1. Redistributions of source code must retain the above copyright
501.1Smycroft#    notice, this list of conditions and the following disclaimer.
511.1Smycroft# 2. Redistributions in binary form must reproduce the above copyright
521.1Smycroft#    notice, this list of conditions and the following disclaimer in the
531.1Smycroft#    documentation and/or other materials provided with the distribution.
541.1Smycroft# 3. All advertising materials mentioning features or use of this software
551.1Smycroft#    must display the following acknowledgement:
561.1Smycroft#	This product includes software developed by the University of
571.1Smycroft#	California, Berkeley and its contributors.
581.1Smycroft# 4. Neither the name of the University nor the names of its contributors
591.1Smycroft#    may be used to endorse or promote products derived from this software
601.1Smycroft#    without specific prior written permission.
611.1Smycroft#
621.1Smycroft# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
631.1Smycroft# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
641.1Smycroft# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
651.1Smycroft# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
661.1Smycroft# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
671.1Smycroft# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
681.1Smycroft# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
691.1Smycroft# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
701.1Smycroft# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
711.1Smycroft# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
721.1Smycroft# SUCH DAMAGE.
731.1Smycroft#
741.1Smycroft#	@(#)genassym.c	5.11 (Berkeley) 5/10/91
751.1Smycroft#
761.1Smycroft
771.29Sjdolecekif defined(_KERNEL_OPT)
781.8Sthorpejinclude "opt_compat_svr4.h"
791.8Sthorpejinclude "opt_compat_freebsd.h"
801.8Sthorpejinclude "opt_compat_linux.h"
811.41Schristosinclude "opt_compat_netbsd.h"
821.32Sfvdlinclude "opt_multiprocessor.h"
831.61Sbouyerinclude	"opt_xen.h"
841.22Sjdolecekendif
851.7Sthorpej
861.47Sadquote #define __MUTEX_PRIVATE
871.47Sadquote #define __RWLOCK_PRIVATE
881.47Sad
891.1Smycroftinclude <sys/param.h>
901.1Smycroftinclude <sys/proc.h>
911.1Smycroftinclude <sys/resourcevar.h>
921.1Smycroftinclude <sys/device.h>
931.1Smycroftinclude <sys/user.h>
941.1Smycroftinclude <sys/mbuf.h>
951.47Sadinclude <sys/mutex.h>
961.47Sadinclude <sys/rwlock.h>
971.47Sad
981.25Sfvdlinclude <netinet/in.h>
991.25Sfvdlinclude <netinet/in_systm.h>
1001.25Sfvdlinclude <netinet/ip.h>
1011.27Ssommerfeinclude <netinet/ip6.h>
1021.25Sfvdlinclude <netinet/ip_var.h>
1031.1Smycroft
1041.18Sthorpejinclude <uvm/uvm.h>
1051.6Smrg
1061.1Smycroftinclude <machine/trap.h>
1071.1Smycroftinclude <machine/pmap.h>
1081.1Smycroftinclude <machine/vmparam.h>
1091.33Sfvdlinclude <machine/intr.h>
1101.33Sfvdlinclude <machine/types.h>
1111.55Sadinclude <machine/segments.h>
1121.1Smycroft
1131.61Sbouyerifdef XEN
1141.61Sbouyerifdef XEN3
1151.61Sbouyerinclude <xen/xen3-public/sched.h>
1161.61Sbouyerelse
1171.61Sbouyerinclude <xen/xen-public/xen.h>
1181.61Sbouyerendif
1191.61Sbouyerendif
1201.61Sbouyer
1211.22Sjdolecekif defined(_KERNEL) && !defined(_LKM)
1221.33Sfvdlinclude "ioapic.h"
1231.61Sbouyerifndef XEN
1241.45Schristosinclude "apmbios.h"
1251.22Sjdolecekendif
1261.61Sbouyerendif
1271.45Schristosif NAPMBIOS > 0
1281.3Sjtkinclude <machine/bioscall.h>
1291.1Smycroftinclude <machine/apmvar.h>
1301.1Smycroftendif
1311.1Smycroft
1321.41Schristosinclude <compat/sys/signal.h>
1331.41Schristos
1341.1Smycroftifdef COMPAT_SVR4
1351.1Smycroftinclude <compat/svr4/svr4_ucontext.h>
1361.1Smycroftendif
1371.1Smycroft
1381.1Smycroftifdef COMPAT_LINUX
1391.13Sfvdlinclude <compat/linux/common/linux_signal.h>
1401.13Sfvdlinclude <compat/linux/common/linux_machdep.h>
1411.1Smycroftendif
1421.1Smycroft
1431.1Smycroftifdef COMPAT_FREEBSD
1441.1Smycroftinclude <machine/freebsd_machdep.h>
1451.1Smycroftendif
1461.1Smycroft
1471.32Sfvdlifdef MULTIPROCESSOR
1481.32Sfvdlinclude <machine/cpu.h>
1491.32Sfvdlendif
1501.32Sfvdl
1511.33Sfvdlif NIOAPIC > 0
1521.37Sfvdlinclude <machine/i82093reg.h>
1531.33Sfvdlinclude <machine/i82093var.h>
1541.33Sfvdlendif
1551.33Sfvdl
1561.22Sjdolecekif defined(_KERNEL) && !defined(_LKM)
1571.1Smycroftinclude "isa.h"
1581.22Sjdolecekendif
1591.1Smycroftif NISA > 0
1601.14Scgdinclude <machine/isa_machdep.h>
1611.1Smycroftendif
1621.1Smycroft
1631.32Sfvdlinclude <machine/tlog.h>
1641.36Sthorpej
1651.61Sbouyer
1661.52Sadinclude <x86/busdefs.h>
1671.52Sad
1681.36Sthorpejdefine	PAGE_SIZE		PAGE_SIZE
1691.36Sthorpej
1701.35Sthorpejdefine	LSRUN			LSRUN
1711.35Sthorpejdefine	LSONPROC		LSONPROC
1721.1Smycroft
1731.42Syamtdefine	PTE_BASE		PTE_BASE
1741.42Syamtdefine	UPAGES			UPAGES
1751.42Syamtdefine	USPACE			USPACE
1761.44Syamtdefine	KSTACK_SIZE		KSTACK_SIZE
1771.42Syamtdefine	KERNBASE		KERNBASE
1781.42Syamtdefine	KERNTEXTOFF		KERNTEXTOFF
1791.42Syamt
1801.42Syamtdefine	PG_RW			PG_RW
1811.42Syamtdefine	PG_V			PG_V
1821.42Syamtdefine	PG_KW			PG_KW
1831.42Syamtdefine	PG_KR			PG_KR
1841.57Saddefine	PGEX_U			PGEX_U
1851.42Syamt
1861.54Syamtdefine	L2_SLOT_KERNBASE	pl2_pi(KERNBASE)
1871.54Syamtdefine	L1_SLOT_KERNBASE	pl1_pi(KERNBASE)
1881.54Syamt
1891.54Syamtdefine	PDIR_SLOT_PTE		PDIR_SLOT_PTE
1901.54Syamtdefine	PTE_BASE		PTE_BASE
1911.1Smycroft
1921.60Syamtdefine	IOMAPSIZE		IOMAPSIZE
1931.60Syamt
1941.1Smycroftdefine	VM_MAXUSER_ADDRESS	(int)VM_MAXUSER_ADDRESS
1951.18Sthorpej
1961.18Sthorpejdefine	UVM_PAGE_IDLE_ZERO	offsetof(struct uvm, page_idle_zero)
1971.1Smycroft
1981.35Sthorpejdefine	L_ADDR			offsetof(struct lwp, l_addr)
1991.49Syamtdefine	L_FLAG			offsetof(struct lwp, l_flag)
2001.35Sthorpejdefine	L_PROC			offsetof(struct lwp, l_proc)
2011.35Sthorpejdefine	L_MD_REGS		offsetof(struct lwp, l_md.md_regs)
2021.58Saddefine	L_CTXSWTCH		offsetof(struct lwp, l_ctxswtch)
2031.47Saddefine	L_MD_ASTPENDING		offsetof(struct lwp, l_md.md_astpending)
2041.62Saddefine	L_CPU			offsetof(struct lwp, l_cpu)
2051.62Saddefine	L_NCSW			offsetof(struct lwp, l_ncsw)
2061.1Smycroftdefine	P_FLAG			offsetof(struct proc, p_flag)
2071.39Sdsldefine	P_RASLIST		offsetof(struct proc, p_raslist)
2081.24Smycroftdefine	P_MD_SYSCALL		offsetof(struct proc, p_md.md_syscall)
2091.1Smycroft
2101.49Syamtdefine	LW_SYSTEM		LW_SYSTEM
2111.1Smycroft
2121.55Saddefine	GUFS_SEL		GUFS_SEL
2131.55Saddefine	GUGS_SEL		GUGS_SEL
2141.55Sad
2151.1Smycroftdefine	M_DATA			offsetof(struct mbuf, m_data)
2161.1Smycroftdefine	M_LEN			offsetof(struct mbuf, m_len)
2171.1Smycroftdefine	M_NEXT			offsetof(struct mbuf, m_next)
2181.25Sfvdl
2191.25Sfvdldefine	IP_SRC			offsetof(struct ip, ip_src)
2201.25Sfvdldefine	IP_DST			offsetof(struct ip, ip_dst)
2211.27Ssommerfe
2221.27Ssommerfedefine	IP6_SRC			offsetof(struct ip6_hdr, ip6_src)
2231.27Ssommerfedefine	IP6_DST			offsetof(struct ip6_hdr, ip6_dst)
2241.1Smycroft
2251.6Smrgdefine	V_TRAP			offsetof(struct uvmexp, traps)
2261.6Smrgdefine	V_INTR			offsetof(struct uvmexp, intrs)
2271.1Smycroft
2281.1Smycroftdefine	PCB_CR3			offsetof(struct pcb, pcb_cr3)
2291.1Smycroftdefine	PCB_EBP			offsetof(struct pcb, pcb_ebp)
2301.1Smycroftdefine	PCB_ESP			offsetof(struct pcb, pcb_esp)
2311.50Saddefine	PCB_ESP0		offsetof(struct pcb, pcb_esp0)
2321.1Smycroftdefine	PCB_CR0			offsetof(struct pcb, pcb_cr0)
2331.1Smycroftdefine	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
2341.32Sfvdldefine	PCB_FPCPU		offsetof(struct pcb, pcb_fpcpu)
2351.56Saddefine	PCB_FSD			offsetof(struct pcb, pcb_fsd)
2361.56Saddefine	PCB_GSD			offsetof(struct pcb, pcb_gsd)
2371.60Syamtdefine	PCB_IOMAP		offsetof(struct pcb, pcb_iomap)
2381.1Smycroft
2391.1Smycroftdefine	TF_CS			offsetof(struct trapframe, tf_cs)
2401.5Smycroftdefine	TF_EIP			offsetof(struct trapframe, tf_eip)
2411.4Smycroftdefine	TF_ERR			offsetof(struct trapframe, tf_err)
2421.1Smycroftdefine	TF_TRAPNO		offsetof(struct trapframe, tf_trapno)
2431.1Smycroftdefine	TF_EFLAGS		offsetof(struct trapframe, tf_eflags)
2441.1Smycroft
2451.33Sfvdldefine	TF_GS			offsetof(struct trapframe, tf_gs)
2461.33Sfvdldefine	TF_FS			offsetof(struct trapframe, tf_fs)
2471.33Sfvdldefine	TF_ES			offsetof(struct trapframe, tf_es)
2481.33Sfvdldefine	TF_DS			offsetof(struct trapframe, tf_ds)
2491.33Sfvdldefine	TF_EDI			offsetof(struct trapframe, tf_edi)
2501.33Sfvdldefine	TF_ESI			offsetof(struct trapframe, tf_esi)
2511.33Sfvdldefine	TF_EBP			offsetof(struct trapframe, tf_ebp)
2521.33Sfvdldefine	TF_EBX			offsetof(struct trapframe, tf_ebx)
2531.33Sfvdldefine	TF_EDX			offsetof(struct trapframe, tf_edx)
2541.33Sfvdldefine	TF_ECX			offsetof(struct trapframe, tf_ecx)
2551.33Sfvdldefine	TF_EAX			offsetof(struct trapframe, tf_eax)
2561.33Sfvdl
2571.33Sfvdldefine	TF_PUSHSIZE		offsetof(struct trapframe, tf_trapno)
2581.33Sfvdl
2591.1Smycroftdefine	FRAMESIZE		sizeof(struct trapframe)
2601.1Smycroft
2611.1Smycroftifdef COMPAT_SVR4
2621.1Smycroftdefine	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
2631.1Smycroftdefine	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
2641.1Smycroftendif
2651.1Smycroft
2661.1Smycroftifdef COMPAT_LINUX
2671.1Smycroftdefine	LINUX_SIGF_HANDLER	offsetof(struct linux_sigframe, sf_handler)
2681.1Smycroftdefine	LINUX_SIGF_SC		offsetof(struct linux_sigframe, sf_sc)
2691.34Schristosdefine	LINUX_RT_SIGF_HANDLER	offsetof(struct linux_rt_sigframe, sf_handler)
2701.38Schristosdefine	LINUX_RT_SIGF_UC	offsetof(struct linux_rt_sigframe, sf_uc)
2711.1Smycroftendif
2721.1Smycroft
2731.1Smycroftifdef COMPAT_FREEBSD
2741.1Smycroftdefine	FREEBSD_SIGF_HANDLER	offsetof(struct freebsd_sigframe, sf_handler)
2751.1Smycroftdefine	FREEBSD_SIGF_SC		offsetof(struct freebsd_sigframe, sf_sc)
2761.1Smycroftendif
2771.1Smycroft
2781.1Smycroftdefine	IH_FUN			offsetof(struct intrhand, ih_fun)
2791.1Smycroftdefine	IH_ARG			offsetof(struct intrhand, ih_arg)
2801.33Sfvdldefine	IH_LEVEL		offsetof(struct intrhand, ih_level)
2811.61Sbouyerifdef XEN
2821.61Sbouyerdefine	IH_IPL_NEXT		offsetof(struct intrhand, ih_ipl_next)
2831.61Sbouyerelse
2841.1Smycroftdefine	IH_NEXT			offsetof(struct intrhand, ih_next)
2851.61Sbouyerendif
2861.1Smycroft
2871.45Schristosif NAPMBIOS > 0
2881.1Smycroftdefine	APM_CODE32		offsetof(struct apm_connect_info, apm_code32_seg_base)
2891.1Smycroftdefine	APM_CODE16		offsetof(struct apm_connect_info, apm_code16_seg_base)
2901.1Smycroftdefine	APM_DATA		offsetof(struct apm_connect_info, apm_data_seg_base)
2911.1Smycroftdefine	APM_CODE32_LEN		offsetof(struct apm_connect_info, apm_code32_seg_len)
2921.1Smycroftdefine	APM_DATA_LEN		offsetof(struct apm_connect_info, apm_data_seg_len)
2931.1Smycroftdefine	APM_ENTRY		offsetof(struct apm_connect_info, apm_entrypt)
2941.1Smycroftdefine	APM_DETAIL		offsetof(struct apm_connect_info, apm_detail)
2951.1Smycroftdefine	APM_SIZE		sizeof(struct apm_connect_info)
2961.10Sjtkdefine	BIOSCALLREG_EAX		offsetof(struct bioscallregs, EAX)
2971.10Sjtkdefine	BIOSCALLREG_EBX		offsetof(struct bioscallregs, EBX)
2981.10Sjtkdefine	BIOSCALLREG_ECX		offsetof(struct bioscallregs, ECX)
2991.10Sjtkdefine	BIOSCALLREG_EDX		offsetof(struct bioscallregs, EDX)
3001.10Sjtkdefine	BIOSCALLREG_ESI		offsetof(struct bioscallregs, ESI)
3011.10Sjtkdefine	BIOSCALLREG_EDI		offsetof(struct bioscallregs, EDI)
3021.10Sjtkdefine	BIOSCALLREG_EFLAGS	offsetof(struct bioscallregs, EFLAGS)
3031.26Saugustssendif
3041.32Sfvdl
3051.32Sfvdldefine	CPU_INFO_SELF		offsetof(struct cpu_info, ci_self)
3061.32Sfvdldefine	CPU_INFO_RESCHED	offsetof(struct cpu_info, ci_want_resched)
3071.40Syamtdefine	CPU_INFO_WANT_PMAPLOAD	offsetof(struct cpu_info, ci_want_pmapload)
3081.50Saddefine	CPU_INFO_PMAP_CPU	offsetof(struct cpu_info, ci_pmap_cpu)
3091.40Syamtdefine	CPU_INFO_TLBSTATE	offsetof(struct cpu_info, ci_tlbstate)
3101.40Syamtdefine	TLBSTATE_VALID		TLBSTATE_VALID
3111.50Saddefine	TLBSTATE_LAZY		TLBSTATE_LAZY
3121.50Saddefine	TLBSTATE_STALE		TLBSTATE_STALE
3131.50Saddefine	CPU_INFO_TLB_EVCNT	offsetof(struct cpu_info, ci_tlb_evcnt)
3141.35Sthorpejdefine	CPU_INFO_CURLWP		offsetof(struct cpu_info, ci_curlwp)
3151.49Syamtdefine	CPU_INFO_IDLELWP	offsetof(struct cpu_info, ci_data.cpu_idlelwp)
3161.50Saddefine	CPU_INFO_PMAP		offsetof(struct cpu_info, ci_pmap)
3171.50Saddefine	CPU_INFO_CPUMASK	offsetof(struct cpu_info, ci_cpumask)
3181.60Syamtdefine	CPU_INFO_TSS		offsetof(struct cpu_info, ci_tss)
3191.60Syamtdefine	CPU_INFO_TSS_SEL	offsetof(struct cpu_info, ci_tss_sel)
3201.60Syamtdefine	CPU_INFO_ESP0		offsetof(struct cpu_info, ci_tss.tss_esp0)
3211.60Syamtdefine	CPU_INFO_IOBASE		offsetof(struct cpu_info, ci_tss.tss_iobase)
3221.60Syamtdefine	CPU_INFO_IOMAP		offsetof(struct cpu_info, ci_iomap)
3231.63Saddefine	IOMAP_INVALOFF		IOMAP_INVALOFF
3241.62Saddefine	CPU_INFO_CC		offsetof(struct cpu_info, ci_cc)
3251.63Saddefine	CPU_INFO_NSYSCALL	offsetof(struct cpu_info, ci_data.cpu_nsyscall)
3261.32Sfvdl
3271.32Sfvdldefine	CPU_INFO_LEVEL		offsetof(struct cpu_info, ci_cpuid_level)
3281.32Sfvdldefine	CPU_INFO_VENDOR		offsetof(struct cpu_info, ci_vendor[0])
3291.32Sfvdldefine	CPU_INFO_SIGNATURE	offsetof(struct cpu_info, ci_signature)
3301.32Sfvdldefine	CPU_INFO_FEATURES	offsetof(struct cpu_info, ci_feature_flags)
3311.32Sfvdldefine	CPU_INFO_BRAND		offsetof(struct cpu_info, ci_brand_id)
3321.32Sfvdl
3331.32Sfvdldefine	CPU_TLOG_OFFSET		offsetof(struct cpu_info, ci_tlog_offset)
3341.32Sfvdldefine	CPU_TLOG_BASE		offsetof(struct cpu_info, ci_tlog_base)
3351.32Sfvdl
3361.32Sfvdldefine	CPU_INFO_GDT		offsetof(struct cpu_info, ci_gdt)
3371.33Sfvdldefine	CPU_INFO_IPENDING	offsetof(struct cpu_info, ci_ipending)
3381.33Sfvdldefine	CPU_INFO_IMASK		offsetof(struct cpu_info, ci_imask)
3391.33Sfvdldefine	CPU_INFO_IUNMASK	offsetof(struct cpu_info, ci_iunmask)
3401.33Sfvdldefine	CPU_INFO_ILEVEL		offsetof(struct cpu_info, ci_ilevel)
3411.33Sfvdldefine	CPU_INFO_IDEPTH		offsetof(struct cpu_info, ci_idepth)
3421.33Sfvdldefine	CPU_INFO_ISOURCES	offsetof(struct cpu_info, ci_isources)
3431.47Saddefine	CPU_INFO_MTX_COUNT	offsetof(struct cpu_info, ci_mtx_count)
3441.47Saddefine	CPU_INFO_MTX_OLDSPL	offsetof(struct cpu_info, ci_mtx_oldspl)
3451.46Syamtdefine	CPU_INFO_INTRSTACK	offsetof(struct cpu_info, ci_intrstack)
3461.47Saddefine	CPU_INFO_ISTATE		offsetof(struct cpu_info, ci_istate)
3471.33Sfvdl
3481.62Saddefine	CC_DENOM		offsetof(struct cc_microtime_state, cc_denom)
3491.62Saddefine	CC_DELTA		offsetof(struct cc_microtime_state, cc_denom)
3501.62Saddefine	CC_VAL			offsetof(struct cc_microtime_state, cc_val)
3511.62Saddefine	CC_GEN			offsetof(struct cc_microtime_state, cc_gen)
3521.62Saddefine	CC_CC			offsetof(struct cc_microtime_state, cc_cc)
3531.62Sad
3541.59Sjoergdefine	ACPI_SUSPEND_GDT		offsetof(struct cpu_info, ci_suspend_gdt)
3551.59Sjoergdefine	ACPI_SUSPEND_IDT		offsetof(struct cpu_info, ci_suspend_idt)
3561.59Sjoergdefine	ACPI_SUSPEND_TR			offsetof(struct cpu_info, ci_suspend_tr)
3571.59Sjoergdefine	ACPI_SUSPEND_LDT		offsetof(struct cpu_info, ci_suspend_ldt)
3581.59Sjoergdefine	ACPI_SUSPEND_FS			offsetof(struct cpu_info, ci_suspend_fs)
3591.59Sjoergdefine	ACPI_SUSPEND_GS			offsetof(struct cpu_info, ci_suspend_gs)
3601.59Sjoerg
3611.59Sjoergdefine	ACPI_SUSPEND_EBX		offsetof(struct cpu_info, ci_suspend_ebx)
3621.59Sjoergdefine	ACPI_SUSPEND_ESI		offsetof(struct cpu_info, ci_suspend_esi)
3631.59Sjoergdefine	ACPI_SUSPEND_EDI		offsetof(struct cpu_info, ci_suspend_edi)
3641.59Sjoergdefine	ACPI_SUSPEND_EBP		offsetof(struct cpu_info, ci_suspend_ebp)
3651.59Sjoergdefine	ACPI_SUSPEND_ESP		offsetof(struct cpu_info, ci_suspend_esp)
3661.59Sjoergdefine	ACPI_SUSPEND_EFL		offsetof(struct cpu_info, ci_suspend_efl)
3671.59Sjoergdefine	ACPI_SUSPEND_CR0		offsetof(struct cpu_info, ci_suspend_cr0)
3681.59Sjoergdefine	ACPI_SUSPEND_CR2		offsetof(struct cpu_info, ci_suspend_cr2)
3691.59Sjoergdefine	ACPI_SUSPEND_CR3		offsetof(struct cpu_info, ci_suspend_cr3)
3701.59Sjoergdefine	ACPI_SUSPEND_CR4		offsetof(struct cpu_info, ci_suspend_cr4)
3711.59Sjoerg
3721.33Sfvdlif NIOAPIC > 0
3731.33Sfvdldefine		IOAPIC_SC_REG		offsetof(struct ioapic_softc, sc_reg)
3741.33Sfvdldefine		IOAPIC_SC_DATA		offsetof(struct ioapic_softc, sc_data)
3751.33Sfvdldefine		PIC_LOCK		offsetof(struct pic, pic_lock)
3761.33Sfvdlendif
3771.32Sfvdl
3781.32Sfvdldefine	SIZEOF_CPU_INFO		sizeof(struct cpu_info)
3791.61Sbouyerdefine	SIZEOF_ISTUB		sizeof(struct intrstub)
3801.32Sfvdl
3811.61Sbouyerifdef XEN
3821.61Sbouyerdefine	SIZEOF_IPLSOURCE	sizeof(struct iplsource)
3831.61Sbouyerdefine	IS_RECURSE		offsetof(struct iplsource, ipl_recurse)
3841.61Sbouyerdefine	IS_RESUME		offsetof(struct iplsource, ipl_resume)
3851.61Sbouyerdefine	IS_HANDLERS		offsetof(struct iplsource, ipl_handlers)
3861.61Sbouyerdefine	EV_EVCNTL		offsetof(struct evcnt, ev_count)
3871.61Sbouyerelse
3881.54Syamtdefine	SIZEOF_ISOURCE		sizeof(struct intrsource)
3891.54Syamtdefine	IS_RECURSE		offsetof(struct intrsource, is_recurse)
3901.54Syamtdefine	IS_RESUME		offsetof(struct intrsource, is_resume)
3911.54Syamtdefine	IS_EVCNTLO		offsetof(struct intrsource, is_evcnt.ev_count)
3921.54Syamtdefine	IS_EVCNTHI		offsetof(struct intrsource, is_evcnt.ev_count)+4
3931.54Syamtdefine	IS_HANDLERS		offsetof(struct intrsource, is_handlers)
3941.54Syamtdefine	IS_PIC			offsetof(struct intrsource, is_pic)
3951.54Syamtdefine	IS_FLAGS		offsetof(struct intrsource, is_flags)
3961.54Syamtdefine	IS_PIN			offsetof(struct intrsource, is_pin)
3971.54Syamtdefine	IS_TYPE			offsetof(struct intrsource, is_type)
3981.54Syamtdefine	IS_MAXLEVEL		offsetof(struct intrsource, is_maxlevel)
3991.58Saddefine	IS_LWP			offsetof(struct intrsource, is_lwp)
4001.61Sbouyerendif
4011.33Sfvdl
4021.32Sfvdldefine	TREC_SP			offsetof(struct trec, tr_sp)
4031.32Sfvdldefine	TREC_HPC		offsetof(struct trec, tr_hpc)
4041.32Sfvdldefine	TREC_IPC		offsetof(struct trec, tr_ipc)
4051.32Sfvdldefine	TREC_TSC		offsetof(struct trec, tr_tsc)
4061.32Sfvdldefine	TREC_LBF		offsetof(struct trec, tr_lbf)
4071.32Sfvdldefine	TREC_LBT		offsetof(struct trec, tr_lbt)
4081.32Sfvdldefine	TREC_IBF		offsetof(struct trec, tr_ibf)
4091.32Sfvdldefine	TREC_IBT		offsetof(struct trec, tr_ibt)
4101.32Sfvdl
4111.32Sfvdldefine	SIZEOF_TREC		sizeof(struct trec)
4121.32Sfvdldefine	SIZEOF_TLOG		sizeof(struct tlog)
4131.42Syamt
4141.42Syamtdefine	IPL_NONE		IPL_NONE
4151.42Syamtdefine	IPL_SCHED		IPL_SCHED
4161.42Syamtdefine	IPL_CLOCK		IPL_CLOCK
4171.42Syamtdefine	IPL_HIGH		IPL_HIGH
4181.42Syamtdefine	IPL_IPI			IPL_IPI
4191.42Syamt
4201.42Syamtdefine	IPL_SOFTNET		IPL_SOFTNET
4211.42Syamtdefine	IPL_SOFTCLOCK		IPL_SOFTCLOCK
4221.42Syamtdefine	IPL_SOFTSERIAL		IPL_SOFTSERIAL
4231.42Syamt
4241.42Syamtdefine	LIR_IPI			LIR_IPI
4251.42Syamtdefine	LIR_TIMER		LIR_TIMER
4261.42Syamt
4271.42Syamtdefine	SIR_NET			SIR_NET
4281.42Syamtdefine	SIR_CLOCK		SIR_CLOCK
4291.42Syamtdefine	SIR_SERIAL		SIR_SERIAL
4301.42Syamt
4311.42Syamtdefine	IREENT_MAGIC		IREENT_MAGIC
4321.42Syamt
4331.42Syamtdefine	PSL_AC			PSL_AC
4341.42Syamtdefine	PSL_MBO			PSL_MBO
4351.42Syamtdefine	PSL_ID			PSL_ID
4361.42Syamtdefine	PSL_VM			PSL_VM
4371.46Syamtdefine	PSL_I			PSL_I
4381.47Sad
4391.47Saddefine	MTX_IPL			offsetof(struct kmutex, u.s.mtxs_ipl)
4401.47Saddefine	MTX_LOCK		offsetof(struct kmutex, mtx_lock)
4411.47Saddefine	MTX_OWNER		offsetof(struct kmutex, u.mtxa_owner)
4421.47Sad
4431.47Saddefine	RW_OWNER		offsetof(struct krwlock, rw_owner)
4441.47Saddefine	RW_WRITE_LOCKED		RW_WRITE_LOCKED
4451.47Saddefine	RW_WRITE_WANTED		RW_WRITE_WANTED
4461.47Saddefine	RW_READ_INCR		RW_READ_INCR
4471.47Saddefine	RW_HAS_WAITERS		RW_HAS_WAITERS
4481.47Saddefine	RW_THREAD		RW_THREAD
4491.47Saddefine	RW_READER		RW_READER
4501.47Saddefine	RW_WRITER		RW_WRITER
4511.50Sad
4521.50Saddefine	MB_POINTER		offsetof(struct pmap_mbox, mb_pointer)
4531.50Saddefine	MB_GLOBAL		offsetof(struct pmap_mbox, mb_global)
4541.50Saddefine	MB_ADDR1		offsetof(struct pmap_mbox, mb_addr1)
4551.50Saddefine	MB_ADDR2		offsetof(struct pmap_mbox, mb_addr2)
4561.50Saddefine	MB_HEAD			offsetof(struct pmap_mbox, mb_head)
4571.50Saddefine	MB_TAIL			offsetof(struct pmap_mbox, mb_tail)
4581.50Sad
4591.50Saddefine	PM_CPUS			offsetof(struct pmap, pm_cpus)
4601.50Sad
4611.50Saddefine	EV_COUNT		offsetof(struct evcnt, ev_count)
4621.52Sad
4631.52Saddefine	OPTERON_MSR_PASSCODE	OPTERON_MSR_PASSCODE
4641.52Sad
4651.52Saddefine	X86_BUS_SPACE_IO	X86_BUS_SPACE_IO
4661.54Syamt
4671.54Syamtdefine	L1_SHIFT		L1_SHIFT
4681.54Syamtdefine	L2_SHIFT		L2_SHIFT
4691.54Syamtdefine	L2_FRAME		L2_FRAME
4701.54Syamtdefine	PGOFSET			PGOFSET
4711.54Syamtdefine	PGSHIFT			PGSHIFT
4721.61Sbouyer
4731.61Sbouyerifdef XEN
4741.61Sbouyerifdef XEN3
4751.61Sbouyerdefine START_INFO_SHARED_INFO	offsetof(struct start_info, shared_info)
4761.61Sbouyerdefine START_INFO_FLAGS		offsetof(struct start_info, flags)
4771.61Sbouyerdefine START_INFO_CONSOLE_MFN	offsetof(struct start_info, console_mfn)
4781.61Sbouyerdefine START_INFO_STORE_MFN	offsetof(struct start_info, store_mfn)
4791.61Sbouyerelse
4801.61Sbouyerdefine START_INFO_SHARED_INFO	offsetof(start_info_t, shared_info)
4811.61Sbouyerendif
4821.61Sbouyerdefine SIF_INITDOMAIN		SIF_INITDOMAIN
4831.61Sbouyerifdef XEN3
4841.61Sbouyerdefine EVTCHN_UPCALL_PENDING	offsetof(struct shared_info, vcpu_info[0].evtchn_upcall_pending)
4851.61Sbouyerdefine EVTCHN_UPCALL_MASK	offsetof(struct shared_info, vcpu_info[0].evtchn_upcall_mask)
4861.61Sbouyerelse
4871.61Sbouyerdefine EVTCHN_UPCALL_PENDING	offsetof(struct shared_info_st, vcpu_info[0].evtchn_upcall_pending)
4881.61Sbouyerdefine EVTCHN_UPCALL_MASK	offsetof(struct shared_info_st, vcpu_info[0].evtchn_upcall_mask)
4891.61Sbouyerendif
4901.61Sbouyer
4911.61Sbouyerdefine HYPERVISOR_sched_op	__HYPERVISOR_sched_op
4921.61Sbouyerdefine SCHEDOP_yield		SCHEDOP_yield
4931.61Sbouyerendif
4941.61Sbouyer
495