genassym.cf revision 1.9
11.9Smycroft#	$NetBSD: genassym.cf,v 1.9 1998/08/15 05:10:22 mycroft Exp $
21.9Smycroft
31.9Smycroft#
41.9Smycroft# Copyright (c) 1998 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.9Smycroft# by Charles M. Hannum.
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.7Sthorpejinclude "opt_uvm.h"
781.7Sthorpejinclude "opt_pmap_new.h"
791.8Sthorpejinclude "opt_compat_svr4.h"
801.8Sthorpejinclude "opt_compat_freebsd.h"
811.8Sthorpejinclude "opt_compat_linux.h"
821.7Sthorpej
831.1Smycroftinclude <sys/param.h>
841.1Smycroftinclude <sys/proc.h>
851.1Smycroftinclude <sys/resourcevar.h>
861.1Smycroftinclude <sys/device.h>
871.1Smycroftinclude <sys/user.h>
881.1Smycroftinclude <sys/mbuf.h>
891.1Smycroft
901.1Smycroftinclude <vm/vm.h>
911.1Smycroft
921.6Smrgifdef UVM
931.6Smrginclude <uvm/uvm_extern.h>
941.6Smrgendif
951.6Smrg
961.1Smycroftinclude <machine/trap.h>
971.1Smycroftinclude <machine/pmap.h>
981.1Smycroftinclude <machine/vmparam.h>
991.1Smycroft
1001.1Smycroftinclude "apm.h"
1011.1Smycroftif NAPM > 0
1021.3Sjtkinclude <machine/bioscall.h>
1031.1Smycroftinclude <machine/apmvar.h>
1041.1Smycroftendif
1051.1Smycroft
1061.1Smycroftifdef COMPAT_SVR4
1071.1Smycroftinclude <compat/svr4/svr4_ucontext.h>
1081.1Smycroftendif
1091.1Smycroft
1101.1Smycroftifdef COMPAT_LINUX
1111.1Smycroftinclude <machine/linux_machdep.h>
1121.1Smycroftendif
1131.1Smycroft
1141.1Smycroftifdef COMPAT_FREEBSD
1151.1Smycroftinclude <machine/freebsd_machdep.h>
1161.1Smycroftendif
1171.1Smycroft
1181.1Smycroftinclude "isa.h"
1191.1Smycroftif NISA > 0
1201.1Smycroftinclude <i386/isa/isa_machdep.h>
1211.1Smycroftendif
1221.1Smycroft
1231.1Smycroftdefine	SRUN			SRUN
1241.1Smycroft
1251.7Sthorpejifdef PMAP_NEW
1261.6Smrgdefine	PDSLOT_PTE		PDSLOT_PTE
1271.6Smrgdefine	PDSLOT_APTE		PDSLOT_APTE
1281.6Smrgdefine	PDSLOT_KERN		PDSLOT_KERN
1291.6Smrgdefine	NKPTP_MIN		NKPTP_MIN
1301.6Smrgdefine	NKPTP_MAX		NKPTP_MAX
1311.6Smrgelse
1321.1Smycroftdefine	PTDPTDI			PTDPTDI
1331.1Smycroftdefine	KPTDI			KPTDI
1341.1Smycroftdefine	NKPDE_BASE		NKPDE_BASE
1351.1Smycroftdefine	NKPDE_MAX		NKPDE_MAX
1361.1Smycroftdefine	NKPDE_SCALE		NKPDE_SCALE
1371.1Smycroftdefine	APTDPTDI		APTDPTDI
1381.6Smrgendif
1391.1Smycroft
1401.1Smycroftdefine	VM_MAXUSER_ADDRESS	(int)VM_MAXUSER_ADDRESS
1411.1Smycroft
1421.1Smycroftdefine	P_ADDR			offsetof(struct proc, p_addr)
1431.1Smycroftdefine	P_BACK			offsetof(struct proc, p_back)
1441.1Smycroftdefine	P_FORW			offsetof(struct proc, p_forw)
1451.1Smycroftdefine	P_PRIORITY		offsetof(struct proc, p_priority)
1461.1Smycroftdefine	P_STAT			offsetof(struct proc, p_stat)
1471.1Smycroftdefine	P_WCHAN			offsetof(struct proc, p_wchan)
1481.1Smycroftdefine	P_VMSPACE		offsetof(struct proc, p_vmspace)
1491.1Smycroftdefine	P_FLAG			offsetof(struct proc, p_flag)
1501.1Smycroft
1511.1Smycroftdefine	P_SYSTEM		P_SYSTEM
1521.1Smycroft
1531.1Smycroftdefine	M_DATA			offsetof(struct mbuf, m_data)
1541.1Smycroftdefine	M_LEN			offsetof(struct mbuf, m_len)
1551.1Smycroftdefine	M_NEXT			offsetof(struct mbuf, m_next)
1561.1Smycroft
1571.6Smrgifdef UVM
1581.6Smrgdefine	V_TRAP			offsetof(struct uvmexp, traps)
1591.6Smrgdefine	V_INTR			offsetof(struct uvmexp, intrs)
1601.6Smrgelse
1611.1Smycroftdefine	V_TRAP			offsetof(struct vmmeter, v_trap)
1621.1Smycroftdefine	V_INTR			offsetof(struct vmmeter, v_intr)
1631.6Smrgendif
1641.1Smycroft
1651.1Smycroftdefine	PCB_CR3			offsetof(struct pcb, pcb_cr3)
1661.1Smycroftdefine	PCB_EBP			offsetof(struct pcb, pcb_ebp)
1671.1Smycroftdefine	PCB_ESP			offsetof(struct pcb, pcb_esp)
1681.1Smycroftdefine	PCB_FS			offsetof(struct pcb, pcb_fs)
1691.1Smycroftdefine	PCB_GS			offsetof(struct pcb, pcb_gs)
1701.1Smycroftdefine	PCB_CR0			offsetof(struct pcb, pcb_cr0)
1711.1Smycroftdefine	PCB_LDT_SEL		offsetof(struct pcb, pcb_ldt_sel)
1721.1Smycroftdefine	PCB_TSS_SEL		offsetof(struct pcb, pcb_tss_sel)
1731.1Smycroftdefine	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
1741.1Smycroft
1751.1Smycroftdefine	TF_CS			offsetof(struct trapframe, tf_cs)
1761.5Smycroftdefine	TF_EIP			offsetof(struct trapframe, tf_eip)
1771.4Smycroftdefine	TF_ERR			offsetof(struct trapframe, tf_err)
1781.1Smycroftdefine	TF_TRAPNO		offsetof(struct trapframe, tf_trapno)
1791.1Smycroftdefine	TF_EFLAGS		offsetof(struct trapframe, tf_eflags)
1801.1Smycroft
1811.1Smycroftdefine	FRAMESIZE		sizeof(struct trapframe)
1821.1Smycroft
1831.1Smycroftdefine	SIGF_HANDLER		offsetof(struct sigframe, sf_handler)
1841.1Smycroftdefine	SIGF_SC			offsetof(struct sigframe, sf_sc)
1851.1Smycroftdefine	SC_FS			offsetof(struct sigcontext, sc_fs)
1861.1Smycroftdefine	SC_GS			offsetof(struct sigcontext, sc_gs)
1871.1Smycroftdefine	SC_EFLAGS		offsetof(struct sigcontext, sc_eflags)
1881.1Smycroft
1891.1Smycroftifdef COMPAT_SVR4
1901.1Smycroftdefine	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
1911.1Smycroftdefine	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
1921.1Smycroftdefine	SVR4_UC_FS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])
1931.1Smycroftdefine	SVR4_UC_GS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])
1941.1Smycroftdefine	SVR4_UC_EFLAGS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])
1951.1Smycroftendif
1961.1Smycroft
1971.1Smycroftifdef COMPAT_LINUX
1981.1Smycroftdefine	LINUX_SIGF_HANDLER	offsetof(struct linux_sigframe, sf_handler)
1991.1Smycroftdefine	LINUX_SIGF_SC		offsetof(struct linux_sigframe, sf_sc)
2001.1Smycroftdefine	LINUX_SC_FS		offsetof(struct linux_sigcontext, sc_fs)
2011.1Smycroftdefine	LINUX_SC_GS		offsetof(struct linux_sigcontext, sc_gs)
2021.1Smycroftdefine	LINUX_SC_EFLAGS		offsetof(struct linux_sigcontext, sc_eflags)
2031.1Smycroftendif
2041.1Smycroft
2051.1Smycroftifdef COMPAT_FREEBSD
2061.1Smycroftdefine	FREEBSD_SIGF_HANDLER	offsetof(struct freebsd_sigframe, sf_handler)
2071.1Smycroftdefine	FREEBSD_SIGF_SC		offsetof(struct freebsd_sigframe, sf_sc)
2081.1Smycroftendif
2091.1Smycroft
2101.1Smycroftif NISA > 0
2111.1Smycroftdefine	IH_FUN			offsetof(struct intrhand, ih_fun)
2121.1Smycroftdefine	IH_ARG			offsetof(struct intrhand, ih_arg)
2131.1Smycroftdefine	IH_COUNT		offsetof(struct intrhand, ih_count)
2141.1Smycroftdefine	IH_NEXT			offsetof(struct intrhand, ih_next)
2151.1Smycroftendif
2161.1Smycroft
2171.1Smycroftif NAPM > 0
2181.1Smycroftdefine	APM_CODE32		offsetof(struct apm_connect_info, apm_code32_seg_base)
2191.1Smycroftdefine	APM_CODE16		offsetof(struct apm_connect_info, apm_code16_seg_base)
2201.1Smycroftdefine	APM_DATA		offsetof(struct apm_connect_info, apm_data_seg_base)
2211.1Smycroftdefine	APM_CODE32_LEN		offsetof(struct apm_connect_info, apm_code32_seg_len)
2221.1Smycroftdefine	APM_DATA_LEN		offsetof(struct apm_connect_info, apm_data_seg_len)
2231.1Smycroftdefine	APM_ENTRY		offsetof(struct apm_connect_info, apm_entrypt)
2241.1Smycroftdefine	APM_DETAIL		offsetof(struct apm_connect_info, apm_detail)
2251.1Smycroftdefine	APM_SIZE		sizeof(struct apm_connect_info)
2261.3Sjtkdefine	BIOSCALLREG_AX		offsetof(struct bioscallregs, ax)
2271.3Sjtkdefine	BIOSCALLREG_BX		offsetof(struct bioscallregs, bx)
2281.3Sjtkdefine	BIOSCALLREG_CX		offsetof(struct bioscallregs, cx)
2291.3Sjtkdefine	BIOSCALLREG_DX		offsetof(struct bioscallregs, dx)
2301.3Sjtkdefine	BIOSCALLREG_SI		offsetof(struct bioscallregs, si)
2311.3Sjtkdefine	BIOSCALLREG_DI		offsetof(struct bioscallregs, di)
2321.3Sjtkdefine	BIOSCALLREG_FLAGS	offsetof(struct bioscallregs, flags)
2331.1Smycroftendif
234