genassym.cf revision 1.69
1#	$NetBSD: genassym.cf,v 1.69 2008/05/10 16:12:32 ad Exp $
2
3#
4# Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
5# All rights reserved.
6#
7# This code is derived from software contributed to The NetBSD Foundation
8# by Charles M. Hannum, and by Andrew Doran.
9#
10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions
12# are met:
13# 1. Redistributions of source code must retain the above copyright
14#    notice, this list of conditions and the following disclaimer.
15# 2. Redistributions in binary form must reproduce the above copyright
16#    notice, this list of conditions and the following disclaimer in the
17#    documentation and/or other materials provided with the distribution.
18#
19# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30#
31
32#
33# Copyright (c) 1982, 1990 The Regents of the University of California.
34# All rights reserved.
35#
36# This code is derived from software contributed to Berkeley by
37# William Jolitz.
38#
39# Redistribution and use in source and binary forms, with or without
40# modification, are permitted provided that the following conditions
41# are met:
42# 1. Redistributions of source code must retain the above copyright
43#    notice, this list of conditions and the following disclaimer.
44# 2. Redistributions in binary form must reproduce the above copyright
45#    notice, this list of conditions and the following disclaimer in the
46#    documentation and/or other materials provided with the distribution.
47# 3. All advertising materials mentioning features or use of this software
48#    must display the following acknowledgement:
49#	This product includes software developed by the University of
50#	California, Berkeley and its contributors.
51# 4. Neither the name of the University nor the names of its contributors
52#    may be used to endorse or promote products derived from this software
53#    without specific prior written permission.
54#
55# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
56# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
58# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
59# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
60# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
61# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
62# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
63# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
64# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65# SUCH DAMAGE.
66#
67#	@(#)genassym.c	5.11 (Berkeley) 5/10/91
68#
69
70if defined(_KERNEL_OPT)
71include "opt_compat_svr4.h"
72include "opt_compat_freebsd.h"
73include "opt_compat_linux.h"
74include "opt_compat_netbsd.h"
75include "opt_multiprocessor.h"
76include	"opt_xen.h"
77endif
78
79quote #define __MUTEX_PRIVATE
80quote #define __RWLOCK_PRIVATE
81
82include <sys/param.h>
83include <sys/proc.h>
84include <sys/resourcevar.h>
85include <sys/device.h>
86include <sys/user.h>
87include <sys/mbuf.h>
88include <sys/mutex.h>
89include <sys/rwlock.h>
90
91include <netinet/in.h>
92include <netinet/in_systm.h>
93include <netinet/ip.h>
94include <netinet/ip6.h>
95include <netinet/ip_var.h>
96
97include <uvm/uvm.h>
98
99include <machine/trap.h>
100include <machine/pmap.h>
101include <machine/vmparam.h>
102include <machine/intr.h>
103include <machine/types.h>
104include <machine/segments.h>
105
106ifdef XEN
107ifdef XEN3
108include <xen/xen3-public/sched.h>
109else
110include <xen/xen-public/xen.h>
111endif
112endif
113
114if defined(_KERNEL) && !defined(_LKM)
115include "ioapic.h"
116ifndef XEN
117include "apmbios.h"
118endif
119endif
120if NAPMBIOS > 0
121include <machine/bioscall.h>
122include <machine/apmvar.h>
123endif
124
125include <compat/sys/signal.h>
126
127ifdef COMPAT_SVR4
128include <compat/svr4/svr4_ucontext.h>
129endif
130
131ifdef COMPAT_LINUX
132include <compat/linux/common/linux_signal.h>
133include <compat/linux/common/linux_machdep.h>
134endif
135
136ifdef COMPAT_FREEBSD
137include <machine/freebsd_machdep.h>
138endif
139
140ifdef MULTIPROCESSOR
141include <machine/cpu.h>
142endif
143
144if NIOAPIC > 0
145include <machine/i82093reg.h>
146include <machine/i82093var.h>
147endif
148
149if defined(_KERNEL) && !defined(_LKM)
150include "isa.h"
151endif
152if NISA > 0
153include <machine/isa_machdep.h>
154endif
155
156include <machine/tlog.h>
157
158
159include <x86/busdefs.h>
160
161define	PAGE_SIZE		PAGE_SIZE
162
163define	LSRUN			LSRUN
164define	LSONPROC		LSONPROC
165
166define	PTE_BASE		PTE_BASE
167define	UPAGES			UPAGES
168define	USPACE			USPACE
169define	KSTACK_SIZE		KSTACK_SIZE
170define	KERNBASE		KERNBASE
171define	KERNTEXTOFF		KERNTEXTOFF
172
173define	PG_RW			PG_RW
174define	PG_V			PG_V
175define	PG_KW			PG_KW
176define	PG_KR			PG_KR
177define	PGEX_U			PGEX_U
178
179define	L2_SLOT_KERNBASE	pl2_pi(KERNBASE)
180define	L1_SLOT_KERNBASE	pl1_pi(KERNBASE)
181
182define	PDIR_SLOT_PTE		PDIR_SLOT_PTE
183define	PTE_BASE		PTE_BASE
184
185define	IOMAPSIZE		IOMAPSIZE
186
187define	VM_MAXUSER_ADDRESS	(int)VM_MAXUSER_ADDRESS
188
189define	UVM_PAGE_IDLE_ZERO	offsetof(struct uvm, page_idle_zero)
190
191define	L_ADDR			offsetof(struct lwp, l_addr)
192define	L_FLAG			offsetof(struct lwp, l_flag)
193define	L_PROC			offsetof(struct lwp, l_proc)
194define	L_MD_REGS		offsetof(struct lwp, l_md.md_regs)
195define	L_CTXSWTCH		offsetof(struct lwp, l_ctxswtch)
196define	L_MD_ASTPENDING		offsetof(struct lwp, l_md.md_astpending)
197define	L_CPU			offsetof(struct lwp, l_cpu)
198define	L_NCSW			offsetof(struct lwp, l_ncsw)
199define	L_NOPREEMPT		offsetof(struct lwp, l_nopreempt)
200define	L_DOPREEMPT		offsetof(struct lwp, l_dopreempt)
201define	P_FLAG			offsetof(struct proc, p_flag)
202define	P_RASLIST		offsetof(struct proc, p_raslist)
203define	P_MD_SYSCALL		offsetof(struct proc, p_md.md_syscall)
204
205define	LW_SYSTEM		LW_SYSTEM
206
207define	GUFS_SEL		GUFS_SEL
208define	GUGS_SEL		GUGS_SEL
209
210define	M_DATA			offsetof(struct mbuf, m_data)
211define	M_LEN			offsetof(struct mbuf, m_len)
212define	M_NEXT			offsetof(struct mbuf, m_next)
213
214define	IP_SRC			offsetof(struct ip, ip_src)
215define	IP_DST			offsetof(struct ip, ip_dst)
216
217define	IP6_SRC			offsetof(struct ip6_hdr, ip6_src)
218define	IP6_DST			offsetof(struct ip6_hdr, ip6_dst)
219
220define	V_TRAP			offsetof(struct uvmexp, traps)
221define	V_INTR			offsetof(struct uvmexp, intrs)
222
223define	PCB_CR3			offsetof(struct pcb, pcb_cr3)
224define	PCB_EBP			offsetof(struct pcb, pcb_ebp)
225define	PCB_ESP			offsetof(struct pcb, pcb_esp)
226define	PCB_ESP0		offsetof(struct pcb, pcb_esp0)
227define	PCB_CR0			offsetof(struct pcb, pcb_cr0)
228define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
229define	PCB_FPCPU		offsetof(struct pcb, pcb_fpcpu)
230define	PCB_FSD			offsetof(struct pcb, pcb_fsd)
231define	PCB_GSD			offsetof(struct pcb, pcb_gsd)
232define	PCB_IOMAP		offsetof(struct pcb, pcb_iomap)
233
234define	TF_CS			offsetof(struct trapframe, tf_cs)
235define	TF_EIP			offsetof(struct trapframe, tf_eip)
236define	TF_ERR			offsetof(struct trapframe, tf_err)
237define	TF_TRAPNO		offsetof(struct trapframe, tf_trapno)
238define	TF_EFLAGS		offsetof(struct trapframe, tf_eflags)
239
240define	TF_GS			offsetof(struct trapframe, tf_gs)
241define	TF_FS			offsetof(struct trapframe, tf_fs)
242define	TF_ES			offsetof(struct trapframe, tf_es)
243define	TF_DS			offsetof(struct trapframe, tf_ds)
244define	TF_EDI			offsetof(struct trapframe, tf_edi)
245define	TF_ESI			offsetof(struct trapframe, tf_esi)
246define	TF_EBP			offsetof(struct trapframe, tf_ebp)
247define	TF_EBX			offsetof(struct trapframe, tf_ebx)
248define	TF_EDX			offsetof(struct trapframe, tf_edx)
249define	TF_ECX			offsetof(struct trapframe, tf_ecx)
250define	TF_EAX			offsetof(struct trapframe, tf_eax)
251
252define	TF_PUSHSIZE		offsetof(struct trapframe, tf_trapno)
253
254define	FRAMESIZE		sizeof(struct trapframe)
255
256ifdef COMPAT_SVR4
257define	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
258define	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
259endif
260
261ifdef COMPAT_LINUX
262define	LINUX_SIGF_HANDLER	offsetof(struct linux_sigframe, sf_handler)
263define	LINUX_SIGF_SC		offsetof(struct linux_sigframe, sf_sc)
264define	LINUX_RT_SIGF_HANDLER	offsetof(struct linux_rt_sigframe, sf_handler)
265define	LINUX_RT_SIGF_UC	offsetof(struct linux_rt_sigframe, sf_uc)
266endif
267
268ifdef COMPAT_FREEBSD
269define	FREEBSD_SIGF_HANDLER	offsetof(struct freebsd_sigframe, sf_handler)
270define	FREEBSD_SIGF_SC		offsetof(struct freebsd_sigframe, sf_sc)
271endif
272
273define	IH_FUN			offsetof(struct intrhand, ih_fun)
274define	IH_ARG			offsetof(struct intrhand, ih_arg)
275define	IH_LEVEL		offsetof(struct intrhand, ih_level)
276ifdef XEN
277define	IH_IPL_NEXT		offsetof(struct intrhand, ih_ipl_next)
278else
279define	IH_NEXT			offsetof(struct intrhand, ih_next)
280endif
281
282if NAPMBIOS > 0
283define	APM_CODE32		offsetof(struct apm_connect_info, apm_code32_seg_base)
284define	APM_CODE16		offsetof(struct apm_connect_info, apm_code16_seg_base)
285define	APM_DATA		offsetof(struct apm_connect_info, apm_data_seg_base)
286define	APM_CODE32_LEN		offsetof(struct apm_connect_info, apm_code32_seg_len)
287define	APM_DATA_LEN		offsetof(struct apm_connect_info, apm_data_seg_len)
288define	APM_ENTRY		offsetof(struct apm_connect_info, apm_entrypt)
289define	APM_DETAIL		offsetof(struct apm_connect_info, apm_detail)
290define	APM_SIZE		sizeof(struct apm_connect_info)
291define	BIOSCALLREG_EAX		offsetof(struct bioscallregs, EAX)
292define	BIOSCALLREG_EBX		offsetof(struct bioscallregs, EBX)
293define	BIOSCALLREG_ECX		offsetof(struct bioscallregs, ECX)
294define	BIOSCALLREG_EDX		offsetof(struct bioscallregs, EDX)
295define	BIOSCALLREG_ESI		offsetof(struct bioscallregs, ESI)
296define	BIOSCALLREG_EDI		offsetof(struct bioscallregs, EDI)
297define	BIOSCALLREG_EFLAGS	offsetof(struct bioscallregs, EFLAGS)
298endif
299
300define	CPU_INFO_SELF		offsetof(struct cpu_info, ci_self)
301define	CPU_INFO_RESCHED	offsetof(struct cpu_info, ci_want_resched)
302define	CPU_INFO_WANT_PMAPLOAD	offsetof(struct cpu_info, ci_want_pmapload)
303define	CPU_INFO_PMAP_CPU	offsetof(struct cpu_info, ci_pmap_cpu)
304define	CPU_INFO_TLBSTATE	offsetof(struct cpu_info, ci_tlbstate)
305define	TLBSTATE_VALID		TLBSTATE_VALID
306define	TLBSTATE_LAZY		TLBSTATE_LAZY
307define	TLBSTATE_STALE		TLBSTATE_STALE
308define	CPU_INFO_TLB_EVCNT	offsetof(struct cpu_info, ci_tlb_evcnt)
309define	CPU_INFO_CURLWP		offsetof(struct cpu_info, ci_curlwp)
310define	CPU_INFO_IDLELWP	offsetof(struct cpu_info, ci_data.cpu_idlelwp)
311define	CPU_INFO_PMAP		offsetof(struct cpu_info, ci_pmap)
312define	CPU_INFO_CPUMASK	offsetof(struct cpu_info, ci_cpumask)
313define	CPU_INFO_TSS		offsetof(struct cpu_info, ci_tss)
314define	CPU_INFO_TSS_SEL	offsetof(struct cpu_info, ci_tss_sel)
315define	CPU_INFO_ESP0		offsetof(struct cpu_info, ci_tss.tss_esp0)
316define	CPU_INFO_IOBASE		offsetof(struct cpu_info, ci_tss.tss_iobase)
317define	CPU_INFO_IOMAP		offsetof(struct cpu_info, ci_iomap)
318define	IOMAP_INVALOFF		IOMAP_INVALOFF
319define	CPU_INFO_NSYSCALL	offsetof(struct cpu_info, ci_data.cpu_nsyscall)
320define	CPU_INFO_CURPRIORITY	offsetof(struct cpu_info, ci_schedstate.spc_curpriority)
321define	CPU_INFO_CC_SKEW	offsetof(struct cpu_info, ci_data.cpu_cc_skew)
322
323define	CPU_INFO_LEVEL		offsetof(struct cpu_info, ci_cpuid_level)
324define	CPU_INFO_VENDOR		offsetof(struct cpu_info, ci_vendor[0])
325define	CPU_INFO_SIGNATURE	offsetof(struct cpu_info, ci_signature)
326define	CPU_INFO_FEATURES	offsetof(struct cpu_info, ci_feature_flags)
327define	CPU_INFO_BRAND		offsetof(struct cpu_info, ci_brand_id)
328
329define	CPU_TLOG_OFFSET		offsetof(struct cpu_info, ci_tlog_offset)
330define	CPU_TLOG_BASE		offsetof(struct cpu_info, ci_tlog_base)
331
332define	CPU_INFO_GDT		offsetof(struct cpu_info, ci_gdt)
333define	CPU_INFO_IPENDING	offsetof(struct cpu_info, ci_ipending)
334define	CPU_INFO_IMASK		offsetof(struct cpu_info, ci_imask)
335define	CPU_INFO_IUNMASK	offsetof(struct cpu_info, ci_iunmask)
336define	CPU_INFO_ILEVEL		offsetof(struct cpu_info, ci_ilevel)
337define	CPU_INFO_IDEPTH		offsetof(struct cpu_info, ci_idepth)
338define	CPU_INFO_ISOURCES	offsetof(struct cpu_info, ci_isources)
339define	CPU_INFO_MTX_COUNT	offsetof(struct cpu_info, ci_mtx_count)
340define	CPU_INFO_MTX_OLDSPL	offsetof(struct cpu_info, ci_mtx_oldspl)
341define	CPU_INFO_INTRSTACK	offsetof(struct cpu_info, ci_intrstack)
342define	CPU_INFO_ISTATE		offsetof(struct cpu_info, ci_istate)
343
344define	ACPI_SUSPEND_GDT		offsetof(struct cpu_info, ci_suspend_gdt)
345define	ACPI_SUSPEND_IDT		offsetof(struct cpu_info, ci_suspend_idt)
346define	ACPI_SUSPEND_TR			offsetof(struct cpu_info, ci_suspend_tr)
347define	ACPI_SUSPEND_LDT		offsetof(struct cpu_info, ci_suspend_ldt)
348define	ACPI_SUSPEND_FS			offsetof(struct cpu_info, ci_suspend_fs)
349define	ACPI_SUSPEND_GS			offsetof(struct cpu_info, ci_suspend_gs)
350
351define	ACPI_SUSPEND_EBX		offsetof(struct cpu_info, ci_suspend_ebx)
352define	ACPI_SUSPEND_ESI		offsetof(struct cpu_info, ci_suspend_esi)
353define	ACPI_SUSPEND_EDI		offsetof(struct cpu_info, ci_suspend_edi)
354define	ACPI_SUSPEND_EBP		offsetof(struct cpu_info, ci_suspend_ebp)
355define	ACPI_SUSPEND_ESP		offsetof(struct cpu_info, ci_suspend_esp)
356define	ACPI_SUSPEND_EFL		offsetof(struct cpu_info, ci_suspend_efl)
357define	ACPI_SUSPEND_CR0		offsetof(struct cpu_info, ci_suspend_cr0)
358define	ACPI_SUSPEND_CR2		offsetof(struct cpu_info, ci_suspend_cr2)
359define	ACPI_SUSPEND_CR3		offsetof(struct cpu_info, ci_suspend_cr3)
360define	ACPI_SUSPEND_CR4		offsetof(struct cpu_info, ci_suspend_cr4)
361
362if NIOAPIC > 0
363define		IOAPIC_SC_REG		offsetof(struct ioapic_softc, sc_reg)
364define		IOAPIC_SC_DATA		offsetof(struct ioapic_softc, sc_data)
365define		PIC_LOCK		offsetof(struct pic, pic_lock)
366endif
367
368define	SIZEOF_CPU_INFO		sizeof(struct cpu_info)
369define	SIZEOF_ISTUB		sizeof(struct intrstub)
370
371ifdef XEN
372define	SIZEOF_IPLSOURCE	sizeof(struct iplsource)
373define	IS_RECURSE		offsetof(struct iplsource, ipl_recurse)
374define	IS_RESUME		offsetof(struct iplsource, ipl_resume)
375define	IS_HANDLERS		offsetof(struct iplsource, ipl_handlers)
376define	EV_EVCNTL		offsetof(struct evcnt, ev_count)
377else
378define	SIZEOF_ISOURCE		sizeof(struct intrsource)
379define	IS_RECURSE		offsetof(struct intrsource, is_recurse)
380define	IS_RESUME		offsetof(struct intrsource, is_resume)
381define	IS_EVCNTLO		offsetof(struct intrsource, is_evcnt.ev_count)
382define	IS_EVCNTHI		offsetof(struct intrsource, is_evcnt.ev_count)+4
383define	IS_HANDLERS		offsetof(struct intrsource, is_handlers)
384define	IS_PIC			offsetof(struct intrsource, is_pic)
385define	IS_FLAGS		offsetof(struct intrsource, is_flags)
386define	IS_PIN			offsetof(struct intrsource, is_pin)
387define	IS_TYPE			offsetof(struct intrsource, is_type)
388define	IS_MAXLEVEL		offsetof(struct intrsource, is_maxlevel)
389define	IS_LWP			offsetof(struct intrsource, is_lwp)
390endif
391
392define	TREC_SP			offsetof(struct trec, tr_sp)
393define	TREC_HPC		offsetof(struct trec, tr_hpc)
394define	TREC_IPC		offsetof(struct trec, tr_ipc)
395define	TREC_TSC		offsetof(struct trec, tr_tsc)
396define	TREC_LBF		offsetof(struct trec, tr_lbf)
397define	TREC_LBT		offsetof(struct trec, tr_lbt)
398define	TREC_IBF		offsetof(struct trec, tr_ibf)
399define	TREC_IBT		offsetof(struct trec, tr_ibt)
400
401define	SIZEOF_TREC		sizeof(struct trec)
402define	SIZEOF_TLOG		sizeof(struct tlog)
403
404define	IPL_NONE		IPL_NONE
405define	IPL_PREEMPT		IPL_PREEMPT
406define	IPL_SCHED		IPL_SCHED
407define	IPL_CLOCK		IPL_CLOCK
408define	IPL_HIGH		IPL_HIGH
409define	IPL_IPI			IPL_IPI
410
411define	IPL_SOFTNET		IPL_SOFTNET
412define	IPL_SOFTCLOCK		IPL_SOFTCLOCK
413define	IPL_SOFTSERIAL		IPL_SOFTSERIAL
414
415define	LIR_IPI			LIR_IPI
416define	LIR_TIMER		LIR_TIMER
417
418define	SIR_NET			SIR_NET
419define	SIR_CLOCK		SIR_CLOCK
420define	SIR_SERIAL		SIR_SERIAL
421
422define	IREENT_MAGIC		IREENT_MAGIC
423
424define	PSL_AC			PSL_AC
425define	PSL_MBO			PSL_MBO
426define	PSL_ID			PSL_ID
427define	PSL_VM			PSL_VM
428define	PSL_I			PSL_I
429
430define	MTX_IPL			offsetof(struct kmutex, u.s.mtxs_ipl)
431define	MTX_LOCK		offsetof(struct kmutex, mtx_lock)
432define	MTX_OWNER		offsetof(struct kmutex, u.mtxa_owner)
433
434define	RW_OWNER		offsetof(struct krwlock, rw_owner)
435define	RW_WRITE_LOCKED		RW_WRITE_LOCKED
436define	RW_WRITE_WANTED		RW_WRITE_WANTED
437define	RW_READ_INCR		RW_READ_INCR
438define	RW_HAS_WAITERS		RW_HAS_WAITERS
439define	RW_THREAD		RW_THREAD
440define	RW_READER		RW_READER
441define	RW_WRITER		RW_WRITER
442
443define	MB_POINTER		offsetof(struct pmap_mbox, mb_pointer)
444define	MB_GLOBAL		offsetof(struct pmap_mbox, mb_global)
445define	MB_ADDR1		offsetof(struct pmap_mbox, mb_addr1)
446define	MB_ADDR2		offsetof(struct pmap_mbox, mb_addr2)
447define	MB_HEAD			offsetof(struct pmap_mbox, mb_head)
448define	MB_TAIL			offsetof(struct pmap_mbox, mb_tail)
449
450define	PM_CPUS			offsetof(struct pmap, pm_cpus)
451
452define	EV_COUNT		offsetof(struct evcnt, ev_count)
453
454define	OPTERON_MSR_PASSCODE	OPTERON_MSR_PASSCODE
455
456define	X86_BUS_SPACE_IO	X86_BUS_SPACE_IO
457
458define	L1_SHIFT		L1_SHIFT
459define	L2_SHIFT		L2_SHIFT
460define	L2_FRAME		L2_FRAME
461define	PGOFSET			PGOFSET
462define	PGSHIFT			PGSHIFT
463
464ifdef XEN
465define CPU_INFO_VCPU		offsetof(struct cpu_info, ci_vcpu)
466ifdef XEN3
467define START_INFO_SHARED_INFO	offsetof(struct start_info, shared_info)
468define START_INFO_FLAGS		offsetof(struct start_info, flags)
469define START_INFO_CONSOLE_MFN	offsetof(struct start_info, console_mfn)
470define START_INFO_STORE_MFN	offsetof(struct start_info, store_mfn)
471else
472define START_INFO_SHARED_INFO	offsetof(start_info_t, shared_info)
473endif
474define SIF_INITDOMAIN		SIF_INITDOMAIN
475define EVTCHN_UPCALL_PENDING	offsetof(struct vcpu_info, evtchn_upcall_pending)
476define EVTCHN_UPCALL_MASK	offsetof(struct vcpu_info, evtchn_upcall_mask)
477
478define HYPERVISOR_sched_op	__HYPERVISOR_sched_op
479define SCHEDOP_yield		SCHEDOP_yield
480endif
481
482