genassym.cf revision 1.5
11.5Smatt# $NetBSD: genassym.cf,v 1.5 2011/06/18 06:37:38 matt Exp $ 21.2Smatt 31.2Smatt#- 41.2Smatt# Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. 51.2Smatt# All rights reserved. 61.2Smatt# 71.2Smatt# This code is derived from software contributed to The NetBSD Foundation 81.2Smatt# by Raytheon BBN Technologies Corp and Defense Advanced Research Projects 91.2Smatt# Agency and which was developed by Matt Thomas of 3am Software Foundry. 101.2Smatt# 111.2Smatt# This material is based upon work supported by the Defense Advanced Research 121.2Smatt# Projects Agency and Space and Naval Warfare Systems Center, Pacific, under 131.2Smatt# Contract No. N66001-09-C-2073. 141.2Smatt# Approved for Public Release, Distribution Unlimited 151.2Smatt# 161.2Smatt# Copyright (c) 2010 The NetBSD Foundation, Inc. 171.2Smatt# All rights reserved. 181.2Smatt# 191.2Smatt# This code is derived from software contributed to The NetBSD Foundation 201.2Smatt# by Matt Thomas of 3am Software Foundry. 211.2Smatt# 221.2Smatt# Redistribution and use in source and binary forms, with or without 231.2Smatt# modification, are permitted provided that the following conditions 241.2Smatt# are met: 251.2Smatt# 1. Redistributions of source code must retain the above copyright 261.2Smatt# notice, this list of conditions and the following disclaimer. 271.2Smatt# 2. Redistributions in binary form must reproduce the above copyright 281.2Smatt# notice, this list of conditions and the following disclaimer in the 291.2Smatt# documentation and/or other materials provided with the distribution. 301.2Smatt# 311.2Smatt# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 321.2Smatt# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 331.2Smatt# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 341.2Smatt# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 351.2Smatt# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 361.2Smatt# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 371.2Smatt# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 381.2Smatt# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 391.2Smatt# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 401.2Smatt# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 411.2Smatt# POSSIBILITY OF SUCH DAMAGE. 421.2Smatt#+ 431.2Smatt 441.2Smattinclude "opt_ppcarch.h" 451.2Smatt 461.2Smattquote #define __MUTEX_PRIVATE 471.2Smattquote #define __RWLOCK_PRIVATE 481.2Smattquote #define __INTR_PRIVATE 491.2Smatt 501.2Smattinclude <sys/param.h> 511.2Smattinclude <sys/time.h> 521.2Smattinclude <sys/mutex.h> 531.2Smattinclude <sys/rwlock.h> 541.2Smattinclude <sys/proc.h> 551.2Smattinclude <sys/bitops.h> 561.2Smatt 571.2Smattinclude <uvm/uvm_extern.h> 581.2Smatt 591.2Smattinclude <machine/pcb.h> 601.2Smattinclude <machine/frame.h> 611.2Smattinclude <machine/pmap.h> 621.2Smatt 631.2Smattinclude <powerpc/cpu.h> 641.2Smattinclude <powerpc/booke/trap.h> 651.2Smattinclude <powerpc/booke/pte.h> 661.2Smatt 671.2Smattdefine FRAMELEN FRAMELEN 681.2Smattdefine FRAME_TF offsetof(struct ktrapframe, ktf_tf) 691.5Smattdefine FRAME_R0 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[0]) 701.5Smattdefine FRAME_R1 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[1]) 711.5Smattdefine FRAME_R2 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[2]) 721.5Smattdefine FRAME_R3 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[3]) 731.5Smattdefine FRAME_R4 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[4]) 741.5Smattdefine FRAME_R5 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[5]) 751.5Smattdefine FRAME_R6 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[6]) 761.5Smattdefine FRAME_R7 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[7]) 771.5Smattdefine FRAME_R8 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[8]) 781.5Smattdefine FRAME_R9 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[9]) 791.5Smattdefine FRAME_R10 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[10]) 801.5Smattdefine FRAME_R11 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[11]) 811.5Smattdefine FRAME_R12 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[12]) 821.5Smattdefine FRAME_R13 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[13]) 831.5Smattdefine FRAME_R14 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[14]) 841.5Smattdefine FRAME_R15 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[15]) 851.5Smattdefine FRAME_R16 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[16]) 861.5Smattdefine FRAME_R17 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[17]) 871.5Smattdefine FRAME_R18 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[18]) 881.5Smattdefine FRAME_R19 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[19]) 891.5Smattdefine FRAME_R20 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[20]) 901.5Smattdefine FRAME_R21 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[21]) 911.5Smattdefine FRAME_R22 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[22]) 921.5Smattdefine FRAME_R23 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[23]) 931.5Smattdefine FRAME_R24 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[24]) 941.5Smattdefine FRAME_R25 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[25]) 951.5Smattdefine FRAME_R26 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[26]) 961.5Smattdefine FRAME_R27 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[27]) 971.5Smattdefine FRAME_R28 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[28]) 981.5Smattdefine FRAME_R29 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[29]) 991.5Smattdefine FRAME_R30 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[30]) 1001.5Smattdefine FRAME_R31 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[31]) 1011.2Smattdefine FRAME_LR offsetof(struct ktrapframe, ktf_tf.tf_lr) 1021.2Smattdefine FRAME_CR offsetof(struct ktrapframe, ktf_tf.tf_cr) 1031.2Smattdefine FRAME_CTR offsetof(struct ktrapframe, ktf_tf.tf_ctr) 1041.2Smattdefine FRAME_XER offsetof(struct ktrapframe, ktf_tf.tf_xer) 1051.2Smattdefine FRAME_CF offsetof(struct ktrapframe, ktf_tf.tf_cf) 1061.2Smattdefine FRAME_SRR0 offsetof(struct ktrapframe, ktf_tf.tf_srr0) 1071.2Smattdefine FRAME_SRR1 offsetof(struct ktrapframe, ktf_tf.tf_srr1) 1081.2Smattdefine FRAME_IDEPTH offsetof(struct ktrapframe, ktf_tf.tf_idepth) 1091.2Smattdefine FRAME_DEAR offsetof(struct ktrapframe, ktf_tf.tf_dear) 1101.2Smattdefine FRAME_ESR offsetof(struct ktrapframe, ktf_tf.tf_esr) 1111.2Smattdefine FRAME_EXC offsetof(struct ktrapframe, ktf_tf.tf_exc) 1121.2Smattdefine FRAME_MCSR offsetof(struct ktrapframe, ktf_tf.tf_mcsr) 1131.2Smattdefine FRAME_MCAR offsetof(struct ktrapframe, ktf_tf.tf_mcar) 1141.2Smattdefine FRAME_SPRG1 offsetof(struct ktrapframe, ktf_tf.tf_sprg1) 1151.2Smattdefine FRAME_SPEFSCR offsetof(struct ktrapframe, ktf_tf.tf_spefscr) 1161.2Smatt 1171.2Smattdefine CALLFRAMELEN CALLFRAMELEN 1181.2Smattdefine CFRAME_SP offsetof(struct callframe, cf_sp) 1191.2Smattdefine CFRAME_LR offsetof(struct callframe, cf_lr) 1201.2Smattdefine CFRAME_R30 offsetof(struct callframe, cf_r30) 1211.2Smattdefine CFRAME_R31 offsetof(struct callframe, cf_r31) 1221.2Smatt 1231.2Smattdefine SFRAMELEN SFRAMELEN 1241.2Smattdefine SFRAME_SP offsetof(struct switchframe, sf_sp) 1251.2Smattdefine SFRAME_LR offsetof(struct switchframe, sf_lr) 1261.2Smattdefine SFRAME_USER_SR offsetof(struct switchframe, sf_user_sr) 1271.2Smattdefine SFRAME_CR offsetof(struct switchframe, sf_cr) 1281.2Smattdefine SFRAME_R2 offsetof(struct switchframe, sf_fixreg2) 1291.2Smattdefine SFRAME_R13 offsetof(struct switchframe, sf_fixreg[0]) 1301.2Smattdefine SFRAME_R14 offsetof(struct switchframe, sf_fixreg[1]) 1311.2Smattdefine SFRAME_R15 offsetof(struct switchframe, sf_fixreg[2]) 1321.2Smattdefine SFRAME_R16 offsetof(struct switchframe, sf_fixreg[3]) 1331.2Smattdefine SFRAME_R17 offsetof(struct switchframe, sf_fixreg[4]) 1341.2Smattdefine SFRAME_R18 offsetof(struct switchframe, sf_fixreg[5]) 1351.2Smattdefine SFRAME_R19 offsetof(struct switchframe, sf_fixreg[6]) 1361.2Smattdefine SFRAME_R20 offsetof(struct switchframe, sf_fixreg[7]) 1371.2Smattdefine SFRAME_R21 offsetof(struct switchframe, sf_fixreg[8]) 1381.2Smattdefine SFRAME_R22 offsetof(struct switchframe, sf_fixreg[9]) 1391.2Smattdefine SFRAME_R23 offsetof(struct switchframe, sf_fixreg[10]) 1401.2Smattdefine SFRAME_R24 offsetof(struct switchframe, sf_fixreg[11]) 1411.2Smattdefine SFRAME_R25 offsetof(struct switchframe, sf_fixreg[12]) 1421.2Smattdefine SFRAME_R26 offsetof(struct switchframe, sf_fixreg[13]) 1431.2Smattdefine SFRAME_R27 offsetof(struct switchframe, sf_fixreg[14]) 1441.2Smattdefine SFRAME_R28 offsetof(struct switchframe, sf_fixreg[15]) 1451.2Smattdefine SFRAME_R29 offsetof(struct switchframe, sf_fixreg[16]) 1461.2Smattdefine SFRAME_R30 offsetof(struct switchframe, sf_fixreg[17]) 1471.2Smattdefine SFRAME_R31 offsetof(struct switchframe, sf_fixreg[18]) 1481.2Smatt 1491.2Smattdefine PCB_PM offsetof(struct pcb, pcb_pm) 1501.2Smattdefine PCB_SP offsetof(struct pcb, pcb_sp) 1511.2Smattdefine PCB_ONFAULT offsetof(struct pcb, pcb_onfault) 1521.2Smattdefine PCB_USPRG0 offsetof(struct pcb, pcb_usprg0) 1531.2Smatt 1541.2Smattdefine L_PCB offsetof(struct lwp, l_addr) 1551.2Smattdefine L_CPU offsetof(struct lwp, l_cpu) 1561.2Smattdefine L_CTXSWTCH offsetof(struct lwp, l_ctxswtch) 1571.3Smattdefine L_MD_ASTPENDING offsetof(struct lwp, l_md.md_astpending) 1581.2Smattdefine L_MD_UTF offsetof(struct lwp, l_md.md_utf) 1591.2Smattdefine L_PROC offsetof(struct lwp, l_proc) 1601.2Smatt 1611.2Smattdefine P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) 1621.2Smatt 1631.2Smattdefine CI_SIZE sizeof(struct cpu_info) 1641.2Smattdefine CI_CURLWP offsetof(struct cpu_info, ci_curlwp) 1651.2Smattdefine CI_CURPCB offsetof(struct cpu_info, ci_curpcb) 1661.2Smattdefine CI_CURPM offsetof(struct cpu_info, ci_curpm) 1671.2Smattdefine CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched) 1681.2Smattdefine CI_CPL offsetof(struct cpu_info, ci_cpl) 1691.2Smattdefine CI_IDEPTH offsetof(struct cpu_info, ci_idepth) 1701.2Smattdefine CI_IDLESPIN offsetof(struct cpu_info, ci_idlespin) 1711.3Smattdefine CI_IDLELWP offsetof(struct cpu_info, ci_data.cpu_idlelwp) 1721.2Smattdefine CI_MTX_COUNT offsetof(struct cpu_info, ci_mtx_count) 1731.2Smattdefine CI_MTX_OLDSPL offsetof(struct cpu_info, ci_mtx_oldspl) 1741.2Smattdefine CI_SAVELIFO offsetof(struct cpu_info, ci_savelifo) 1751.2Smattdefine CI_PMAP_SEGTAB offsetof(struct cpu_info, ci_pmap_segtabs[0]) 1761.2Smattdefine CI_EV_TLBMISS_SOFT offsetof(struct cpu_info, ci_ev_tlbmiss_soft.ev_count) 1771.2Smatt 1781.2Smattdefine FB_PC offsetof(struct faultbuf, fb_pc) 1791.2Smattdefine FB_MSR offsetof(struct faultbuf, fb_msr) 1801.2Smattdefine FB_SP offsetof(struct faultbuf, fb_sp) 1811.2Smattdefine FB_R2 offsetof(struct faultbuf, fb_r2) 1821.2Smattdefine FB_CR offsetof(struct faultbuf, fb_cr) 1831.2Smattdefine FB_R13 offsetof(struct faultbuf, fb_fixreg[0]) 1841.2Smattdefine FB_R14 offsetof(struct faultbuf, fb_fixreg[1]) 1851.2Smattdefine FB_R15 offsetof(struct faultbuf, fb_fixreg[2]) 1861.2Smattdefine FB_R16 offsetof(struct faultbuf, fb_fixreg[3]) 1871.2Smattdefine FB_R17 offsetof(struct faultbuf, fb_fixreg[4]) 1881.2Smattdefine FB_R18 offsetof(struct faultbuf, fb_fixreg[5]) 1891.2Smattdefine FB_R19 offsetof(struct faultbuf, fb_fixreg[6]) 1901.2Smattdefine FB_R20 offsetof(struct faultbuf, fb_fixreg[7]) 1911.2Smattdefine FB_R21 offsetof(struct faultbuf, fb_fixreg[8]) 1921.2Smattdefine FB_R22 offsetof(struct faultbuf, fb_fixreg[9]) 1931.2Smattdefine FB_R23 offsetof(struct faultbuf, fb_fixreg[10]) 1941.2Smattdefine FB_R24 offsetof(struct faultbuf, fb_fixreg[11]) 1951.2Smattdefine FB_R25 offsetof(struct faultbuf, fb_fixreg[12]) 1961.2Smattdefine FB_R26 offsetof(struct faultbuf, fb_fixreg[13]) 1971.2Smattdefine FB_R27 offsetof(struct faultbuf, fb_fixreg[14]) 1981.2Smattdefine FB_R28 offsetof(struct faultbuf, fb_fixreg[15]) 1991.2Smattdefine FB_R29 offsetof(struct faultbuf, fb_fixreg[16]) 2001.2Smattdefine FB_R30 offsetof(struct faultbuf, fb_fixreg[17]) 2011.2Smattdefine FB_R31 offsetof(struct faultbuf, fb_fixreg[18]) 2021.2Smatt 2031.2Smattdefine CACHELINESIZE CACHELINESIZE 2041.2Smatt 2051.2Smattdefine CPU_CI offsetof(struct cpu_info, ci_ci) 2061.2Smatt 2071.2Smattdefine PAGE_SIZE PAGE_SIZE 2081.2Smattdefine PAGE_MASK PAGE_MASK 2091.2Smattdefine PAGE_SHIFT PAGE_SHIFT 2101.2Smattdefine KERNEL_PID KERNEL_PID 2111.2Smattdefine USPACE USPACE 2121.2Smatt 2131.2Smattdefine T_CRITIAL_INPUT T_CRITIAL_INPUT 2141.2Smattdefine T_MACHINE_CHECK T_MACHINE_CHECK 2151.2Smattdefine T_DSI T_DSI 2161.2Smattdefine T_ISI T_ISI 2171.2Smattdefine T_EXTERNAL_INPUT T_EXTERNAL_INPUT 2181.2Smattdefine T_ALIGNMENT T_ALIGNMENT 2191.2Smattdefine T_PROGRAM T_PROGRAM 2201.2Smattdefine T_FP_UNAVAILABLE T_FP_UNAVAILABLE 2211.2Smattdefine T_SYSTEM_CALL T_SYSTEM_CALL 2221.2Smattdefine T_AP_UNAVAILABLE T_AP_UNAVAILABLE 2231.2Smattdefine T_DECREMENTER T_DECREMENTER 2241.2Smattdefine T_FIXED_INTERVAL T_FIXED_INTERVAL 2251.2Smattdefine T_WATCHDOG T_WATCHDOG 2261.2Smattdefine T_DATA_TLB_ERROR T_DATA_TLB_ERROR 2271.2Smattdefine T_INSTRUCTION_TLB_ERROR T_INSTRUCTION_TLB_ERROR 2281.2Smattdefine T_DEBUG T_DEBUG 2291.2Smattdefine T_SPE_UNAVAILABLE T_SPE_UNAVAILABLE 2301.2Smattdefine T_EMBEDDED_FP_DATA T_EMBEDDED_FP_DATA 2311.2Smattdefine T_EMBEDDED_FP_ROUND T_EMBEDDED_FP_ROUND 2321.2Smattdefine T_EMBEDDED_PERF_MONITOR T_EMBEDDED_PERF_MONITOR 2331.2Smattdefine T_AST T_AST 2341.2Smatt 2351.2Smattifdef __HAVE_FAST_SOFTINTS 2361.2Smattdefine __HAVE_FAST_SOFTINTS __HAVE_FAST_SOFTINTS 2371.2Smattendif 2381.2Smatt 2391.2Smattdefine IPL_HIGH IPL_HIGH 2401.2Smattdefine IPL_SCHED IPL_SCHED 2411.2Smattdefine IPL_VM IPL_VM 2421.2Smatt 2431.2Smattifdef __HAVE_MUTEX_STUBS 2441.2Smattdefine __HAVE_MUTEX_STUBS __HAVE_MUTEX_STUBS 2451.2Smattendif 2461.2Smattifdef __HAVE_MUTEX_SPIN_STUBS 2471.2Smattdefine __HAVE_MUTEX_SPIN_STUBS __HAVE_MUTEX_SPIN_STUBS 2481.2Smattendif 2491.2Smattdefine MTX_OWNER offsetof(struct kmutex, mtx_owner) 2501.2Smattdefine MTX_LOCK offsetof(struct kmutex, mtx_lock) 2511.2Smattdefine MTX_IPL offsetof(struct kmutex, mtx_ipl) 2521.2Smatt 2531.2Smattifdef __HAVE_RW_STUBS 2541.2Smattdefine __HAVE_RW_STUBS __HAVE_RW_STUBS 2551.2Smattendif 2561.2Smattdefine RW_OWNER offsetof(struct krwlock, rw_owner) 2571.2Smattdefine RW_WRITE_LOCKED RW_WRITE_LOCKED 2581.2Smattdefine RW_READ_INCR RW_READ_INCR 2591.2Smattdefine RW_READER RW_READER 2601.2Smatt 2611.2Smatt##define USPACE USPACE 2621.2Smatt 2631.2Smattdefine PTE_SCALESHIFT ilog2(sizeof(pt_entry_t)) 2641.2Smattdefine PTR_SCALESHIFT ilog2(sizeof(void *)) 2651.5Smattdefine NSEGPG_SCALESHIFT PAGE_SHIFT - ilog2(sizeof(void *)) 2661.5Smattdefine NPTEPG_SCALESHIFT PAGE_SHIFT - ilog2(sizeof(pt_entry_t)) 2671.5Smatt 2681.2Smattdefine MSR_PR 31 - ilog2(PSL_PR) 2691.2Smattdefine MSR_DS 31 - ilog2(PSL_DS) 2701.2Smattdefine MSR_IS 31 - ilog2(PSL_IS) 271