genassym.cf revision 1.1
1#	$NetBSD: genassym.cf,v 1.1 1997/04/15 06:11:40 scottr Exp $
2
3#
4# Copyright (c) 1990 The Regents of the University of California.
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15# 3. All advertising materials mentioning features or use of this software
16#    must display the following acknowledgement:
17#	This product includes software developed by the University of
18#	California, Berkeley and its contributors.
19# 4. Neither the name of the University nor the names of its contributors
20#    may be used to endorse or promote products derived from this software
21#    without specific prior written permission.
22#
23# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33# SUCH DAMAGE.
34#
35#	@(#)genassym.c	7.8 (Berkeley) 5/7/91
36#
37
38include	<sys/param.h>
39include	<sys/buf.h>
40include	<sys/proc.h>
41include	<sys/mbuf.h>
42include	<sys/msgbuf.h>
43include	<sys/syscall.h>
44include	<sys/systm.h>
45include	<sys/types.h>
46include	<sys/user.h>
47
48include	<vm/vm.h>
49
50include	<machine/cpu.h>
51include	<machine/trap.h>
52include	<machine/psl.h>
53include	<machine/reg.h>
54include	<machine/pte.h>
55
56define	P_FORW			offsetof(struct proc, p_forw)
57define	P_BACK			offsetof(struct proc, p_back)
58define	P_VMSPACE		offsetof(struct proc, p_vmspace)
59define	P_ADDR			offsetof(struct proc, p_addr)
60define	P_MD			offsetof(struct proc, p_md)
61define	P_PID			offsetof(struct proc, p_pid)
62define	P_PRIORITY		offsetof(struct proc, p_priority)
63define	P_STAT			offsetof(struct proc, p_stat)
64define	P_WCHAN 		offsetof(struct proc, p_wchan)
65define	P_FLAG			offsetof(struct proc, p_flag)
66define	P_MD_REGS		offsetof(struct proc, p_md.md_regs)
67define	P_MD_FLAGS		offsetof(struct proc, p_md.md_flags)
68define	SSLEEP			SSLEEP
69define	SRUN			SRUN
70
71define	MD_REGS 		offsetof(struct mdproc, md_regs)
72
73define	PM_STCHG		offsetof(struct pmap, pm_stchanged)
74
75define	VM_PMAP 		offsetof(struct vmspace, vm_pmap)
76define	V_SWTCH 		offsetof(struct vmmeter, v_swtch)
77define	V_TRAP			offsetof(struct vmmeter, v_trap)
78define	V_SYSCALL		offsetof(struct vmmeter, v_syscall)
79define	V_INTR			offsetof(struct vmmeter, v_intr)
80define	V_SOFT			offsetof(struct vmmeter, v_soft)
81
82define	UPAGES			UPAGES
83define	USPACE			USPACE
84define	P1PAGES 		P1PAGES
85define	CLSIZE			CLSIZE
86define	NBPG			NBPG
87define	NPTEPG			NPTEPG
88define	PGSHIFT 		PGSHIFT
89define	SYSPTSIZE		SYSPTSIZE
90define	USRPTSIZE		USRPTSIZE
91define	USRIOSIZE		USRIOSIZE
92define	USRSTACK		USRSTACK
93
94define	MSGBUFPTECNT		btoc(sizeof (struct msgbuf))
95define	NMBCLUSTERS		NMBCLUSTERS
96define	MCLBYTES		MCLBYTES
97define	NKMEMCLUSTERS		NKMEMCLUSTERS
98
99quote	#ifdef SYSVSHM
100define	SHMMAXPGS		SHMMAXPGS
101quote	#endif
102
103define	U_PROF			offsetof(struct user, u_stats.p_prof)
104define	U_PROFSCALE		offsetof(struct user, u_stats.p_prof.pr_scale)
105define	RU_MINFLT		offsetof(struct rusage, ru_minflt)
106
107define	T_BUSERR		T_BUSERR
108define	T_ADDRERR		T_ADDRERR
109define	T_ILLINST		T_ILLINST
110define	T_ZERODIV		T_ZERODIV
111define	T_CHKINST		T_CHKINST
112define	T_TRAPVINST		T_TRAPVINST
113define	T_PRIVINST		T_PRIVINST
114define	T_TRACE 		T_TRACE
115define	T_MMUFLT		T_MMUFLT
116define	T_SSIR			T_SSIR
117define	T_FMTERR		T_FMTERR
118define	T_COPERR		T_COPERR
119define	T_FPERR 		T_FPERR
120define	T_ASTFLT		T_ASTFLT
121define	T_TRAP15		T_TRAP15
122define	T_FPEMULI		T_FPEMULI
123define	T_FPEMULD		T_FPEMULD
124
125define	PSL_S			PSL_S
126define	PSL_IPL7		PSL_IPL7
127define	PSL_LOWIPL		PSL_LOWIPL
128define	PSL_HIGHIPL		PSL_HIGHIPL
129define	PSL_USER		PSL_USER
130define	SPL1			(PSL_S | PSL_IPL1)
131define	SPL2			(PSL_S | PSL_IPL2)
132define	SPL3			(PSL_S | PSL_IPL3)
133define	SPL4			(PSL_S | PSL_IPL4)
134define	SPL5			(PSL_S | PSL_IPL5)
135define	SPL6			(PSL_S | PSL_IPL6)
136
137define	FC_USERD		FC_USERD
138define	FC_SUPERD		FC_SUPERD
139
140define	CACHE_ON		CACHE_ON
141define	CACHE_OFF		CACHE_OFF
142define	CACHE_CLR		CACHE_CLR
143define	CACHE40_ON		CACHE40_ON
144define	CACHE40_OFF		CACHE40_OFF
145define	IC_CLEAR		IC_CLEAR
146define	DC_CLEAR		DC_CLEAR
147
148define	PG_FRAME		PG_FRAME
149
150define	SIZEOF_PCB		sizeof(struct pcb)
151define	PCB_FLAGS		offsetof(struct pcb, pcb_flags)
152define	PCB_PS			offsetof(struct pcb, pcb_ps)
153define	PCB_USTP		offsetof(struct pcb, pcb_ustp)
154define	PCB_USP 		offsetof(struct pcb, pcb_usp)
155define	PCB_REGS		offsetof(struct pcb, pcb_regs)
156define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
157define	PCB_FPCTX		offsetof(struct pcb, pcb_fpregs)
158define	PCB_TRCB		5
159
160define	FR_SP			offsetof(struct frame, f_regs[15])
161define	FR_HW			offsetof(struct frame, f_sr)
162define	FR_ADJ			offsetof(struct frame, f_stackadj)
163
164define	B_READ			B_READ
165
166define	ENOENT			ENOENT
167define	EFAULT			EFAULT
168define	ENAMETOOLONG		ENAMETOOLONG
169
170define	SYS_exit		SYS_exit
171define	SYS_execve		SYS_execve
172define	SYS_sigreturn		SYS_sigreturn
173
174define	CPU_68020		CPU_68020
175define	CPU_68030		CPU_68030
176define	CPU_68040		CPU_68040
177
178define	MMU_68851		MMU_68851
179define	MMU_68030		MMU_68030
180define	MMU_68040		MMU_68040
181
182define	FPU_68881		FPU_68881
183define	FPU_68882		FPU_68882
184define	FPU_68040		FPU_68040
185