genassym.cf revision 1.7
11.7Sthorpej#	$NetBSD: genassym.cf,v 1.7 1998/02/11 03:05:35 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.7Sthorpej
451.1Smycroftinclude <sys/param.h>
461.1Smycroftinclude <sys/proc.h>
471.1Smycroftinclude <sys/resourcevar.h>
481.1Smycroftinclude <sys/device.h>
491.1Smycroftinclude <sys/user.h>
501.1Smycroftinclude <sys/mbuf.h>
511.1Smycroft
521.1Smycroftinclude <vm/vm.h>
531.1Smycroft
541.6Smrgifdef UVM
551.6Smrginclude <uvm/uvm_extern.h>
561.6Smrgendif
571.6Smrg
581.1Smycroftinclude <machine/trap.h>
591.1Smycroftinclude <machine/pmap.h>
601.1Smycroftinclude <machine/vmparam.h>
611.1Smycroft
621.1Smycroftinclude "apm.h"
631.1Smycroftif NAPM > 0
641.3Sjtkinclude <machine/bioscall.h>
651.1Smycroftinclude <machine/apmvar.h>
661.1Smycroftendif
671.1Smycroft
681.1Smycroftifdef COMPAT_SVR4
691.1Smycroftinclude <compat/svr4/svr4_ucontext.h>
701.1Smycroftendif
711.1Smycroft
721.1Smycroftifdef COMPAT_LINUX
731.1Smycroftinclude <machine/linux_machdep.h>
741.1Smycroftendif
751.1Smycroft
761.1Smycroftifdef COMPAT_FREEBSD
771.1Smycroftinclude <machine/freebsd_machdep.h>
781.1Smycroftendif
791.1Smycroft
801.1Smycroftinclude "isa.h"
811.1Smycroftif NISA > 0
821.1Smycroftinclude <i386/isa/isa_machdep.h>
831.1Smycroftendif
841.1Smycroft
851.1Smycroftdefine	SRUN			SRUN
861.1Smycroft
871.7Sthorpejifdef PMAP_NEW
881.6Smrgdefine	PDSLOT_PTE		PDSLOT_PTE
891.6Smrgdefine	PDSLOT_APTE		PDSLOT_APTE
901.6Smrgdefine	PDSLOT_KERN		PDSLOT_KERN
911.6Smrgdefine	NKPTP_MIN		NKPTP_MIN
921.6Smrgdefine	NKPTP_MAX		NKPTP_MAX
931.6Smrgelse
941.1Smycroftdefine	PTDPTDI			PTDPTDI
951.1Smycroftdefine	KPTDI			KPTDI
961.1Smycroftdefine	NKPDE_BASE		NKPDE_BASE
971.1Smycroftdefine	NKPDE_MAX		NKPDE_MAX
981.1Smycroftdefine	NKPDE_SCALE		NKPDE_SCALE
991.1Smycroftdefine	APTDPTDI		APTDPTDI
1001.6Smrgendif
1011.1Smycroft
1021.1Smycroftdefine	VM_MAXUSER_ADDRESS	(int)VM_MAXUSER_ADDRESS
1031.1Smycroft
1041.1Smycroftdefine	P_ADDR			offsetof(struct proc, p_addr)
1051.1Smycroftdefine	P_BACK			offsetof(struct proc, p_back)
1061.1Smycroftdefine	P_FORW			offsetof(struct proc, p_forw)
1071.1Smycroftdefine	P_PRIORITY		offsetof(struct proc, p_priority)
1081.1Smycroftdefine	P_STAT			offsetof(struct proc, p_stat)
1091.1Smycroftdefine	P_WCHAN			offsetof(struct proc, p_wchan)
1101.1Smycroftdefine	P_VMSPACE		offsetof(struct proc, p_vmspace)
1111.1Smycroftdefine	P_FLAG			offsetof(struct proc, p_flag)
1121.1Smycroft
1131.1Smycroftdefine	P_SYSTEM		P_SYSTEM
1141.1Smycroft
1151.1Smycroftdefine	M_DATA			offsetof(struct mbuf, m_data)
1161.1Smycroftdefine	M_LEN			offsetof(struct mbuf, m_len)
1171.1Smycroftdefine	M_NEXT			offsetof(struct mbuf, m_next)
1181.1Smycroft
1191.6Smrgifdef UVM
1201.6Smrgdefine	V_TRAP			offsetof(struct uvmexp, traps)
1211.6Smrgdefine	V_INTR			offsetof(struct uvmexp, intrs)
1221.6Smrgelse
1231.1Smycroftdefine	V_TRAP			offsetof(struct vmmeter, v_trap)
1241.1Smycroftdefine	V_INTR			offsetof(struct vmmeter, v_intr)
1251.6Smrgendif
1261.1Smycroft
1271.1Smycroftdefine	PCB_CR3			offsetof(struct pcb, pcb_cr3)
1281.1Smycroftdefine	PCB_EBP			offsetof(struct pcb, pcb_ebp)
1291.1Smycroftdefine	PCB_ESP			offsetof(struct pcb, pcb_esp)
1301.1Smycroftdefine	PCB_FS			offsetof(struct pcb, pcb_fs)
1311.1Smycroftdefine	PCB_GS			offsetof(struct pcb, pcb_gs)
1321.1Smycroftdefine	PCB_CR0			offsetof(struct pcb, pcb_cr0)
1331.1Smycroftdefine	PCB_LDT_SEL		offsetof(struct pcb, pcb_ldt_sel)
1341.1Smycroftdefine	PCB_TSS_SEL		offsetof(struct pcb, pcb_tss_sel)
1351.1Smycroftdefine	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
1361.1Smycroft
1371.1Smycroftdefine	TF_CS			offsetof(struct trapframe, tf_cs)
1381.5Smycroftdefine	TF_EIP			offsetof(struct trapframe, tf_eip)
1391.4Smycroftdefine	TF_ERR			offsetof(struct trapframe, tf_err)
1401.1Smycroftdefine	TF_TRAPNO		offsetof(struct trapframe, tf_trapno)
1411.1Smycroftdefine	TF_EFLAGS		offsetof(struct trapframe, tf_eflags)
1421.1Smycroft
1431.1Smycroftdefine	FRAMESIZE		sizeof(struct trapframe)
1441.1Smycroft
1451.1Smycroftdefine	SIGF_HANDLER		offsetof(struct sigframe, sf_handler)
1461.1Smycroftdefine	SIGF_SC			offsetof(struct sigframe, sf_sc)
1471.1Smycroftdefine	SC_FS			offsetof(struct sigcontext, sc_fs)
1481.1Smycroftdefine	SC_GS			offsetof(struct sigcontext, sc_gs)
1491.1Smycroftdefine	SC_EFLAGS		offsetof(struct sigcontext, sc_eflags)
1501.1Smycroft
1511.1Smycroftifdef COMPAT_SVR4
1521.1Smycroftdefine	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
1531.1Smycroftdefine	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
1541.1Smycroftdefine	SVR4_UC_FS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])
1551.1Smycroftdefine	SVR4_UC_GS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])
1561.1Smycroftdefine	SVR4_UC_EFLAGS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])
1571.1Smycroftendif
1581.1Smycroft
1591.1Smycroftifdef COMPAT_LINUX
1601.1Smycroftdefine	LINUX_SIGF_HANDLER	offsetof(struct linux_sigframe, sf_handler)
1611.1Smycroftdefine	LINUX_SIGF_SC		offsetof(struct linux_sigframe, sf_sc)
1621.1Smycroftdefine	LINUX_SC_FS		offsetof(struct linux_sigcontext, sc_fs)
1631.1Smycroftdefine	LINUX_SC_GS		offsetof(struct linux_sigcontext, sc_gs)
1641.1Smycroftdefine	LINUX_SC_EFLAGS		offsetof(struct linux_sigcontext, sc_eflags)
1651.1Smycroftendif
1661.1Smycroft
1671.1Smycroftifdef COMPAT_FREEBSD
1681.1Smycroftdefine	FREEBSD_SIGF_HANDLER	offsetof(struct freebsd_sigframe, sf_handler)
1691.1Smycroftdefine	FREEBSD_SIGF_SC		offsetof(struct freebsd_sigframe, sf_sc)
1701.1Smycroftendif
1711.1Smycroft
1721.1Smycroftif NISA > 0
1731.1Smycroftdefine	IH_FUN			offsetof(struct intrhand, ih_fun)
1741.1Smycroftdefine	IH_ARG			offsetof(struct intrhand, ih_arg)
1751.1Smycroftdefine	IH_COUNT		offsetof(struct intrhand, ih_count)
1761.1Smycroftdefine	IH_NEXT			offsetof(struct intrhand, ih_next)
1771.1Smycroftendif
1781.1Smycroft
1791.1Smycroftif NAPM > 0
1801.1Smycroftdefine	APM_CODE32		offsetof(struct apm_connect_info, apm_code32_seg_base)
1811.1Smycroftdefine	APM_CODE16		offsetof(struct apm_connect_info, apm_code16_seg_base)
1821.1Smycroftdefine	APM_DATA		offsetof(struct apm_connect_info, apm_data_seg_base)
1831.1Smycroftdefine	APM_CODE32_LEN		offsetof(struct apm_connect_info, apm_code32_seg_len)
1841.1Smycroftdefine	APM_DATA_LEN		offsetof(struct apm_connect_info, apm_data_seg_len)
1851.1Smycroftdefine	APM_ENTRY		offsetof(struct apm_connect_info, apm_entrypt)
1861.1Smycroftdefine	APM_DETAIL		offsetof(struct apm_connect_info, apm_detail)
1871.1Smycroftdefine	APM_SIZE		sizeof(struct apm_connect_info)
1881.3Sjtkdefine	BIOSCALLREG_AX		offsetof(struct bioscallregs, ax)
1891.3Sjtkdefine	BIOSCALLREG_BX		offsetof(struct bioscallregs, bx)
1901.3Sjtkdefine	BIOSCALLREG_CX		offsetof(struct bioscallregs, cx)
1911.3Sjtkdefine	BIOSCALLREG_DX		offsetof(struct bioscallregs, dx)
1921.3Sjtkdefine	BIOSCALLREG_SI		offsetof(struct bioscallregs, si)
1931.3Sjtkdefine	BIOSCALLREG_DI		offsetof(struct bioscallregs, di)
1941.3Sjtkdefine	BIOSCALLREG_FLAGS	offsetof(struct bioscallregs, flags)
1951.1Smycroftendif
196