[BACK]Return to genassym.cf CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / amd64 / amd64

File: [cvs.NetBSD.org] / src / sys / arch / amd64 / amd64 / genassym.cf (download)

Revision 1.8.12.2, Wed Oct 3 19:22:06 2007 UTC (16 years, 6 months ago) by garbled
Branch: ppcoea-renovation
Changes since 1.8.12.1: +20 -3 lines

Sync with HEAD

#	$NetBSD: genassym.cf,v 1.8.12.2 2007/10/03 19:22:06 garbled Exp $

#
# Copyright (c) 1998 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Charles M. Hannum.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#        This product includes software developed by the NetBSD
#        Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

#
# Copyright (c) 1982, 1990 The Regents of the University of California.
# All rights reserved.
#
# This code is derived from software contributed to Berkeley by
# William Jolitz.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#	This product includes software developed by the University of
#	California, Berkeley and its contributors.
# 4. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#	@(#)genassym.c	5.11 (Berkeley) 5/10/91
#

if defined(_KERNEL_OPT)
include "opt_compat_netbsd32.h"
include "opt_compat_linux32.h"
include "opt_multiprocessor.h"
endif

quote #define __MUTEX_PRIVATE
quote #define __RWLOCK_PRIVATE

include <sys/param.h>
include <sys/proc.h>
include <sys/resourcevar.h>
include <sys/device.h>
include <sys/user.h>
include <sys/mbuf.h>
include <sys/mutex.h>
include <sys/rwlock.h>
include <sys/cpu_data.h>
include <sys/evcnt.h>

include <netinet/in.h>
include <netinet/in_systm.h>
include <netinet/ip.h>
include <netinet/ip_var.h>

include <uvm/uvm.h>

include <machine/trap.h>
include <machine/pmap.h>
include <machine/vmparam.h>
include <machine/intr.h>
include <machine/types.h>
include <machine/cpufunc.h>

if defined(COMPAT_NETBSD32)
include <machine/netbsd32_machdep.h>
endif

if defined(COMPAT_LINUX32)
include <machine/linux32_machdep.h>
endif

if defined(_KERNEL) && !defined(_LKM)
include "isa.h"
include "ioapic.h"
endif
if NISA > 0
include <machine/isa_machdep.h>
endif

ifdef MULTIPROCESSOR
include <machine/cpu.h>
endif

if NIOAPIC > 0
include <machine/i82093reg.h>
include <machine/i82093var.h>
endif

include <x86/busdefs.h>

define	LSRUN			LSRUN
define	LSONPROC		LSONPROC

define	L3_SLOT_KERNBASE	pl3_pi(KERNBASE)
define	L2_SLOT_KERNBASE	pl2_pi(KERNBASE)
define	L1_SLOT_KERNBASE	pl1_pi(KERNBASE)

define	VM_MAXUSER_ADDRESS	(unsigned long long)VM_MAXUSER_ADDRESS
define	VM_MIN_KERNEL_ADDRESS	(unsigned long long)VM_MIN_KERNEL_ADDRESS

define	UVM_PAGE_IDLE_ZERO	offsetof(struct uvm, page_idle_zero)

define	L_ADDR			offsetof(struct lwp, l_addr)
define	L_FLAG			offsetof(struct lwp, l_flag)
define	L_PRIORITY		offsetof(struct lwp, l_priority)
define	L_STAT			offsetof(struct lwp, l_stat)
define	L_WCHAN			offsetof(struct lwp, l_wchan)
define	L_PROC			offsetof(struct lwp, l_proc)
define	L_MD_TSS_SEL		offsetof(struct lwp, l_md.md_tss_sel)
define	L_MD_REGS		offsetof(struct lwp, l_md.md_regs)
define	L_MD_FLAGS		offsetof(struct lwp, l_md.md_flags)
define	L_CPU			offsetof(struct lwp, l_cpu)
define	L_MUTEX			offsetof(struct lwp, l_mutex)
define	L_MD_ASTPENDING		offsetof(struct lwp, l_md.md_astpending)

define	PAGE_SIZE		PAGE_SIZE

define	MDP_IRET		MDP_IRET

define	P_FLAG			offsetof(struct proc, p_flag)
define	P_RASLIST		offsetof(struct proc, p_raslist)
define	P_MD_SYSCALL		offsetof(struct proc, p_md.md_syscall)
define	P_MD_FLAGS		offsetof(struct proc, p_md.md_flags)

