genassym.cf revision 1.5
1#	$NetBSD: genassym.cf,v 1.5 1997/11/13 03:25:27 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/bioscall.h>
58include <machine/apmvar.h>
59endif
60
61ifdef COMPAT_SVR4
62include <compat/svr4/svr4_ucontext.h>
63endif
64
65ifdef COMPAT_LINUX
66include <machine/linux_machdep.h>
67endif
68
69ifdef COMPAT_FREEBSD
70include <machine/freebsd_machdep.h>
71endif
72
73include "isa.h"
74if NISA > 0
75include <i386/isa/isa_machdep.h>
76endif
77
78define	SRUN			SRUN
79
80define	PTDPTDI			PTDPTDI
81define	KPTDI			KPTDI
82define	NKPDE_BASE		NKPDE_BASE
83define	NKPDE_MAX		NKPDE_MAX
84define	NKPDE_SCALE		NKPDE_SCALE
85define	APTDPTDI		APTDPTDI
86
87define	VM_MAXUSER_ADDRESS	(int)VM_MAXUSER_ADDRESS
88
89define	P_ADDR			offsetof(struct proc, p_addr)
90define	P_BACK			offsetof(struct proc, p_back)
91define	P_FORW			offsetof(struct proc, p_forw)
92define	P_PRIORITY		offsetof(struct proc, p_priority)
93define	P_STAT			offsetof(struct proc, p_stat)
94define	P_WCHAN			offsetof(struct proc, p_wchan)
95define	P_VMSPACE		offsetof(struct proc, p_vmspace)
96define	P_FLAG			offsetof(struct proc, p_flag)
97
98define	P_SYSTEM		P_SYSTEM
99
100define	M_DATA			offsetof(struct mbuf, m_data)
101define	M_LEN			offsetof(struct mbuf, m_len)
102define	M_NEXT			offsetof(struct mbuf, m_next)
103
104define	V_TRAP			offsetof(struct vmmeter, v_trap)
105define	V_INTR			offsetof(struct vmmeter, v_intr)
106
107define	PCB_CR3			offsetof(struct pcb, pcb_cr3)
108define	PCB_EBP			offsetof(struct pcb, pcb_ebp)
109define	PCB_ESP			offsetof(struct pcb, pcb_esp)
110define	PCB_FS			offsetof(struct pcb, pcb_fs)
111define	PCB_GS			offsetof(struct pcb, pcb_gs)
112define	PCB_CR0			offsetof(struct pcb, pcb_cr0)
113define	PCB_LDT_SEL		offsetof(struct pcb, pcb_ldt_sel)
114define	PCB_TSS_SEL		offsetof(struct pcb, pcb_tss_sel)
115define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
116
117define	TF_CS			offsetof(struct trapframe, tf_cs)
118define	TF_EIP			offsetof(struct trapframe, tf_eip)
119define	TF_ERR			offsetof(struct trapframe, tf_err)
120define	TF_TRAPNO		offsetof(struct trapframe, tf_trapno)
121define	TF_EFLAGS		offsetof(struct trapframe, tf_eflags)
122
123define	FRAMESIZE		sizeof(struct trapframe)
124
125define	SIGF_HANDLER		offsetof(struct sigframe, sf_handler)
126define	SIGF_SC			offsetof(struct sigframe, sf_sc)
127define	SC_FS			offsetof(struct sigcontext, sc_fs)
128define	SC_GS			offsetof(struct sigcontext, sc_gs)
129define	SC_EFLAGS		offsetof(struct sigcontext, sc_eflags)
130
131ifdef COMPAT_SVR4
132define	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
133define	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
134define	SVR4_UC_FS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])
135define	SVR4_UC_GS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])
136define	SVR4_UC_EFLAGS		offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])
137endif
138
139ifdef COMPAT_LINUX
140define	LINUX_SIGF_HANDLER	offsetof(struct linux_sigframe, sf_handler)
141define	LINUX_SIGF_SC		offsetof(struct linux_sigframe, sf_sc)
142define	LINUX_SC_FS		offsetof(struct linux_sigcontext, sc_fs)
143define	LINUX_SC_GS		offsetof(struct linux_sigcontext, sc_gs)
144define	LINUX_SC_EFLAGS		offsetof(struct linux_sigcontext, sc_eflags)
145endif
146
147ifdef COMPAT_FREEBSD
148define	FREEBSD_SIGF_HANDLER	offsetof(struct freebsd_sigframe, sf_handler)
149define	FREEBSD_SIGF_SC		offsetof(struct freebsd_sigframe, sf_sc)
150endif
151
152if NISA > 0
153define	IH_FUN			offsetof(struct intrhand, ih_fun)
154define	IH_ARG			offsetof(struct intrhand, ih_arg)
155define	IH_COUNT		offsetof(struct intrhand, ih_count)
156define	IH_NEXT			offsetof(struct intrhand, ih_next)
157endif
158
159if NAPM > 0
160define	APM_CODE32		offsetof(struct apm_connect_info, apm_code32_seg_base)
161define	APM_CODE16		offsetof(struct apm_connect_info, apm_code16_seg_base)
162define	APM_DATA		offsetof(struct apm_connect_info, apm_data_seg_base)
163define	APM_CODE32_LEN		offsetof(struct apm_connect_info, apm_code32_seg_len)
164define	APM_DATA_LEN		offsetof(struct apm_connect_info, apm_data_seg_len)
165define	APM_ENTRY		offsetof(struct apm_connect_info, apm_entrypt)
166define	APM_DETAIL		offsetof(struct apm_connect_info, apm_detail)
167define	APM_SIZE		sizeof(struct apm_connect_info)
168define	BIOSCALLREG_AX		offsetof(struct bioscallregs, ax)
169define	BIOSCALLREG_BX		offsetof(struct bioscallregs, bx)
170define	BIOSCALLREG_CX		offsetof(struct bioscallregs, cx)
171define	BIOSCALLREG_DX		offsetof(struct bioscallregs, dx)
172define	BIOSCALLREG_SI		offsetof(struct bioscallregs, si)
173define	BIOSCALLREG_DI		offsetof(struct bioscallregs, di)
174define	BIOSCALLREG_FLAGS	offsetof(struct bioscallregs, flags)
175endif
176