1# $NetBSD: genassym.cf,v 1.1 2003/03/04 07:51:03 matt Exp $ 2 3# 4# Copyright (C) 1995, 1996 Wolfgang Solfrank. 5# Copyright (C) 1995, 1996 TooLs GmbH. 6# All rights reserved. 7# 8# Redistribution and use in source and binary forms, with or without 9# modification, are permitted provided that the following conditions 10# are met: 11# 1. Redistributions of source code must retain the above copyright 12# notice, this list of conditions and the following disclaimer. 13# 2. Redistributions in binary form must reproduce the above copyright 14# notice, this list of conditions and the following disclaimer in the 15# documentation and/or other materials provided with the distribution. 16# 3. All advertising materials mentioning features or use of this software 17# must display the following acknowledgement: 18# This product includes software developed by TooLs GmbH. 19# 4. The name of TooLs GmbH may not be used to endorse or promote products 20# derived from this software without specific prior written permission. 21# 22# THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 23# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 24# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25# IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 27# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 28# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 30# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 31# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32# 33 34include <sys/param.h> 35include <sys/time.h> 36include <sys/proc.h> 37 38include <uvm/uvm_extern.h> 39 40include <machine/pcb.h> 41include <machine/pmap.h> 42 43define FRAMELEN FRAMELEN 44define FRAME_0 offsetof(struct trapframe, fixreg[0]) 45define FRAME_1 offsetof(struct trapframe, fixreg[1]) 46define FRAME_2 offsetof(struct trapframe, fixreg[2]) 47define FRAME_3 offsetof(struct trapframe, fixreg[3]) 48define FRAME_LR offsetof(struct trapframe, lr) 49define FRAME_CR offsetof(struct trapframe, cr) 50define FRAME_CTR offsetof(struct trapframe, ctr) 51define FRAME_XER offsetof(struct trapframe, xer) 52define FRAME_SRR0 offsetof(struct trapframe, srr0) 53define FRAME_SRR1 offsetof(struct trapframe, srr1) 54define FRAME_DEAR offsetof(struct trapframe, dar) 55define FRAME_EXC offsetof(struct trapframe, exc) 56define FRAME_ESR offsetof(struct trapframe, tf_xtra[TF_ESR]) 57define FRAME_PID offsetof(struct trapframe, tf_xtra[TF_PID]) 58 59define IFRAMELEN IFRAMELEN 60define IFRAME_R1 offsetof(struct intrframe, r1) 61define IFRAME_SRR1 offsetof(struct intrframe, srr1) 62define IFRAME_SRR0 offsetof(struct intrframe, srr0) 63define IFRAME_PRI offsetof(struct intrframe, pri) 64define IFRAME_INTR_DEPTH offsetof(struct intrframe, intrdepth) 65define IFRAME_PID offsetof(struct intrframe, pid) 66define IFRAME_CTR offsetof(struct intrframe, ctr) 67define IFRAME_XER offsetof(struct intrframe, xer) 68define IFRAME_CR offsetof(struct intrframe, cr) 69define IFRAME_LR offsetof(struct intrframe, lr) 70define IFRAME_R12 offsetof(struct intrframe, r12) 71define IFRAME_R11 offsetof(struct intrframe, r11) 72define IFRAME_R10 offsetof(struct intrframe, r10) 73define IFRAME_R9 offsetof(struct intrframe, r9) 74define IFRAME_R8 offsetof(struct intrframe, r8) 75define IFRAME_R7 offsetof(struct intrframe, r7) 76define IFRAME_R6 offsetof(struct intrframe, r6) 77define IFRAME_R5 offsetof(struct intrframe, r5) 78define IFRAME_R4 offsetof(struct intrframe, r4) 79define IFRAME_R3 offsetof(struct intrframe, r3) 80define IFRAME_R0 offsetof(struct intrframe, r0) 81 82define SZ_BOARD_CFG_DATA sizeof(struct board_cfg_data) 83 84define CALLFRAMELEN CALLFRAMELEN 85define CFRAME_SP offsetof(struct callframe, sp) 86define CFRAME_LR offsetof(struct callframe, lr) 87define CFRAME_R30 offsetof(struct callframe, r30) 88define CFRAME_R31 offsetof(struct callframe, r31) 89 90define SFRAMELEN roundup(sizeof(struct switchframe), CALLFRAMELEN) 91define SFRAME_SP offsetof(struct switchframe, sp) 92define SFRAME_CR offsetof(struct switchframe, cr) 93define SFRAME_R2 offsetof(struct switchframe, fixreg2) 94define SFRAME_R19 offsetof(struct switchframe, fixreg[0]) 95 96define PCB_PMR offsetof(struct pcb, pcb_pmreal) 97define PCB_SP offsetof(struct pcb, pcb_sp) 98define PCB_SPL offsetof(struct pcb, pcb_spl) 99define PCB_FAULT offsetof(struct pcb, pcb_onfault) 100 101define PM_CTX offsetof(struct pmap, pm_ctx) 102 103define L_FORW offsetof(struct lwp, l_forw) 104define L_BACK offsetof(struct lwp, l_back) 105define L_ADDR offsetof(struct lwp, l_addr) 106define L_STAT offsetof(struct lwp, l_stat) 107define L_CPU offsetof(struct lwp, l_cpu) 108define L_PRIORITY offsetof(struct lwp, l_priority) 109define L_PROC offsetof(struct lwp, l_proc) 110 111define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) 112 113define LSONPROC LSONPROC 114 115define CI_SIZE sizeof(struct cpu_info) 116define CI_CURLWP offsetof(struct cpu_info, ci_curlwp) 117define CI_CURPCB offsetof(struct cpu_info, ci_curpcb) 118define CI_CURPM offsetof(struct cpu_info, ci_curpm) 119define CI_IDLE_PCB offsetof(struct cpu_info, ci_idle_pcb) 120define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending) 121define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched) 122define CI_CPL offsetof(struct cpu_info, ci_cpl) 123define CI_INTRDEPTH offsetof(struct cpu_info, ci_intrdepth) 124define CI_INTSTK offsetof(struct cpu_info, ci_intstk) 125define CI_SPILLSTK offsetof(struct cpu_info, ci_spillstk) 126define CI_TEMPSAVE offsetof(struct cpu_info, ci_tempsave) 127define CI_DDBSAVE offsetof(struct cpu_info, ci_ddbsave) 128define CI_IPKDBSAVE offsetof(struct cpu_info, ci_ipkdbsave) 129define CI_DISISAVE offsetof(struct cpu_info, ci_disisave) 130 131define FB_PC offsetof(struct faultbuf, fb_pc) 132define FB_SP offsetof(struct faultbuf, fb_sp) 133define FB_R2 offsetof(struct faultbuf, fb_r2) 134define FB_CR offsetof(struct faultbuf, fb_cr) 135define FB_FIXREG offsetof(struct faultbuf, fb_fixreg) 136 137define CACHELINESIZE CACHELINESIZE 138 139define CPU_CI offsetof(struct cpu_info, ci_ci) 140