NetBSD-5.0.2/sys/arch/vax/vax/genassym.cf

#	$NetBSD: genassym.cf,v 1.43 2008/06/04 11:30:26 ad Exp $
#
# Copyright (c) 1997 Ludd, University of Lule}, Sweden.
# All rights reserved.
#
# 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. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#      This product includes software developed at Ludd, University of 
#      Lule}, Sweden and its contributors.
# 4. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
#

quote #define __MUTEX_PRIVATE
quote #define __RWLOCK_PRIVATE

include	<sys/param.h>
include	<sys/proc.h>
include	<sys/errno.h>
include	<sys/syscall.h>
include	<sys/sched.h>
include	<sys/device.h>

include <uvm/uvm.h>

include	<machine/cpu.h>
include	<machine/mtpr.h>
include	<machine/pcb.h>
include	<machine/sid.h>
include <machine/signal.h>
include	<machine/frame.h>
include	<machine/trap.h>
include	<machine/uvax.h>

define	L_PRIORITY	offsetof(struct lwp, l_priority)
define	L_ADDR		offsetof(struct lwp, l_addr)
define	L_CPU		offsetof(struct lwp, l_cpu)
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_VMSPACE	offsetof(struct proc, p_vmspace)
define	P_MD_SYSCALL	offsetof(struct proc, p_md.md_syscall)

define	P0BR		offsetof(struct pcb, P0BR)
define	P0LR		offsetof(struct pcb, P0LR)
define	P1BR		offsetof(struct pcb, P1BR)
define	P1LR		offsetof(struct pcb, P1LR)
define	IFTRAP		offsetof(struct pcb, iftrap)
define	ESP		offsetof(struct pcb, ESP)
define	SSP		offsetof(struct pcb, SSP)
define	KSP		offsetof(struct pcb, KSP)
define	PCB_R0		offsetof(struct pcb, R[0])
define	PCB_R1		offsetof(struct pcb, R[1])
define	PCB_R6		offsetof(struct pcb, R[6])
define	PCB_R7		offsetof(struct pcb, R[7])
define	PCB_AP		offsetof(struct pcb, AP)
define	PCB_FP		offsetof(struct pcb, FP)
define	PCB_PC		offsetof(struct pcb, PC)
define	PCB_PSL		offsetof(struct pcb, PSL)
define	PCB_PADDR	offsetof(struct pcb, pcb_paddr)

define	SOFTINT_CLOCK	SOFTINT_CLOCK
define	SOFTINT_BIO	SOFTINT_BIO
define	SOFTINT_NET	SOFTINT_NET
define	SOFTINT_SERIAL	SOFTINT_SERIAL

define	MCHK		offsetof(struct cpu_dep, cpu_mchk)
define	MEMERR		offsetof(struct cpu_dep, cpu_memerr)
define	BADADDR		offsetof(struct cpu_dep, cpu_badaddr)

define	KERNBASE	KERNBASE

define	UVME_INTRS	offsetof(struct uvmexp, intrs)
define	UVME_SOFTS	offsetof(struct uvmexp, softs)

ifdef MULTIPROCESSOR
define	CI_CURLWP	offsetof(struct cpu_info, ci_curlwp)
endif
define	CI_MTX_COUNT	offsetof(struct cpu_info, ci_mtx_count)
define	CI_MTX_OLDSPL	offsetof(struct cpu_info, ci_mtx_oldspl)
define	CI_SOFTLWPS	offsetof(struct cpu_info, ci_softlwps)

# mtpr register numbers
define	PR_KSP		PR_KSP
define	PR_ESP		PR_ESP
define	PR_SSP		PR_SSP
define	PR_USP		PR_USP
define	PR_ICCS		PR_ICCS
define	PR_PCBB		PR_PCBB
define	PR_IPL		PR_IPL
define	PR_SBIFS	PR_SBIFS
define	PR_EHSR		PR_EHSR
define	PR_MCESR	PR_MCESR
define	PR_P0BR		PR_P0BR
define	PR_P1BR		PR_P1BR
define	PR_P0LR		PR_P0LR
define	PR_P1LR		PR_P1LR
define	PR_SCBB		PR_SCBB

# trap numbering
define	T_KSPNOTVAL	T_KSPNOTVAL
define	T_PRIVINFLT	T_PRIVINFLT
define	T_XFCFLT	T_XFCFLT
define	T_RESOPFLT	T_RESOPFLT
define	T_RESADFLT	T_RESADFLT
define	T_TRANSFLT	T_TRANSFLT
define	T_PTEFETCH	T_PTEFETCH
define	T_WRITE		T_WRITE
define	T_ACCFLT	T_ACCFLT
define	T_PTELEN	T_PTELEN
define	T_TRCTRAP	T_TRCTRAP
define	T_BPTFLT	T_BPTFLT
define	T_ARITHFLT	T_ARITHFLT
define	T_SYSCALL	T_SYSCALL
define	T_ASTFLT	T_ASTFLT
define	T_KDBTRAP	T_KDBTRAP

define	USPACE		USPACE
define	TRAPFRAMELEN	sizeof(struct trapframe)
define	CALLSFRAMELEN	sizeof(struct callsframe)
define	CA_ARGNO	offsetof(struct callsframe, ca_argno)

define	ENAMETOOLONG	ENAMETOOLONG
define	EFAULT		EFAULT

define	EV_COUNT	offsetof(struct evcnt, ev_count)

define	SYS_compat_16___sigreturn14	SYS_compat_16___sigreturn14
define	SYS_exit	SYS_exit

define	VAX_TYP_UV2	VAX_TYP_UV2
define	VAX_TYP_8SS	VAX_TYP_8SS
define	VAX_BTYP_46	VAX_BTYP_46
define	VAX_BTYP_48	VAX_BTYP_48
define	VAX_BTYP_49	VAX_BTYP_49

define	IPL_HIGH	IPL_HIGH
define	IPL_CLOCK	IPL_CLOCK
define	IPL_SCHED	IPL_SCHED
define	IPL_VM		IPL_VM
define	IPL_NONE	IPL_NONE

define	VC_DIAGTIMM	offsetof(struct vs_cpu, vc_diagtimm)

define	PSL_IS		PSL_IS

define	MTX_OWNER	offsetof(struct kmutex, mtx_owner)
define	MTX_LOCK	offsetof(struct kmutex, mtx_lock)
define	MTX_IPL		offsetof(struct kmutex, mtx_ipl)
ifdef	MUTEX_COUNT_BIAS
define	MTX_COUNT_BIAS	MUTEX_COUNT_BIAS
endif

define	RW_OWNER	offsetof(struct krwlock, rw_owner)
define	RW_HAS_WAITERS	RW_HAS_WAITERS
define	RW_WRITE_LOCKED	RW_WRITE_LOCKED
define	RW_WRITE_WANTED	RW_WRITE_WANTED
define	RW_READ_INCR	RW_READ_INCR
define	RW_THREAD	RW_THREAD
define	RW_READER	RW_READER
define	RW_WRITER	RW_WRITER