genassym.cf revision 1.8
11.8Sthorpej#	$NetBSD: genassym.cf,v 1.8 1998/06/26 06:54:08 thorpej Exp $
21.1Smycroft
31.1Smycroft#
41.1Smycroft# Copyright (c) 1995, 1997 Charles M. Hannum.  All rights reserved.
51.1Smycroft# Copyright (c) 1982, 1990 The Regents of the University of California.
61.1Smycroft# All rights reserved.
71.1Smycroft#
81.1Smycroft# This code is derived from software contributed to Berkeley by
91.1Smycroft# William Jolitz.
101.1Smycroft#
111.1Smycroft# Redistribution and use in source and binary forms, with or without
121.1Smycroft# modification, are permitted provided that the following conditions
131.1Smycroft# are met:
141.1Smycroft# 1. Redistributions of source code must retain the above copyright
151.1Smycroft#    notice, this list of conditions and the following disclaimer.
161.1Smycroft# 2. Redistributions in binary form must reproduce the above copyright
171.1Smycroft#    notice, this list of conditions and the following disclaimer in the
181.1Smycroft#    documentation and/or other materials provided with the distribution.
191.1Smycroft# 3. All advertising materials mentioning features or use of this software
201.1Smycroft#    must display the following acknowledgement:
211.1Smycroft#	This product includes software developed by the University of
221.1Smycroft#	California, Berkeley and its contributors.
231.1Smycroft# 4. Neither the name of the University nor the names of its contributors
241.1Smycroft#    may be used to endorse or promote products derived from this software
251.1Smycroft#    without specific prior written permission.
261.1Smycroft#
271.1Smycroft# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
281.1Smycroft# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
291.1Smycroft# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
301.1Smycroft# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
311.1Smycroft# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
321.1Smycroft# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
331.1Smycroft# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
341.1Smycroft# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
351.1Smycroft# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
361.1Smycroft# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
371.1Smycroft# SUCH DAMAGE.
381.1Smycroft#
391.1Smycroft#	@(#)genassym.c	5.11 (Berkeley) 5/10/91
401.1Smycroft#
411.1Smycroft
421.7Sthorpejinclude "opt_uvm.h"
431.7Sthorpejinclude "opt_pmap_new.h"
441.8Sthorpejinclude "opt_compat_svr4.h"
451.8Sthorpejinclude "opt_compat_freebsd.h"
461.8Sthorpejinclude "opt_compat_linux.h"
471.7Sthorpej
481.1Smycroftinclude <sys/param.h>
491.1Smycroftinclude <sys/proc.h>
501.1Smycroftinclude <sys/resourcevar.h>
511.1Smycroftinclude <sys/device.h>
521.1Smycroftinclude <sys/user.h>
531.1Smycroftinclude <sys/mbuf.h>
541.1Smycroft
551.1Smycroftinclude <vm/vm.h>
561.1Smycroft
571.6Smrgifdef UVM
581.6Smrginclude <uvm/uvm_extern.h>
591.6Smrgendif
601.6Smrg
611.1Smycroftinclude <machine/trap.h>
621.1Smycroftinclude <machine/pmap.h>
631.1Smycroftinclude <machine/vmparam.h>
641.1Smycroft
651.1Smycroftinclude "apm.h"
661.1Smycroftif NAPM > 0
671.3Sjtkinclude <machine/bioscall.h>
681.1Smycroftinclude <machine/apmvar.h>
691.1Smycroftendif
701.1Smycroft
711.1Smycroftifdef COMPAT_SVR4
721.1Smycroftinclude <compat/svr4/svr4_ucontext.h>
731.1Smycroftendif
741.1Smycroft
751.1Smycroftifdef COMPAT_LINUX
761.1Smycroftinclude <machine/linux_machdep.h>
771.1Smycroftendif
781.1Smycroft
791.1Smycroftifdef COMPAT_FREEBSD
801.1Smycroftinclude <machine/freebsd_machdep.h>
811.1Smycroftendif
821.1Smycroft
831.1Smycroftinclude "isa.h"
841.1Smycroftif NISA > 0
851.1Smycroftinclude <i386/isa/isa_machdep.h>
861.1Smycroftendif
871.1Smycroft
881.1Smycroftdefine	SRUN			SRUN
891.1Smycroft
901.7Sthorpejifdef PMAP_NEW
911.6Smrgdefine	PDSLOT_PTE		PDSLOT_PTE
921.6Smrgdefine	PDSLOT_APTE		PDSLOT_APTE
931.6Smrgdefine	PDSLOT_KERN		PDSLOT_KERN
941.6Smrgdefine	NKPTP_MIN		NKPTP_MIN
951.6Smrgdefine	NKPTP_MAX		NKPTP_MAX
961.6Smrgelse
971.1Smycroftdefine	PTDPTDI			PTDPTDI
981.1Smycroftdefine	KPTDI			KPTDI
991.1Smycroftdefine	NKPDE_BASE		NKPDE_BASE
1001.1Smycroftdefine	NKPDE_MAX		NKPDE_MAX
1011.1Smycroftdefine	NKPDE_SCALE		NKPDE_SCALE
1021.1Smycroftdefine	APTDPTDI		APTDPTDI
1031.6Smrgendif
1041.1Smycroft
1051.1Smycroftdefine	VM_MAXUSER_ADDRESS	(int)VM_MAXUSER_ADDRESS
1061.1Smycroft
1071.1Smycroftdefine	P_ADDR			offsetof(struct proc, p_addr)
1081.1Smycroftdefine	P_BACK			offsetof(struct proc, p_back)
1091.1Smycroftdefine	P_FORW			offsetof(struct proc, p_forw)
1101.1Smycroftdefine	P_PRIORITY		offsetof(struct proc, p_priority)
1111.1Smycroftdefine	P_STAT			offsetof(struct proc, p_stat)
1121.1Smycroftdefine	P_WCHAN			offsetof(struct proc, p_wchan)
1131.1Smycroftdefine	P_VMSPACE		offsetof(struct proc, p_vmspace)
1141.1Smycroftdefine	P_FLAG			offsetof(struct proc, p_flag)
1151.1Smycroft
1161.1Smycroftdefine	P_SYSTEM		P_SYSTEM
1171.1Smycroft
1181.1Smycroftdefine	M_DATA			offsetof(struct mbuf, m_data)
1191.1Smycroftdefine	M_LEN			offsetof(struct mbuf, m_len)
1201.1Smycroftdefine	M_NEXT			offsetof(struct mbuf, m_next)
1211.1Smycroft
1221.6Smrgifdef UVM
1231.6Smrgdefine	V_TRAP			offsetof(struct uvmexp, traps)
1241.6Smrgdefine	V_INTR			offsetof(struct uvmexp, intrs)
1251.6Smrgelse
1261.1Smycroftdefine	V_TRAP			offsetof(struct vmmeter, v_trap)
1271.1Smycroftdefine	V_INTR			offsetof(struct vmmeter, v_intr)
1281.6Smrgendif
1291.1Smycroft
1301.1Smycroftdefine	PCB_CR3			offsetof(struct pcb, pcb_cr3)
1311.1Smycroftdefine	PCB_EBP			offsetof(struct pcb, pcb_ebp)
1321.1Smycroftdefine	PCB_ESP			offsetof(struct pcb, pcb_esp)
1331.1Smycroftdefine	PCB_FS			offsetof(struct pcb, pcb_fs)
1341.1Smycroftdefine	PCB_GS			offsetof(struct pcb, pcb_gs)
1351.1Smycroftdefine	PCB_CR0			offsetof(struct pcb, pcb_cr0)
1361.1Smycroftdefine	PCB_LDT_SEL		offsetof(struct pcb, pcb_ldt_sel)
1371.1Smycroftdefine	PCB_TSS_SEL		offsetof(struct pcb, pcb_tss_sel)
1381.1Smycroftdefine	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
1391.1Smycroft
1401.1Smycroftdefine	TF_CS			offsetof(struct trapframe, tf_cs)
1411.5Smycroftdefine	TF_EIP			offsetof(struct trapframe, tf_eip)
1421.4Smycroftdefine	TF_ERR			offsetof(struct trapframe, tf_err)
1431.1Smycroftdefine	TF_TRAPNO		offsetof(struct trapframe, tf_trapno)
1441.1Smycroftdefine	TF_EFLAGS		offsetof(struct trapframe, tf_eflags)
1451.1Smycroft
1461.1Smycroftdefine	FRAMESIZE		sizeof(struct trapframe)
1471.1Smycroft
1481.1Smycroftdefine	SIGF_HANDLER		offsetof(struct sigframe, sf_handler)
1491.1Smycroftdefine	SIGF_SC			offsetof(struct sigframe, sf_sc)
1501.1Smycroftdefine	SC_FS			offsetof(struct sigcontext, sc_fs)
1511.1Smycroftdefine	SC_GS			offsetof(struct sigcontext, sc_gs)
1521.1Smycroftdefine	SC_EFLAGS		offsetof(struct sigcontext, sc_eflags)
1531.1Smycroft
1541.1Smycroftifdef COMPAT_SVR4
1551.1Smycroftdefine	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
1561.1Smycroftdefine	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
1571.1Smycroftdefine	SVR4_UC_FS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])
1581.1Smycroftdefine	SVR4_UC_GS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])
1591.1Smycroftdefine	SVR4_UC_EFLAGS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])
1601.1Smycroftendif
1611.1Smycroft
1621.1Smycroftifdef COMPAT_LINUX
1631.1Smycroftdefine	LINUX_SIGF_HANDLER	offsetof(struct linux_sigframe, sf_handler)
1641.1Smycroftdefine	LINUX_SIGF_SC		offsetof(struct linux_sigframe, sf_sc)
1651.1Smycroftdefine	LINUX_SC_FS		offsetof(struct linux_sigcontext, sc_fs)
1661.1Smycroftdefine	LINUX_SC_GS		offsetof(struct linux_sigcontext, sc_gs)
1671.1Smycroftdefine	LINUX_SC_EFLAGS		offsetof(struct linux_sigcontext, sc_eflags)
1681.1Smycroftendif
1691.1Smycroft
1701.1Smycroftifdef COMPAT_FREEBSD
1711.1Smycroftdefine	FREEBSD_SIGF_HANDLER	offsetof(struct freebsd_sigframe, sf_handler)
1721.1Smycroftdefine	FREEBSD_SIGF_SC		offsetof(struct freebsd_sigframe, sf_sc)
1731.1Smycroftendif
1741.1Smycroft
1751.1Smycroftif NISA > 0
1761.1Smycroftdefine	IH_FUN			offsetof(struct intrhand, ih_fun)
1771.1Smycroftdefine	IH_ARG			offsetof(struct intrhand, ih_arg)
1781.1Smycroftdefine	IH_COUNT		offsetof(struct intrhand, ih_count)
1791.1Smycroftdefine	IH_NEXT			offsetof(struct intrhand, ih_next)
1801.1Smycroftendif
1811.1Smycroft
1821.1Smycroftif NAPM > 0
1831.1Smycroftdefine	APM_CODE32		offsetof(struct apm_connect_info, apm_code32_seg_base)
1841.1Smycroftdefine	APM_CODE16		offsetof(struct apm_connect_info, apm_code16_seg_base)
1851.1Smycroftdefine	APM_DATA		offsetof(struct apm_connect_info, apm_data_seg_base)
1861.1Smycroftdefine	APM_CODE32_LEN		offsetof(struct apm_connect_info, apm_code32_seg_len)
1871.1Smycroftdefine	APM_DATA_LEN		offsetof(struct apm_connect_info, apm_data_seg_len)
1881.1Smycroftdefine	APM_ENTRY		offsetof(struct apm_connect_info, apm_entrypt)
1891.1Smycroftdefine	APM_DETAIL		offsetof(struct apm_connect_info, apm_detail)
1901.1Smycroftdefine	APM_SIZE		sizeof(struct apm_connect_info)
1911.3Sjtkdefine	BIOSCALLREG_AX		offsetof(struct bioscallregs, ax)
1921.3Sjtkdefine	BIOSCALLREG_BX		offsetof(struct bioscallregs, bx)
1931.3Sjtkdefine	BIOSCALLREG_CX		offsetof(struct bioscallregs, cx)
1941.3Sjtkdefine	BIOSCALLREG_DX		offsetof(struct bioscallregs, dx)
1951.3Sjtkdefine	BIOSCALLREG_SI		offsetof(struct bioscallregs, si)
1961.3Sjtkdefine	BIOSCALLREG_DI		offsetof(struct bioscallregs, di)
1971.3Sjtkdefine	BIOSCALLREG_FLAGS	offsetof(struct bioscallregs, flags)
1981.1Smycroftendif
199