genassym.cf revision 1.34
1#	$NetBSD: genassym.cf,v 1.34 2007/09/15 09:25:21 scw Exp $
2
3# Copyright (c) 1982, 1990 The Regents of the University of California.
4# All rights reserved.
5#
6# This code is derived from software contributed to Berkeley by
7# William Jolitz.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions
11# are met:
12# 1. Redistributions of source code must retain the above copyright
13#    notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright
15#    notice, this list of conditions and the following disclaimer in the
16#    documentation and/or other materials provided with the distribution.
17# 3. All advertising materials mentioning features or use of this software
18#    must display the following acknowledgement:
19#	This product includes software developed by the University of
20#	California, Berkeley and its contributors.
21# 4. Neither the name of the University nor the names of its contributors
22#    may be used to endorse or promote products derived from this software
23#    without specific prior written permission.
24#
25# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35# SUCH DAMAGE.
36
37include <sys/param.h>
38include <sys/systm.h>
39include <sys/mbuf.h>
40include <sys/proc.h>
41include <sys/resourcevar.h>
42include <sys/device.h>
43include <sys/user.h>
44include <sys/signal.h>
45include <netinet/in.h>
46include <netinet/in_systm.h>
47include <netinet/ip.h>
48include <netinet/ip6.h>
49include <netinet/ip_var.h>
50
51include <uvm/uvm_extern.h>
52
53include <arm/fiq.h>
54
55include <machine/pmap.h>
56include <machine/frame.h>
57include <machine/vmparam.h>
58
59include "opt_multiprocessor.h"
60include "opt_compat_netbsd.h"
61include "opt_execfmt.h"
62
63define	__PROG32		1
64ifdef __ARM_FIQ_INDIRECT
65define	__ARM_FIQ_INDIRECT	1
66endif
67
68define	KERNEL_BASE		KERNEL_BASE
69define	VM_MIN_ADDRESS		VM_MIN_ADDRESS
70define	VM_MAXUSER_ADDRESS	VM_MAXUSER_ADDRESS
71
72define	PMAP_DOMAIN_KERNEL	PMAP_DOMAIN_KERNEL
73
74ifdef PMAP_INCLUDE_PTE_SYNC
75define	PMAP_INCLUDE_PTE_SYNC	1
76endif
77
78define	PAGE_SIZE		PAGE_SIZE
79define	UPAGES			UPAGES
80define	PGSHIFT			PGSHIFT
81
82# Important offsets into the lwp and proc structs & associated constants
83define	L_ADDR			offsetof(struct lwp, l_addr)
84define	L_CPU			offsetof(struct lwp, l_cpu)
85define	L_PRIORITY		offsetof(struct lwp, l_priority)
86define	L_WCHAN			offsetof(struct lwp, l_wchan)
87define	L_STAT			offsetof(struct lwp, l_stat)
88define	L_PROC			offsetof(struct lwp, l_proc)
89define	P_RASLIST		offsetof(struct proc, p_raslist)
90
91define	PCB_TF			offsetof(struct pcb, pcb_tf)
92define	PCB_FLAGS		offsetof(struct pcb, pcb_flags)
93define	PCB_R8			offsetof(struct pcb, pcb_un.un_32.pcb32_r8)
94define	PCB_R9			offsetof(struct pcb, pcb_un.un_32.pcb32_r9)
95define	PCB_R10			offsetof(struct pcb, pcb_un.un_32.pcb32_r10)
96define	PCB_R11			offsetof(struct pcb, pcb_un.un_32.pcb32_r11)
97define	PCB_R12			offsetof(struct pcb, pcb_un.un_32.pcb32_r12)
98define	PCB_SP			offsetof(struct pcb, pcb_un.un_32.pcb32_sp)
99define	PCB_LR			offsetof(struct pcb, pcb_un.un_32.pcb32_lr)
100define	PCB_PC			offsetof(struct pcb, pcb_un.un_32.pcb32_pc)
101define	PCB_UND_SP		offsetof(struct pcb, pcb_un.un_32.pcb32_und_sp)
102define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
103define	PCB_NOALIGNFLT		PCB_NOALIGNFLT
104
105define	USER_SIZE		sizeof(struct user)
106
107define	V_TRAP			offsetof(struct uvmexp, traps)
108define	V_INTR			offsetof(struct uvmexp, intrs)
109define	V_SOFT			offsetof(struct uvmexp, softs)
110
111define	VM_MAP			offsetof(struct vmspace, vm_map)
112define	VM_PMAP			offsetof(struct vmspace, vm_map.pmap)
113
114define	PR_BASE			offsetof(struct uprof, pr_base)
115define	PR_SIZE			offsetof(struct uprof, pr_size)
116define	PR_OFF			offsetof(struct uprof, pr_off)
117define	PR_SCALE		offsetof(struct uprof, pr_scale)
118
119define	SIGTRAP			SIGTRAP
120define	SIGEMT			SIGEMT
121
122define	TF_R0			offsetof(struct trapframe, tf_r0)
123define	TF_R10			offsetof(struct trapframe, tf_r10)
124define	TF_PC			offsetof(struct trapframe, tf_pc)
125
126define	IF_PC			offsetof(struct irqframe, if_pc)
127
128define	PROCSIZE		sizeof(struct proc)
129define	TRAPFRAMESIZE		sizeof(struct trapframe)
130
131define	CF_IDCACHE_WBINV_ALL	offsetof(struct cpu_functions, cf_idcache_wbinv_all)
132define	CF_DCACHE_WB_RANGE	offsetof(struct cpu_functions, cf_dcache_wb_range)
133define	CF_TLB_FLUSHID_SE	offsetof(struct cpu_functions, cf_tlb_flushID_SE)
134define	CF_CONTEXT_SWITCH	offsetof(struct cpu_functions, cf_context_switch)
135define	CF_SLEEP		offsetof(struct cpu_functions, cf_sleep)
136define	CF_CONTROL		offsetof(struct cpu_functions, cf_control)
137
138define	CI_CURPRIORITY		offsetof(struct cpu_info, ci_schedstate.spc_curpriority)
139ifdef MULTIPROCESSOR
140define	CI_CURLWP		offsetof(struct cpu_info, ci_curlwp)
141define	CI_CURPCB		offsetof(struct cpu_info, ci_curpcb)
142endif
143if defined(EXEC_AOUT)
144define	CI_CTRL			offsetof(struct cpu_info, ci_ctrl)
145endif
146
147# Constants required for in_cksum() and friends.
148define	M_LEN				offsetof(struct mbuf, m_len)
149define	M_DATA				offsetof(struct mbuf, m_data)
150define	M_NEXT				offsetof(struct mbuf, m_next)
151define	IP_SRC				offsetof(struct ip, ip_src)
152define	IP_DST				offsetof(struct ip, ip_dst)
153