genassym.cf revision 1.24
11.24Sthorpej#	$NetBSD: genassym.cf,v 1.24 2003/01/17 23:42:04 thorpej Exp $
21.1Smycroft
31.1Smycroft#
41.1Smycroft# Copyright (c) 1982, 1990, 1993
51.1Smycroft#	The Regents of the University of California.  All rights reserved.
61.1Smycroft#
71.1Smycroft# Redistribution and use in source and binary forms, with or without
81.1Smycroft# modification, are permitted provided that the following conditions
91.1Smycroft# are met:
101.1Smycroft# 1. Redistributions of source code must retain the above copyright
111.1Smycroft#    notice, this list of conditions and the following disclaimer.
121.1Smycroft# 2. Redistributions in binary form must reproduce the above copyright
131.1Smycroft#    notice, this list of conditions and the following disclaimer in the
141.1Smycroft#    documentation and/or other materials provided with the distribution.
151.1Smycroft# 3. All advertising materials mentioning features or use of this software
161.1Smycroft#    must display the following acknowledgement:
171.1Smycroft#	This product includes software developed by the University of
181.1Smycroft#	California, Berkeley and its contributors.
191.1Smycroft# 4. Neither the name of the University nor the names of its contributors
201.1Smycroft#    may be used to endorse or promote products derived from this software
211.1Smycroft#    without specific prior written permission.
221.1Smycroft#
231.1Smycroft# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
241.1Smycroft# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
251.1Smycroft# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
261.1Smycroft# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
271.1Smycroft# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
281.1Smycroft# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
291.1Smycroft# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
301.1Smycroft# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
311.1Smycroft# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
321.1Smycroft# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
331.1Smycroft# SUCH DAMAGE.
341.1Smycroft#
351.1Smycroft#	@(#)genassym.c	8.3 (Berkeley) 1/4/94
361.1Smycroft#
371.1Smycroft
381.22Sjdolecekif defined(_KERNEL_OPT)
391.13Skleinkinclude "opt_compat_svr4.h"
401.20Sscwendif
411.13Skleink
421.1Smycroftinclude <sys/param.h>
431.1Smycroftinclude <sys/buf.h>
441.1Smycroftinclude <sys/proc.h>
451.1Smycroftinclude <sys/mbuf.h>
461.1Smycroftinclude <sys/msgbuf.h>
471.24Sthorpejinclude <sys/queue.h>
481.1Smycroftinclude <sys/syscall.h>
491.1Smycroftinclude <sys/user.h>
501.1Smycroft
511.8Sscwinclude <uvm/uvm_extern.h>
521.8Sscw
531.13Skleinkifdef COMPAT_SVR4
541.14Skleinkinclude <compat/svr4/svr4_syscall.h>
551.13Skleinkinclude <compat/svr4/svr4_ucontext.h>
561.13Skleinkendif
571.13Skleink
581.1Smycroftinclude <machine/cpu.h>
591.1Smycroftinclude <machine/psl.h>
601.1Smycroftinclude <machine/reg.h>
611.1Smycroftinclude <machine/prom.h>
621.1Smycroftinclude <machine/pte.h>
631.1Smycroft
641.1Smycroftdefine	__XXX_BUG_FODDER	0
651.1Smycroft
661.1Smycroft# CPU options
671.1Smycroftifdef M68020
681.1Smycroftdefine	M68020			1
691.1Smycroftendif
701.1Smycroftifdef M68030
711.1Smycroftdefine	M68030			1
721.1Smycroftendif
731.1Smycroftifdef M68040
741.1Smycroftdefine	M68040			1
751.1Smycroftendif
761.1Smycroftifdef M68060
771.1Smycroftdefine	M68060			1
781.1Smycroftendif
791.1Smycroft
801.1Smycroft# MMU options
811.1Smycroftdefine	M68K_MMU_MOTOROLA	1
821.1Smycroft
831.1Smycroft# values for mmutype
841.1Smycroftdefine	MMU_68060		MMU_68060
851.1Smycroftdefine	MMU_68040		MMU_68040
861.1Smycroftdefine	MMU_68030		MMU_68030
871.1Smycroftdefine	MMU_68851		MMU_68851
881.1Smycroft
891.1Smycroft# values for cputype
901.1Smycroftdefine	CPU_68020		CPU_68020
911.1Smycroftdefine	CPU_68030		CPU_68030
921.1Smycroftdefine	CPU_68040		CPU_68040
931.1Smycroftdefine	CPU_68060		CPU_68060
941.4Sscw
951.4Sscw# values for fputype
961.4Sscwdefine	FPU_68881		FPU_68881
971.4Sscwdefine	FPU_68882		FPU_68882
981.4Sscwdefine	FPU_68040		FPU_68040
991.18Sscwdefine	FPU_68060		FPU_68060
1001.1Smycroft
1011.1Smycroft# values for machineid
1021.1Smycroftdefine	MVME_147		MVME_147
1031.1Smycroftdefine	MVME_162		MVME_162
1041.1Smycroftdefine	MVME_166		MVME_166
1051.1Smycroftdefine	MVME_167		MVME_167
1061.1Smycroftdefine	MVME_172		MVME_172
1071.1Smycroftdefine	MVME_177		MVME_177
1081.1Smycroft
1091.1Smycroft# values for ectype
1101.1Smycroftdefine	EC_PHYS			EC_PHYS
1111.1Smycroftdefine	EC_NONE			EC_NONE
1121.1Smycroftdefine	EC_VIRT			EC_VIRT
1131.1Smycroft
1141.1Smycroftdefine	UPAGES			UPAGES
1151.1Smycroftdefine	USPACE			USPACE
1161.1Smycroftdefine	NBPG			NBPG
1171.1Smycroftdefine	PGSHIFT			PGSHIFT
1181.8Sscwdefine	USRSTACK		USRSTACK
1191.1Smycroft
1201.1Smycroft# boot stuff
1211.1Smycroftdefine	RB_SBOOT		RB_SBOOT
1221.1Smycroft
1231.1Smycroft# Bug stuff
1241.1Smycroftdefine	MVMEPROM_EXIT		MVMEPROM_EXIT
1251.1Smycroftdefine	MVMEPROM_GETBRDID	MVMEPROM_GETBRDID
1261.1Smycroftdefine	MVMEPROM_OUTSTRCRLF	MVMEPROM_OUTSTRCRLF
1271.1Smycroftdefine	MVMEPROM_BRDID_SIZE	sizeof(struct mvmeprom_brdid)
1281.1Smycroftdefine	MVMEPROM_BRDID_MODEL_OFFSET	offsetof(struct mvmeprom_brdid, model)
1291.1Smycroft
1301.24Sthorpej# lwp & proc fields and values
1311.24Sthorpejdefine	L_ADDR			offsetof(struct lwp, l_addr)
1321.24Sthorpejdefine	L_BACK			offsetof(struct lwp, l_back)
1331.24Sthorpejdefine	L_FORW			offsetof(struct lwp, l_forw)
1341.24Sthorpejdefine	L_PRIORITY		offsetof(struct lwp, l_priority)
1351.24Sthorpejdefine	L_STAT			offsetof(struct lwp, l_stat)
1361.24Sthorpejdefine	L_WCHAN			offsetof(struct lwp, l_wchan)
1371.24Sthorpejdefine	L_PROC			offsetof(struct lwp, l_proc)
1381.24Sthorpejdefine	L_MD_REGS		offsetof(struct lwp, l_md.md_regs)
1391.24Sthorpejdefine	L_MD_FLAGS		offsetof(struct lwp, l_md.md_flags)
1401.24Sthorpejdefine	P_FLAG			offsetof(struct proc, p_flag)
1411.24Sthorpejdefine	P_NRAS			offsetof(struct proc, p_nras)
1421.1Smycroftdefine	P_VMSPACE		offsetof(struct proc, p_vmspace)
1431.1Smycroft
1441.24Sthorpej# lwp fields and values
1451.24Sthorpej
1461.24Sthorpejdefine	LSSLEEP			LSSLEEP
1471.24Sthorpejdefine	LSRUN			LSRUN
1481.24Sthorpejdefine	LSONPROC		LSONPROC
1491.1Smycroft
1501.1Smycroft# interrupt/fault metering
1511.8Sscwdefine	UVMEXP_INTRS		offsetof(struct uvmexp, intrs)
1521.1Smycroft
1531.1Smycroft# PSL values (should just include psl.h?)
1541.1Smycroftdefine	PSL_S			PSL_S
1551.1Smycroftdefine	PSL_IPL7		PSL_IPL7
1561.1Smycroftdefine	PSL_LOWIPL		PSL_LOWIPL
1571.1Smycroftdefine	PSL_HIGHIPL		PSL_HIGHIPL
1581.1Smycroftdefine	PSL_USER		PSL_USER
1591.15Sitohydefine	PSL_TS			PSL_T | PSL_S
1601.1Smycroftdefine	SPL1			PSL_S | PSL_IPL1
1611.1Smycroftdefine	SPL2			PSL_S | PSL_IPL2
1621.1Smycroftdefine	SPL3			PSL_S | PSL_IPL3
1631.1Smycroftdefine	SPL4			PSL_S | PSL_IPL4
1641.1Smycroftdefine	SPL5			PSL_S | PSL_IPL5
1651.1Smycroftdefine	SPL6			PSL_S | PSL_IPL6
1661.1Smycroft
1671.1Smycroft# magic
1681.1Smycroftdefine	FC_USERD		FC_USERD
1691.11Sscwdefine	INTIOBASE147	INTIOBASE147
1701.11Sscwdefine	INTIOTOP147		INTIOTOP147
1711.18Sscwdefine	INTIOBASE1xx	INTIOBASE1xx
1721.18Sscwdefine	INTIOTOP1xx		INTIOTOP1xx
1731.1Smycroftdefine	CACHE_ON		CACHE_ON
1741.1Smycroftdefine	CACHE_OFF		CACHE_OFF
1751.18Sscwdefine	CACHE40_OFF		CACHE40_OFF
1761.1Smycroftdefine	CACHE_CLR		CACHE_CLR
1771.1Smycroftdefine	IC_CLEAR		IC_CLEAR
1781.1Smycroftdefine	DC_CLEAR		DC_CLEAR
1791.18Sscwdefine	IC60_CUBC		IC60_CUBC
1801.18Sscwdefine	IC60_CABC		IC60_CABC
1811.1Smycroft
1821.1Smycroft# pte/ste bits
1831.1Smycroftdefine	PG_V			PG_V
1841.1Smycroftdefine	PG_NV			PG_NV
1851.1Smycroftdefine	PG_RO			PG_RO
1861.1Smycroftdefine	PG_RW			PG_RW
1871.1Smycroftdefine	PG_CI			PG_CI
1881.1Smycroftdefine	PG_PROT			PG_PROT
1891.1Smycroftdefine	PG_FRAME		PG_FRAME
1901.1Smycroftdefine	SG_V			SG_V
1911.1Smycroftdefine	SG_NV			SG_NV
1921.1Smycroftdefine	SG_RW			SG_RW
1931.1Smycroftdefine	SG_FRAME		SG_FRAME
1941.1Smycroftdefine	SG_ISHIFT		SG_ISHIFT
1951.1Smycroft
1961.1Smycroft# pcb fields
1971.1Smycroftdefine	PCB_PS			offsetof(struct pcb, pcb_ps)
1981.1Smycroftdefine	PCB_USP			offsetof(struct pcb, pcb_usp)
1991.1Smycroftdefine	PCB_REGS		offsetof(struct pcb, pcb_regs)
2001.1Smycroftdefine	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
2011.1Smycroftdefine	PCB_FPCTX		offsetof(struct pcb, pcb_fpregs)
2021.1Smycroftdefine	SIZEOF_PCB		sizeof(struct pcb)
2031.24Sthorpej
2041.24Sthorpej# frame offsets
2051.24Sthorpejdefine	TF_PC			offsetof(struct frame, f_pc)
2061.1Smycroft
2071.1Smycroft# exception frame offset/sizes
2081.1Smycroftdefine	FR_SP			offsetof(struct frame, f_regs[15])
2091.1Smycroftdefine	FR_HW			offsetof(struct frame, f_sr)
2101.1Smycroftdefine	FR_ADJ			offsetof(struct frame, f_stackadj)
2111.11Sscwdefine	FR_SIZE			sizeof(struct trapframe)
2121.19Stsutsui
2131.19Stsutsui# FP frame offsets
2141.19Stsutsuidefine	FPF_REGS		offsetof(struct fpframe, fpf_regs[0])
2151.19Stsutsuidefine	FPF_FPCR		offsetof(struct fpframe, fpf_fpcr)
2161.19Stsutsuidefine	FPF_FPSR		offsetof(struct fpframe, fpf_fpsr)
2171.19Stsutsuidefine	FPF_FPI			offsetof(struct fpframe, fpf_fpiar)
2181.1Smycroft
2191.1Smycroft# system calls
2201.1Smycroftdefine	SYS_exit		SYS_exit
2211.1Smycroftdefine	SYS_execve		SYS_execve
2221.9Sthorpejdefine	SYS___sigreturn14	SYS___sigreturn14
2231.10Sthorpejdefine	SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13
2241.1Smycroft
2251.1Smycroft# errno
2261.1Smycroftdefine	EFAULT			EFAULT
2271.1Smycroftdefine	ENAMETOOLONG		ENAMETOOLONG
2281.13Skleink
2291.13Skleink# SVR4 binary compatibility
2301.13Skleinkifdef COMPAT_SVR4
2311.13Skleinkdefine SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
2321.13Skleinkdefine SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
2331.13Skleinkdefine SVR4_SYS_context		SVR4_SYS_context
2341.13Skleinkdefine SVR4_SYS_exit		SVR4_SYS_exit
2351.13Skleinkdefine SVR4_SETCONTEXT		SVR4_SETCONTEXT
2361.13Skleinkendif
237