NetBSD-5.0.2/sys/arch/arm/arm32/genassym.cf

#	$NetBSD: genassym.cf,v 1.41 2008/09/20 18:29:05 tsutsui Exp $

# Copyright (c) 1982, 1990 The Regents of the University of California.
# All rights reserved.
#
# This code is derived from software contributed to Berkeley by
# William Jolitz.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

include <sys/param.h>
include <sys/systm.h>
include <sys/mbuf.h>
include <sys/proc.h>
include <sys/resourcevar.h>
include <sys/device.h>
include <sys/user.h>
include <sys/signal.h>
include <netinet/in.h>
include <netinet/in_systm.h>
include <netinet/ip.h>
include <netinet/ip6.h>
include <netinet/ip_var.h>

include <uvm/uvm_extern.h>

include <arm/fiq.h>

include <machine/pmap.h>
include <machine/frame.h>
include <machine/vmparam.h>

include "opt_multiprocessor.h"
include "opt_compat_netbsd.h"
include "opt_execfmt.h"

define	__PROG32		1
ifdef __ARM_FIQ_INDIRECT
define	__ARM_FIQ_INDIRECT	1
endif

ifdef __HAVE_FAST_SOFTINTS
define	__HAVE_FAST_SOFTINTS	1
endif

ifdef __HAVE_UNNESTED_INTRS
define	__HAVE_UNNESTED_INTRS	1
endif

define	KERNEL_BASE		KERNEL_BASE
define	VM_MIN_ADDRESS		VM_MIN_ADDRESS
define	VM_MAXUSER_ADDRESS	VM_MAXUSER_ADDRESS

define	PMAP_DOMAIN_KERNEL	PMAP_DOMAIN_KERNEL

ifdef PMAP_INCLUDE_PTE_SYNC
define	PMAP_INCLUDE_PTE_SYNC	1
endif

define	PAGE_SIZE		PAGE_SIZE
define	UPAGES			UPAGES
define	PGSHIFT			PGSHIFT

# Important offsets into the lwp and proc structs & associated constants
define	L_ADDR			offsetof(struct lwp, l_addr)
define	L_CPU			offsetof(struct lwp, l_cpu)
define	L_PRIORITY		offsetof(struct lwp, l_priority)
define	L_WCHAN			offsetof(struct lwp, l_wchan)
define	L_STAT			offsetof(struct lwp, l_stat)
define	L_PROC			offsetof(struct lwp, l_proc)
define	L_CTXSWTCH		offsetof(struct lwp, l_ctxswtch)
define	P_RASLIST		offsetof(struct proc, p_raslist)

define	PCB_TF			offsetof(struct pcb, pcb_tf)
define	PCB_FLAGS		offsetof(struct pcb, pcb_flags)
define	PCB_R8			offsetof(struct pcb, pcb_un.un_32.pcb32_r8)
define	PCB_R9			offsetof(struct pcb, pcb_un.un_32.pcb32_r9)
define	PCB_R10			offsetof(struct pcb, pcb_un.un_32.pcb32_r10)
define	PCB_R11			offsetof(struct pcb, pcb_un.un_32.pcb32_r11)
define	PCB_R12			offsetof(struct pcb, pcb_un.un_32.pcb32_r12)
define	PCB_SP			offsetof(struct pcb, pcb_un.un_32.pcb32_sp)
define	PCB_LR			offsetof(struct pcb, pcb_un.un_32.pcb32_lr)
define	PCB_PC			offsetof(struct pcb, pcb_un.un_32.pcb32_pc)
define	PCB_USER_PID_RW		offsetof(struct pcb, pcb_un.un_32.pcb32_user_pid_rw)
define	PCB_USER_PID_RO		offsetof(struct pcb, pcb_un.un_32.pcb32_user_pid_ro)
define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
define	PCB_NOALIGNFLT		PCB_NOALIGNFLT

define	USER_SIZE		sizeof(struct user)

define	V_TRAP			offsetof(struct uvmexp, traps)
define	V_INTR			offsetof(struct uvmexp, intrs)
define	V_SOFT			offsetof(struct uvmexp, softs)

define	VM_MAP			offsetof(struct vmspace, vm_map)
define	VM_PMAP			offsetof(struct vmspace, vm_map.pmap)

define	PR_BASE			offsetof(struct uprof, pr_base)
define	PR_SIZE			offsetof(struct uprof, pr_size)
define	PR_OFF			offsetof(struct uprof, pr_off)
define	PR_SCALE		offsetof(struct uprof, pr_scale)

define	SIGTRAP			SIGTRAP
define	SIGEMT			SIGEMT

define	TF_R0			offsetof(struct trapframe, tf_r0)
define	TF_R10			offsetof(struct trapframe, tf_r10)
define	TF_PC			offsetof(struct trapframe, tf_pc)

define	IF_PC			offsetof(struct irqframe, if_pc)

define	PROCSIZE		sizeof(struct proc)
define	TRAPFRAMESIZE		sizeof(struct trapframe)

define	CF_IDCACHE_WBINV_ALL	offsetof(struct cpu_functions, cf_idcache_wbinv_all)
define	CF_DCACHE_WB_RANGE	offsetof(struct cpu_functions, cf_dcache_wb_range)
define	CF_TLB_FLUSHID_SE	offsetof(struct cpu_functions, cf_tlb_flushID_SE)
define	CF_CONTEXT_SWITCH	offsetof(struct cpu_functions, cf_context_switch)
define	CF_SLEEP		offsetof(struct cpu_functions, cf_sleep)
define	CF_CONTROL		offsetof(struct cpu_functions, cf_control)

define	CI_CURPRIORITY		offsetof(struct cpu_info, ci_schedstate.spc_curpriority)
ifndef PROCESS_ID_IS_CURLWP
define	CI_CURLWP		offsetof(struct cpu_info, ci_curlwp)
endif
define	CI_CURPCB		offsetof(struct cpu_info, ci_curpcb)
define	CI_CPL			offsetof(struct cpu_info, ci_cpl)
define	CI_ASTPENDING		offsetof(struct cpu_info, ci_astpending)
define	CI_WANT_RESCHED		offsetof(struct cpu_info, ci_want_resched)
define	CI_INTR_DEPTH		offsetof(struct cpu_info, ci_intr_depth)
define	CI_MTX_COUNT		offsetof(struct cpu_info, ci_mtx_count)
if defined(EXEC_AOUT)
define	CI_CTRL			offsetof(struct cpu_info, ci_ctrl)
endif
ifdef __HAVE_FAST_SOFTINTS
define	CI_SOFTINTS		offsetof(struct cpu_info, ci_softints)
endif

# Constants required for in_cksum() and friends.
define	M_LEN				offsetof(struct mbuf, m_len)
define	M_DATA				offsetof(struct mbuf, m_data)
define	M_NEXT				offsetof(struct mbuf, m_next)
define	IP_SRC				offsetof(struct ip, ip_src)
define	IP_DST				offsetof(struct ip, ip_dst)