genassym.cf revision 1.1
1#	$NetBSD: genassym.cf,v 1.1 1997/02/26 23:50:07 mycroft Exp $
2
3#
4# Copyright (c) 1995, 1997 Charles M. Hannum.  All rights reserved.
5# Copyright (c) 1982, 1990 The Regents of the University of California.
6# All rights reserved.
7#
8# This code is derived from software contributed to Berkeley by
9# William Jolitz.
10#
11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions
13# are met:
14# 1. Redistributions of source code must retain the above copyright
15#    notice, this list of conditions and the following disclaimer.
16# 2. Redistributions in binary form must reproduce the above copyright
17#    notice, this list of conditions and the following disclaimer in the
18#    documentation and/or other materials provided with the distribution.
19# 3. All advertising materials mentioning features or use of this software
20#    must display the following acknowledgement:
21#	This product includes software developed by the University of
22#	California, Berkeley and its contributors.
23# 4. Neither the name of the University nor the names of its contributors
24#    may be used to endorse or promote products derived from this software
25#    without specific prior written permission.
26#
27# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37# SUCH DAMAGE.
38#
39#	@(#)genassym.c	5.11 (Berkeley) 5/10/91
40#
41
42include <sys/param.h>
43include <sys/proc.h>
44include <sys/resourcevar.h>
45include <sys/device.h>
46include <sys/user.h>
47include <sys/mbuf.h>
48
49include <vm/vm.h>
50
51include <machine/trap.h>
52include <machine/pmap.h>
53include <machine/vmparam.h>
54
55include "apm.h"
56if NAPM > 0
57include <machine/apmvar.h>
58endif
59
60ifdef COMPAT_SVR4
61include <compat/svr4/svr4_ucontext.h>
62endif
63
64ifdef COMPAT_LINUX
65include <machine/linux_machdep.h>
66endif
67
68ifdef COMPAT_FREEBSD
69include <machine/freebsd_machdep.h>
70endif
71
72include "isa.h"
73if NISA > 0
74include <i386/isa/isa_machdep.h>
75endif
76
77define	SRUN			SRUN
78
79define	PTDPTDI			PTDPTDI
80define	KPTDI			KPTDI
81define	NKPDE_BASE		NKPDE_BASE
82define	NKPDE_MAX		NKPDE_MAX
83define	NKPDE_SCALE		NKPDE_SCALE
84define	APTDPTDI		APTDPTDI
85
86define	VM_MAXUSER_ADDRESS	(int)VM_MAXUSER_ADDRESS
87
88define	P_ADDR			offsetof(struct proc, p_addr)
89define	P_BACK			offsetof(struct proc, p_back)
90define	P_FORW			offsetof(struct proc, p_forw)
91define	P_PRIORITY		offsetof(struct proc, p_priority)
92define	P_STAT			offsetof(struct proc, p_stat)
93define	P_WCHAN			offsetof(struct proc, p_wchan)
94define	P_VMSPACE		offsetof(struct proc, p_vmspace)
95define	P_FLAG			offsetof(struct proc, p_flag)
96
97define	P_SYSTEM		P_SYSTEM
98
99define	M_DATA			offsetof(struct mbuf, m_data)
100define	M_LEN			offsetof(struct mbuf, m_len)
101define	M_NEXT			offsetof(struct mbuf, m_next)
102
103define	V_TRAP			offsetof(struct vmmeter, v_trap)
104define	V_INTR			offsetof(struct vmmeter, v_intr)
105
106define	PCB_CR3			offsetof(struct pcb, pcb_cr3)
107define	PCB_EBP			offsetof(struct pcb, pcb_ebp)
108define	PCB_ESP			offsetof(struct pcb, pcb_esp)
109define	PCB_FS			offsetof(struct pcb, pcb_fs)
110define	PCB_GS			offsetof(struct pcb, pcb_gs)
111define	PCB_CR0			offsetof(struct pcb, pcb_cr0)
112define	PCB_LDT_SEL		offsetof(struct pcb, pcb_ldt_sel)
113define	PCB_TSS_SEL		offsetof(struct pcb, pcb_tss_sel)
114define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
115
116define	TF_CS			offsetof(struct trapframe, tf_cs)
117define	TF_TRAPNO		offsetof(struct trapframe, tf_trapno)
118define	TF_EFLAGS		offsetof(struct trapframe, tf_eflags)
119
120define	FRAMESIZE		sizeof(struct trapframe)
121
122define	SIGF_HANDLER		offsetof(struct sigframe, sf_handler)
123define	SIGF_SC			offsetof(struct sigframe, sf_sc)
124define	SC_FS			offsetof(struct sigcontext, sc_fs)
125define	SC_GS			offsetof(struct sigcontext, sc_gs)
126define	SC_EFLAGS		offsetof(struct sigcontext, sc_eflags)
127
128ifdef COMPAT_SVR4
129define	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
130define	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
131define	SVR4_UC_FS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])
132define	SVR4_UC_GS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])
133define	SVR4_UC_EFLAGS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])
134endif
135
136ifdef COMPAT_LINUX
137define	LINUX_SIGF_HANDLER	offsetof(struct linux_sigframe, sf_handler)
138define	LINUX_SIGF_SC		offsetof(struct linux_sigframe, sf_sc)
139define	LINUX_SC_FS		offsetof(struct linux_sigcontext, sc_fs)
140define	LINUX_SC_GS		offsetof(struct linux_sigcontext, sc_gs)
141define	LINUX_SC_EFLAGS		offsetof(struct linux_sigcontext, sc_eflags)
142endif
143
144ifdef COMPAT_FREEBSD
145define	FREEBSD_SIGF_HANDLER	offsetof(struct freebsd_sigframe, sf_handler)
146define	FREEBSD_SIGF_SC		offsetof(struct freebsd_sigframe, sf_sc)
147endif
148
149if NISA > 0
150define	IH_FUN			offsetof(struct intrhand, ih_fun)
151define	IH_ARG			offsetof(struct intrhand, ih_arg)
152define	IH_COUNT		offsetof(struct intrhand, ih_count)
153define	IH_NEXT			offsetof(struct intrhand, ih_next)
154endif
155
156if NAPM > 0
157define	APM_CODE32		offsetof(struct apm_connect_info, apm_code32_seg_base)
158define	APM_CODE16		offsetof(struct apm_connect_info, apm_code16_seg_base)
159define	APM_DATA		offsetof(struct apm_connect_info, apm_data_seg_base)
160define	APM_CODE32_LEN		offsetof(struct apm_connect_info, apm_code32_seg_len)
161define	APM_DATA_LEN		offsetof(struct apm_connect_info, apm_data_seg_len)
162define	APM_ENTRY		offsetof(struct apm_connect_info, apm_entrypt)
163define	APM_DETAIL		offsetof(struct apm_connect_info, apm_detail)
164define	APM_SIZE		sizeof(struct apm_connect_info)
165define	APMREG_AX		offsetof(struct apmregs, ax)
166define	APMREG_BX		offsetof(struct apmregs, bx)
167define	APMREG_CX		offsetof(struct apmregs, cx)
168define	APMREG_DX		offsetof(struct apmregs, dx)
169define	APMREG_SI		offsetof(struct apmregs, si)
170define	APMREG_DI		offsetof(struct apmregs, di)
171define	APMREG_FLAGS		offsetof(struct apmregs, flags)
172endif
173