define	PK_32			PK_32

define	LW_SYSTEM		LW_SYSTEM

define	M_DATA			offsetof(struct mbuf, m_data)
define	M_LEN			offsetof(struct mbuf, m_len)
define	M_NEXT			offsetof(struct mbuf, m_next)

define	IP_SRC			offsetof(struct ip, ip_src)
define	IP_DST			offsetof(struct ip, ip_dst)

define	V_TRAP			offsetof(struct uvmexp, traps)
define	V_INTR			offsetof(struct uvmexp, intrs)

define	PCB_CR3			offsetof(struct pcb, pcb_cr3)
define	PCB_RBP			offsetof(struct pcb, pcb_rbp)
define	PCB_RSP			offsetof(struct pcb, pcb_rsp)
define	PCB_USERSP		offsetof(struct pcb, pcb_usersp)
define	PCB_RSP0		offsetof(struct pcb, pcb_tss.tss_rsp0)
define	PCB_CR0			offsetof(struct pcb, pcb_cr0)
define	PCB_LDT_SEL		offsetof(struct pcb, pcb_ldt_sel)
define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
define	PCB_FPCPU		offsetof(struct pcb, pcb_fpcpu)

define	TF_RDI			offsetof(struct trapframe, tf_rdi)
define	TF_RSI			offsetof(struct trapframe, tf_rsi)
define	TF_RDX			offsetof(struct trapframe, tf_rdx)
define	TF_RCX			offsetof(struct trapframe, tf_rcx)
define	TF_R8			offsetof(struct trapframe, tf_r8)
define	TF_R9			offsetof(struct trapframe, tf_r9)
define	TF_R10			offsetof(struct trapframe, tf_r10)
define	TF_R11			offsetof(struct trapframe, tf_r11)
define	TF_R12			offsetof(struct trapframe, tf_r12)
define	TF_R13			offsetof(struct trapframe, tf_r13)
define	TF_R14			offsetof(struct trapframe, tf_r14)
define	TF_R15			offsetof(struct trapframe, tf_r15)
define	TF_RBP			offsetof(struct trapframe, tf_rbp)
define	TF_RBX			offsetof(struct trapframe, tf_rbx)
define	TF_RAX			offsetof(struct trapframe, tf_rax)
define	TF_GS			offsetof(struct trapframe, tf_gs)
define	TF_FS			offsetof(struct trapframe, tf_fs)
define	TF_ES			offsetof(struct trapframe, tf_es)
define	TF_DS			offsetof(struct trapframe, tf_ds)
define	TF_TRAPNO		offsetof(struct trapframe, tf_trapno)
define	TF_ERR			offsetof(struct trapframe, tf_err)
define	TF_RIP			offsetof(struct trapframe, tf_rip)
define	TF_CS			offsetof(struct trapframe, tf_cs)
define	TF_RFLAGS		offsetof(struct trapframe, tf_rflags)
define	TF_RSP			offsetof(struct trapframe, tf_rsp)
define	TF_SS			offsetof(struct trapframe, tf_ss)

define	FRAMESIZE		sizeof(struct trapframe)

define	CPU_INFO_SCRATCH	offsetof(struct cpu_info, ci_scratch)
define  CPU_INFO_SELF		offsetof(struct cpu_info, ci_self)
define  CPU_INFO_RESCHED	offsetof(struct cpu_info, ci_want_resched)
define	CPU_INFO_PMAP_CPU	offsetof(struct cpu_info, ci_pmap_cpu)
define	CPU_INFO_TLB_EVCNT	offsetof(struct cpu_info, ci_tlb_evcnt)
define  CPU_INFO_CURLWP		offsetof(struct cpu_info, ci_curlwp)
define  CPU_INFO_IDLELWP	offsetof(struct cpu_info, ci_data.cpu_idlelwp)

