genassym.cf revision 1.22
1#	$NetBSD: genassym.cf,v 1.22 2003/04/18 11:08:25 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/proc.h>
40include <sys/resourcevar.h>
41include <sys/device.h>
42include <sys/user.h>
43include <sys/signal.h>
44
45include <uvm/uvm_extern.h>
46
47include <arm/fiq.h>
48
49include <machine/pmap.h>
50include <machine/frame.h>
51include <machine/vmparam.h>
52
53include "opt_multiprocessor.h"
54
55define	__PROG32		1
56ifdef __ARM_FIQ_INDIRECT
57define	__ARM_FIQ_INDIRECT	1
58endif
59
60define	VM_MIN_ADDRESS		VM_MIN_ADDRESS
61define	VM_MAXUSER_ADDRESS	VM_MAXUSER_ADDRESS
62
63ifndef ARM32_PMAP_NEW
64define	PTE_BASE		PTE_BASE
65else
66define	DOMAIN_CLIENT		DOMAIN_CLIENT
67define	PMAP_DOMAIN_KERNEL	PMAP_DOMAIN_KERNEL
68endif
69
70define	PAGE_SIZE		PAGE_SIZE
71define	UPAGES			UPAGES
72define	PGSHIFT			PGSHIFT
73
74# Important offsets into the lwp and proc structs & associated constants
75define	L_FORW			offsetof(struct lwp, l_forw)
76define	L_BACK			offsetof(struct lwp, l_back)
77define	L_ADDR			offsetof(struct lwp, l_addr)
78define	L_CPU			offsetof(struct lwp, l_cpu)
79define	L_PRIORITY		offsetof(struct lwp, l_priority)
80define	L_WCHAN			offsetof(struct lwp, l_wchan)
81define	L_STAT			offsetof(struct lwp, l_stat)
82define	L_PROC			offsetof(struct lwp, l_proc)
83define	P_NRAS			offsetof(struct proc, p_nras)
84
85# Process status constants
86define	LSONPROC		LSONPROC
87
88define	PCB_TF			offsetof(struct pcb, pcb_tf)
89define	PCB_PAGEDIR		offsetof(struct pcb, pcb_pagedir)
90ifdef ARM32_PMAP_NEW
91define	PCB_PL1VEC		offsetof(struct pcb, pcb_pl1vec)
92define	PCB_L1VEC		offsetof(struct pcb, pcb_l1vec)
93define	PCB_DACR		offsetof(struct pcb, pcb_dacr)
94define	PCB_CSTATE		offsetof(struct pcb, pcb_cstate)
95endif
96define	PCB_FLAGS		offsetof(struct pcb, pcb_flags)
97define	PCB_R8			offsetof(struct pcb, pcb_un.un_32.pcb32_r8)
98define	PCB_R9			offsetof(struct pcb, pcb_un.un_32.pcb32_r9)
99define	PCB_R10			offsetof(struct pcb, pcb_un.un_32.pcb32_r10)
100define	PCB_R11			offsetof(struct pcb, pcb_un.un_32.pcb32_r11)
101define	PCB_R12			offsetof(struct pcb, pcb_un.un_32.pcb32_r12)
102define	PCB_SP			offsetof(struct pcb, pcb_un.un_32.pcb32_sp)
103define	PCB_LR			offsetof(struct pcb, pcb_un.un_32.pcb32_lr)
104define	PCB_PC			offsetof(struct pcb, pcb_un.un_32.pcb32_pc)
105define	PCB_UND_SP		offsetof(struct pcb, pcb_un.un_32.pcb32_und_sp)
106define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
107
108define	USER_SIZE		sizeof(struct user)
109
110define	V_TRAP			offsetof(struct uvmexp, traps)
111define	V_INTR			offsetof(struct uvmexp, intrs)
112define	V_SOFT			offsetof(struct uvmexp, softs)
113
114define	VM_MAP			offsetof(struct vmspace, vm_map)
115define	VM_PMAP			offsetof(struct vmspace, vm_map.pmap)
116
117ifdef ARM32_PMAP_NEW
118define	CS_TLB_ID		offsetof(union pmap_cache_state, cs_tlb_id)
119define	CS_TLB_D		offsetof(union pmap_cache_state, cs_tlb_d)
120define	CS_TLB			offsetof(union pmap_cache_state, cs_tlb)
121define	CS_CACHE_ID		offsetof(union pmap_cache_state, cs_cache_id)
122define	CS_CACHE_D		offsetof(union pmap_cache_state, cs_cache_d)
123define	CS_CACHE		offsetof(union pmap_cache_state, cs_cache)
124define	CS_ALL			offsetof(union pmap_cache_state, cs_all)
125define	PMAP_CSTATE		offsetof(struct pmap, pm_cstate)
126endif
127
128define	PR_BASE			offsetof(struct uprof, pr_base)
129define	PR_SIZE			offsetof(struct uprof, pr_size)
130define	PR_OFF			offsetof(struct uprof, pr_off)
131define	PR_SCALE		offsetof(struct uprof, pr_scale)
132
133define	SIGTRAP			SIGTRAP
134define	SIGEMT			SIGEMT
135
136define	TF_R0			offsetof(struct trapframe, tf_r0)
137define	TF_R10			offsetof(struct trapframe, tf_r10)
138define	TF_PC			offsetof(struct trapframe, tf_pc)
139
140define	PROCSIZE		sizeof(struct proc)
141define	TRAPFRAMESIZE		sizeof(struct trapframe)
142
143define	CF_IDCACHE_WBINV_ALL	offsetof(struct cpu_functions, cf_idcache_wbinv_all)
144ifdef ARM32_PMAP_NEW
145define	CF_DCACHE_WB_RANGE	offsetof(struct cpu_functions, cf_dcache_wb_range)
146define	CF_TLB_FLUSHID_SE	offsetof(struct cpu_functions, cf_tlb_flushID_SE)
147endif
148define	CF_CONTEXT_SWITCH	offsetof(struct cpu_functions, cf_context_switch)
149define	CF_SLEEP		offsetof(struct cpu_functions, cf_sleep)
150
151define	CI_CURPRIORITY		offsetof(struct cpu_info, ci_schedstate.spc_curpriority)
152ifdef MULTIPROCESSOR
153define	CI_CURLWP		offsetof(struct cpu_info, ci_curlwp)
154define	CI_CURPCB		offsetof(struct cpu_info, ci_curpcb)
155endif
156