# $NetBSD: genassym.cf,v 1.27 2018/07/15 05:16:44 maxv Exp $
#
# Copyright (C) 1995, 1996 Wolfgang Solfrank.
# Copyright (C) 1995, 1996 TooLs GmbH.
# 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 by TooLs GmbH.
# 4. The name of TooLs GmbH may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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 "opt_ppcarch.h"
include <sys/param.h>
include <sys/time.h>
include <sys/mutex.h>
include <sys/rwlock.h>
include <sys/proc.h>
include <sys/bitops.h>
include <uvm/uvm_extern.h>
include <machine/pcb.h>
include <machine/pmap.h>
include <powerpc/cpu.h>
include <powerpc/oea/bat.h>
include <powerpc/oea/cpufeat.h>
define FRAME_DAR offsetof(struct ktrapframe, ktf_tf.tf_dar)
define FRAME_DSISR offsetof(struct ktrapframe, ktf_tf.tf_dsisr)
define FRAME_VRSAVE offsetof(struct ktrapframe, ktf_tf.tf_vrsave)
define FRAME_MQ offsetof(struct ktrapframe, ktf_tf.tf_mq)
ifdef PPC_OEA64
define PM_STEG offsetof(struct pmap, pm_steg_table)
else
define USER_SR USER_SR
define KERNEL_SR KERNEL_SR
define PM_SR offsetof(struct pmap, pm_sr[0])
define PM_USRSR offsetof(struct pmap, pm_sr[USER_SR])
define PM_KERNELSR offsetof(struct pmap, pm_sr[KERNEL_SR])
endif
define CI_TEMPSAVE offsetof(struct cpu_info, ci_savearea[CI_SAVETEMP])
define CI_DDBSAVE offsetof(struct cpu_info, ci_savearea[CI_SAVEDDB])
define CI_DISISAVE offsetof(struct cpu_info, ci_savearea[CI_SAVEMMU])
define CPUSAVE_R28 CPUSAVE_R28*sizeof(register_t)
define CPUSAVE_R29 CPUSAVE_R29*sizeof(register_t)
define CPUSAVE_R30 CPUSAVE_R30*sizeof(register_t)
define CPUSAVE_R31 CPUSAVE_R31*sizeof(register_t)
define CPUSAVE_DAR CPUSAVE_DAR*sizeof(register_t)
define CPUSAVE_DSISR CPUSAVE_DSISR*sizeof(register_t)
define CPUSAVE_SRR0 CPUSAVE_SRR0*sizeof(register_t)
define CPUSAVE_SRR1 CPUSAVE_SRR1*sizeof(register_t)
define OEACPU_64 OEACPU_64
define OEACPU_64_BRIDGE OEACPU_64_BRIDGE
define OEACPU_NOBAT OEACPU_NOBAT
define OEACPU_HIGHBAT OEACPU_HIGHBAT
define OEACPU_601 OEACPU_601
define OEACPU_HIGHSPRG OEACPU_HIGHSPRG
define OEACPU_ALTIVEC OEACPU_ALTIVEC
define BAT_ADDR_SHIFT ilog2(BAT_IDX2VA(1))
define PTE_REF PTE_REF
define PTE_CHG PTE_CHG
define PTE_HID PTE_HID
define PTE_G PTE_G
define FPREG_F0 offsetof(struct fpreg, fpreg[0])
define FPREG_F1 offsetof(struct fpreg, fpreg[1])
define FPREG_F2 offsetof(struct fpreg, fpreg[2])
define FPREG_F3 offsetof(struct fpreg, fpreg[3])
define FPREG_F4 offsetof(struct fpreg, fpreg[4])
define FPREG_F5 offsetof(struct fpreg, fpreg[5])
define FPREG_F6 offsetof(struct fpreg, fpreg[6])
define FPREG_F7 offsetof(struct fpreg, fpreg[7])
define FPREG_F8 offsetof(struct fpreg, fpreg[8])
define FPREG_F9 offsetof(struct fpreg, fpreg[9])
define FPREG_F10 offsetof(struct fpreg, fpreg[10])
define FPREG_F11 offsetof(struct fpreg, fpreg[11])
define FPREG_F12 offsetof(struct fpreg, fpreg[12])
define FPREG_F13 offsetof(struct fpreg, fpreg[13])
define FPREG_F14 offsetof(struct fpreg, fpreg[14])
define FPREG_F15 offsetof(struct fpreg, fpreg[15])
define FPREG_F16 offsetof(struct fpreg, fpreg[16])
define FPREG_F17 offsetof(struct fpreg, fpreg[17])
define FPREG_F18 offsetof(struct fpreg, fpreg[18])
define FPREG_F19 offsetof(struct fpreg, fpreg[19])
define FPREG_F20 offsetof(struct fpreg, fpreg[20])
define FPREG_F21 offsetof(struct fpreg, fpreg[21])
define FPREG_F22 offsetof(struct fpreg, fpreg[22])
define FPREG_F23 offsetof(struct fpreg, fpreg[23])
define FPREG_F24 offsetof(struct fpreg, fpreg[24])
define FPREG_F25 offsetof(struct fpreg, fpreg[25])
define FPREG_F26 offsetof(struct fpreg, fpreg[26])
define FPREG_F27 offsetof(struct fpreg, fpreg[27])
define FPREG_F28 offsetof(struct fpreg, fpreg[28])
define FPREG_F29 offsetof(struct fpreg, fpreg[29])
define FPREG_F30 offsetof(struct fpreg, fpreg[30])
define FPREG_F31 offsetof(struct fpreg, fpreg[31])
define FPREG_FPSCR offsetof(struct fpreg, fpscr)
define VREG_V0 offsetof(struct vreg, vreg[0][0])
define VREG_V1 offsetof(struct vreg, vreg[1][0])
define VREG_V2 offsetof(struct vreg, vreg[2][0])
define VREG_V3 offsetof(struct vreg, vreg[3][0])
define VREG_V4 offsetof(struct vreg, vreg[4][0])
define VREG_V5 offsetof(struct vreg, vreg[5][0])
define VREG_V6 offsetof(struct vreg, vreg[6][0])
define VREG_V7 offsetof(struct vreg, vreg[7][0])
define VREG_V8 offsetof(struct vreg, vreg[8][0])
define VREG_V9 offsetof(struct vreg, vreg[9][0])
define VREG_V10 offsetof(struct vreg, vreg[10][0])
define VREG_V11 offsetof(struct vreg, vreg[11][0])
define VREG_V12 offsetof(struct vreg, vreg[12][0])
define VREG_V13 offsetof(struct vreg, vreg[13][0])
define VREG_V14 offsetof(struct vreg, vreg[14][0])
define VREG_V15 offsetof(struct vreg, vreg[15][0])
define VREG_V16 offsetof(struct vreg, vreg[16][0])
define VREG_V17 offsetof(struct vreg, vreg[17][0])
define VREG_V18 offsetof(struct vreg, vreg[18][0])
define VREG_V19 offsetof(struct vreg, vreg[19][0])
define VREG_V20 offsetof(struct vreg, vreg[20][0])
define VREG_V21 offsetof(struct vreg, vreg[21][0])
define VREG_V22 offsetof(struct vreg, vreg[22][0])
define VREG_V23 offsetof(struct vreg, vreg[23][0])
define VREG_V24 offsetof(struct vreg, vreg[24][0])
define VREG_V25 offsetof(struct vreg, vreg[25][0])
define VREG_V26 offsetof(struct vreg, vreg[26][0])
define VREG_V27 offsetof(struct vreg, vreg[27][0])
define VREG_V28 offsetof(struct vreg, vreg[28][0])
define VREG_V29 offsetof(struct vreg, vreg[29][0])
define VREG_V30 offsetof(struct vreg, vreg[30][0])
define VREG_V31 offsetof(struct vreg, vreg[31][0])
define VREG_VRSAVE offsetof(struct vreg, vrsave)
define VREG_VSCR offsetof(struct vreg, vscr)