define  CPU_INFO_GDT		offsetof(struct cpu_info, ci_gdt)
define  CPU_INFO_IPENDING	offsetof(struct cpu_info, ci_ipending)
define  CPU_INFO_IMASK		offsetof(struct cpu_info, ci_imask)
define  CPU_INFO_IUNMASK	offsetof(struct cpu_info, ci_iunmask)
define  CPU_INFO_ILEVEL		offsetof(struct cpu_info, ci_ilevel)
define  CPU_INFO_IDEPTH		offsetof(struct cpu_info, ci_idepth)
define  CPU_INFO_ISOURCES	offsetof(struct cpu_info, ci_isources)
define	CPU_INFO_MTX_COUNT	offsetof(struct cpu_info, ci_mtx_count)
define	CPU_INFO_MTX_OLDSPL	offsetof(struct cpu_info, ci_mtx_oldspl)
define  CPU_INFO_ISTATE		offsetof(struct cpu_info, ci_istate)

if NIOAPIC > 0
define		IOAPIC_SC_REG		offsetof(struct ioapic_softc, sc_reg)
define		IOAPIC_SC_DATA		offsetof(struct ioapic_softc, sc_data)
define		PIC_LOCK		offsetof(struct pic, pic_lock)
endif

define	IH_FUN			offsetof(struct intrhand, ih_fun)
define	IH_ARG			offsetof(struct intrhand, ih_arg)
define	IH_NEXT			offsetof(struct intrhand, ih_next)
define  IH_LEVEL		offsetof(struct intrhand, ih_level)

ifdef COMPAT_NETBSD32
define	SC_FS32			offsetof(struct netbsd32_sigcontext, sc_fs)
define	SC_GS32			offsetof(struct netbsd32_sigcontext, sc_gs)
endif

ifdef COMPAT_LINUX32
define  LINUX32_SF_HANDLER	offsetof(struct linux32_sigframe, sf_handler)
define  LINUX32_SF_SC		offsetof(struct linux32_sigframe, sf_sc)
define  LINUX32_RT_SF_HANDLER	offsetof(struct linux32_rt_sigframe, sf_handler)
define  LINUX32_RT_SF_UC	offsetof(struct linux32_rt_sigframe, sf_uc)
define  LINUX32_SYS_rt_sigreturn	LINUX32_SYS_rt_sigreturn
define  LINUX32_SYS_sigreturn		LINUX32_SYS_sigreturn
define  LINUX32_SYS_exit		LINUX32_SYS_exit
endif

define	IS_RECURSE	offsetof(struct intrsource, is_recurse)
define	IS_RESUME	offsetof(struct intrsource, is_resume)
define	IS_EVCNT	offsetof(struct intrsource, is_evcnt.ev_count)
define	IS_HANDLERS	offsetof(struct intrsource, is_handlers)
define	IS_PIC		offsetof(struct intrsource, is_pic)
define	IS_FLAGS	offsetof(struct intrsource, is_flags)
define	IS_PIN		offsetof(struct intrsource, is_pin)
define	IS_TYPE		offsetof(struct intrsource, is_type)
define	IS_MAXLEVEL	offsetof(struct intrsource, is_maxlevel)

define	MTX_IPL			offsetof(struct kmutex, u.s.mtxs_ipl)
define	MTX_LOCK		offsetof(struct kmutex, u.s.mtxs_lock)
define	MTX_OWNER		offsetof(struct kmutex, u.mtxa_owner)

define	RW_OWNER	offsetof(struct krwlock, rw_owner)
define	RW_WRITE_LOCKED	RW_WRITE_LOCKED
define	RW_WRITE_WANTED	RW_WRITE_WANTED
define	RW_READ_INCR	RW_READ_INCR
define	RW_HAS_WAITERS	RW_HAS_WAITERS
define	RW_THREAD	RW_THREAD
define	RW_READER	RW_READER
define	RW_WRITER	RW_WRITER

define	MB_POINTER		offsetof(struct pmap_mbox, mb_pointer)
define	MB_GLOBAL		offsetof(struct pmap_mbox, mb_global)
define	MB_ADDR1		offsetof(struct pmap_mbox, mb_addr1)
define	MB_ADDR2		offsetof(struct pmap_mbox, mb_addr2)
define	MB_HEAD			offsetof(struct pmap_mbox, mb_head)
define	MB_TAIL			offsetof(struct pmap_mbox, mb_tail)

define	EV_COUNT		offsetof(struct evcnt, ev_count)

define	OPTERON_MSR_PASSCODE	OPTERON_MSR_PASSCODE

define	X86_BUS_SPACE_IO	X86_BUS_SPACE_IO