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