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