genassym.cf revision 1.41
11.41Sthorpej#	$NetBSD: genassym.cf,v 1.41 2024/01/16 01:26:34 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.31Stsutsui# 3. Neither the name of the University nor the names of its contributors
161.1Smycroft#    may be used to endorse or promote products derived from this software
171.1Smycroft#    without specific prior written permission.
181.1Smycroft#
191.1Smycroft# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
201.1Smycroft# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
211.1Smycroft# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
221.1Smycroft# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
231.1Smycroft# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
241.1Smycroft# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
251.1Smycroft# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
261.1Smycroft# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
271.1Smycroft# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
281.1Smycroft# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
291.1Smycroft# SUCH DAMAGE.
301.1Smycroft#
311.1Smycroft#	@(#)genassym.c	8.3 (Berkeley) 1/4/94
321.1Smycroft#
331.1Smycroft
341.1Smycroftinclude <sys/param.h>
351.1Smycroftinclude <sys/buf.h>
361.1Smycroftinclude <sys/proc.h>
371.1Smycroftinclude <sys/mbuf.h>
381.1Smycroftinclude <sys/msgbuf.h>
391.24Sthorpejinclude <sys/queue.h>
401.1Smycroftinclude <sys/syscall.h>
411.1Smycroft
421.8Sscwinclude <uvm/uvm_extern.h>
431.8Sscw
441.1Smycroftinclude <machine/cpu.h>
451.40Sthorpejinclude <machine/fcode.h>
461.1Smycroftinclude <machine/psl.h>
471.35Srmindinclude <machine/pcb.h>
481.1Smycroftinclude <machine/prom.h>
491.1Smycroftinclude <machine/pte.h>
501.1Smycroft
511.1Smycroftdefine	__XXX_BUG_FODDER	0
521.1Smycroft
531.1Smycroft# CPU options
541.1Smycroftifdef M68020
551.1Smycroftdefine	M68020			1
561.1Smycroftendif
571.1Smycroftifdef M68030
581.1Smycroftdefine	M68030			1
591.1Smycroftendif
601.1Smycroftifdef M68040
611.1Smycroftdefine	M68040			1
621.1Smycroftendif
631.1Smycroftifdef M68060
641.1Smycroftdefine	M68060			1
651.1Smycroftendif
661.1Smycroft
671.1Smycroft# MMU options
681.1Smycroftdefine	M68K_MMU_MOTOROLA	1
691.1Smycroft
701.41Sthorpejdefine	__HAVE_M68K_INTR_VECTORED	1
711.41Sthorpej
721.1Smycroft# values for mmutype
731.1Smycroftdefine	MMU_68060		MMU_68060
741.1Smycroftdefine	MMU_68040		MMU_68040
751.1Smycroftdefine	MMU_68030		MMU_68030
761.1Smycroftdefine	MMU_68851		MMU_68851
771.1Smycroft
781.1Smycroft# values for cputype
791.1Smycroftdefine	CPU_68020		CPU_68020
801.1Smycroftdefine	CPU_68030		CPU_68030
811.1Smycroftdefine	CPU_68040		CPU_68040
821.1Smycroftdefine	CPU_68060		CPU_68060
831.4Sscw
841.4Sscw# values for fputype
851.4Sscwdefine	FPU_68881		FPU_68881
861.4Sscwdefine	FPU_68882		FPU_68882
871.4Sscwdefine	FPU_68040		FPU_68040
881.18Sscwdefine	FPU_68060		FPU_68060
891.1Smycroft
901.1Smycroft# values for machineid
911.1Smycroftdefine	MVME_147		MVME_147
921.1Smycroftdefine	MVME_162		MVME_162
931.1Smycroftdefine	MVME_166		MVME_166
941.1Smycroftdefine	MVME_167		MVME_167
951.1Smycroftdefine	MVME_172		MVME_172
961.1Smycroftdefine	MVME_177		MVME_177
971.1Smycroft
981.1Smycroft# values for ectype
991.1Smycroftdefine	EC_PHYS			EC_PHYS
1001.1Smycroftdefine	EC_NONE			EC_NONE
1011.1Smycroftdefine	EC_VIRT			EC_VIRT
1021.1Smycroft
1031.1Smycroftdefine	UPAGES			UPAGES
1041.1Smycroftdefine	USPACE			USPACE
1051.25Sthorpejdefine	PAGE_SIZE		PAGE_SIZE
1061.1Smycroftdefine	PGSHIFT			PGSHIFT
1071.8Sscwdefine	USRSTACK		USRSTACK
1081.1Smycroft
1091.1Smycroft# boot stuff
1101.1Smycroftdefine	RB_SBOOT		RB_SBOOT
1111.1Smycroft
1121.1Smycroft# Bug stuff
1131.1Smycroftdefine	MVMEPROM_EXIT		MVMEPROM_EXIT
1141.1Smycroftdefine	MVMEPROM_GETBRDID	MVMEPROM_GETBRDID
1151.1Smycroftdefine	MVMEPROM_OUTSTRCRLF	MVMEPROM_OUTSTRCRLF
1161.1Smycroftdefine	MVMEPROM_BRDID_SIZE	sizeof(struct mvmeprom_brdid)
1171.1Smycroftdefine	MVMEPROM_BRDID_MODEL_OFFSET	offsetof(struct mvmeprom_brdid, model)
1181.1Smycroft
1191.39Sthorpej# MMU configuration constants (from pmap.h)
1201.39Sthorpejexport	MMU51_SRP_BITS
1211.39Sthorpejexport	MMU51_CRP_BITS
1221.39Sthorpejexport	MMU51_TCR_BITS
1231.39Sthorpejexport	MMU40_TCR_BITS
1241.39Sthorpej
1251.24Sthorpej# lwp & proc fields and values
1261.33Srminddefine	L_PCB			offsetof(struct lwp, l_addr)
1271.24Sthorpejdefine	L_PROC			offsetof(struct lwp, l_proc)
1281.24Sthorpejdefine	L_MD_REGS		offsetof(struct lwp, l_md.md_regs)
1291.24Sthorpejdefine	L_MD_FLAGS		offsetof(struct lwp, l_md.md_flags)
1301.24Sthorpejdefine	P_FLAG			offsetof(struct proc, p_flag)
1311.27Sdsldefine	P_RASLIST		offsetof(struct proc, p_raslist)
1321.1Smycroftdefine	P_VMSPACE		offsetof(struct proc, p_vmspace)
1331.1Smycroft
1341.1Smycroft# interrupt/fault metering
1351.34Smattdefine	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
1361.1Smycroft
1371.1Smycroft# PSL values (should just include psl.h?)
1381.1Smycroftdefine	PSL_S			PSL_S
1391.1Smycroftdefine	PSL_IPL7		PSL_IPL7
1401.1Smycroftdefine	PSL_LOWIPL		PSL_LOWIPL
1411.1Smycroftdefine	PSL_HIGHIPL		PSL_HIGHIPL
1421.1Smycroftdefine	PSL_USER		PSL_USER
1431.15Sitohydefine	PSL_TS			PSL_T | PSL_S
1441.1Smycroftdefine	SPL1			PSL_S | PSL_IPL1
1451.1Smycroftdefine	SPL2			PSL_S | PSL_IPL2
1461.1Smycroftdefine	SPL3			PSL_S | PSL_IPL3
1471.1Smycroftdefine	SPL4			PSL_S | PSL_IPL4
1481.1Smycroftdefine	SPL5			PSL_S | PSL_IPL5
1491.1Smycroftdefine	SPL6			PSL_S | PSL_IPL6
1501.1Smycroft
1511.1Smycroft# magic
1521.1Smycroftdefine	FC_USERD		FC_USERD
1531.11Sscwdefine	INTIOBASE147	INTIOBASE147
1541.11Sscwdefine	INTIOTOP147		INTIOTOP147
1551.18Sscwdefine	INTIOBASE1xx	INTIOBASE1xx
1561.18Sscwdefine	INTIOTOP1xx		INTIOTOP1xx
1571.1Smycroftdefine	CACHE_ON		CACHE_ON
1581.1Smycroftdefine	CACHE_OFF		CACHE_OFF
1591.18Sscwdefine	CACHE40_OFF		CACHE40_OFF
1601.1Smycroftdefine	CACHE_CLR		CACHE_CLR
1611.1Smycroftdefine	IC_CLEAR		IC_CLEAR
1621.1Smycroftdefine	DC_CLEAR		DC_CLEAR
1631.18Sscwdefine	IC60_CUBC		IC60_CUBC
1641.18Sscwdefine	IC60_CABC		IC60_CABC
1651.1Smycroft
1661.1Smycroft# pte/ste bits
1671.1Smycroftdefine	PG_V			PG_V
1681.1Smycroftdefine	PG_NV			PG_NV
1691.1Smycroftdefine	PG_RO			PG_RO
1701.1Smycroftdefine	PG_RW			PG_RW
1711.1Smycroftdefine	PG_CI			PG_CI
1721.1Smycroftdefine	PG_PROT			PG_PROT
1731.1Smycroftdefine	PG_FRAME		PG_FRAME
1741.1Smycroftdefine	SG_V			SG_V
1751.1Smycroftdefine	SG_NV			SG_NV
1761.1Smycroftdefine	SG_RW			SG_RW
1771.1Smycroftdefine	SG_FRAME		SG_FRAME
1781.1Smycroftdefine	SG_ISHIFT		SG_ISHIFT
1791.1Smycroft
1801.1Smycroft# pcb fields
1811.1Smycroftdefine	PCB_PS			offsetof(struct pcb, pcb_ps)
1821.1Smycroftdefine	PCB_USP			offsetof(struct pcb, pcb_usp)
1831.1Smycroftdefine	PCB_REGS		offsetof(struct pcb, pcb_regs)
1841.1Smycroftdefine	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
1851.1Smycroftdefine	PCB_FPCTX		offsetof(struct pcb, pcb_fpregs)
1861.1Smycroftdefine	SIZEOF_PCB		sizeof(struct pcb)
1871.24Sthorpej
1881.24Sthorpej# frame offsets
1891.24Sthorpejdefine	TF_PC			offsetof(struct frame, f_pc)
1901.1Smycroft
1911.1Smycroft# exception frame offset/sizes
1921.1Smycroftdefine	FR_SP			offsetof(struct frame, f_regs[15])
1931.1Smycroftdefine	FR_HW			offsetof(struct frame, f_sr)
1941.1Smycroftdefine	FR_ADJ			offsetof(struct frame, f_stackadj)
1951.11Sscwdefine	FR_SIZE			sizeof(struct trapframe)
1961.19Stsutsui
1971.19Stsutsui# FP frame offsets
1981.19Stsutsuidefine	FPF_REGS		offsetof(struct fpframe, fpf_regs[0])
1991.19Stsutsuidefine	FPF_FPCR		offsetof(struct fpframe, fpf_fpcr)
2001.19Stsutsuidefine	FPF_FPSR		offsetof(struct fpframe, fpf_fpsr)
2011.19Stsutsuidefine	FPF_FPI			offsetof(struct fpframe, fpf_fpiar)
2021.1Smycroft
2031.1Smycroft# system calls
2041.1Smycroftdefine	SYS_exit		SYS_exit
2051.1Smycroftdefine	SYS_execve		SYS_execve
2061.26Scldefine	SYS_compat_16___sigreturn14	SYS_compat_16___sigreturn14
2071.10Sthorpejdefine	SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13
2081.1Smycroft
2091.1Smycroft# errno
2101.1Smycroftdefine	EFAULT			EFAULT
2111.1Smycroftdefine	ENAMETOOLONG		ENAMETOOLONG
212