genassym.cf revision 1.6
11.6Smatt#	$NetBSD: genassym.cf,v 1.6 2011/06/18 21:17:29 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 <sys/param.h>
451.2Smattinclude <sys/bitops.h>
461.2Smatt
471.2Smattinclude <uvm/uvm_extern.h>
481.2Smatt
491.2Smattinclude <machine/frame.h>
501.6Smattinclude <machine/psl.h>
511.2Smattinclude <machine/pmap.h>
521.2Smatt
531.2Smattinclude <powerpc/booke/trap.h>
541.2Smattinclude <powerpc/booke/pte.h>
551.2Smatt
561.2Smattdefine	FRAME_DEAR	offsetof(struct ktrapframe, ktf_tf.tf_dear)
571.2Smattdefine	FRAME_ESR	offsetof(struct ktrapframe, ktf_tf.tf_esr)
581.2Smattdefine	FRAME_MCSR	offsetof(struct ktrapframe, ktf_tf.tf_mcsr)
591.2Smattdefine	FRAME_MCAR	offsetof(struct ktrapframe, ktf_tf.tf_mcar)
601.2Smattdefine	FRAME_SPRG1	offsetof(struct ktrapframe, ktf_tf.tf_sprg1)
611.2Smattdefine	FRAME_SPEFSCR	offsetof(struct ktrapframe, ktf_tf.tf_spefscr)
621.2Smatt
631.2Smattdefine	CI_SAVELIFO	offsetof(struct cpu_info, ci_savelifo)
641.2Smattdefine	CI_PMAP_SEGTAB	offsetof(struct cpu_info, ci_pmap_segtabs[0])
651.2Smattdefine	CI_EV_TLBMISS_SOFT offsetof(struct cpu_info, ci_ev_tlbmiss_soft.ev_count)
661.2Smatt
671.2Smattdefine	PAGE_SIZE	PAGE_SIZE
681.2Smattdefine	PAGE_MASK	PAGE_MASK
691.2Smattdefine	PAGE_SHIFT	PAGE_SHIFT
701.2Smattdefine	KERNEL_PID	KERNEL_PID
711.2Smattdefine	USPACE		USPACE
721.2Smatt
731.2Smattdefine	T_CRITIAL_INPUT		T_CRITIAL_INPUT
741.2Smattdefine	T_MACHINE_CHECK		T_MACHINE_CHECK
751.2Smattdefine	T_DSI			T_DSI
761.2Smattdefine	T_ISI			T_ISI
771.2Smattdefine	T_EXTERNAL_INPUT	T_EXTERNAL_INPUT
781.2Smattdefine	T_ALIGNMENT		T_ALIGNMENT
791.2Smattdefine	T_PROGRAM		T_PROGRAM
801.2Smattdefine	T_FP_UNAVAILABLE	T_FP_UNAVAILABLE
811.2Smattdefine	T_SYSTEM_CALL		T_SYSTEM_CALL
821.2Smattdefine	T_AP_UNAVAILABLE	T_AP_UNAVAILABLE
831.2Smattdefine	T_DECREMENTER		T_DECREMENTER
841.2Smattdefine	T_FIXED_INTERVAL	T_FIXED_INTERVAL
851.2Smattdefine	T_WATCHDOG		T_WATCHDOG
861.2Smattdefine	T_DATA_TLB_ERROR	T_DATA_TLB_ERROR
871.2Smattdefine	T_INSTRUCTION_TLB_ERROR	T_INSTRUCTION_TLB_ERROR
881.2Smattdefine	T_DEBUG			T_DEBUG
891.2Smattdefine	T_SPE_UNAVAILABLE	T_SPE_UNAVAILABLE
901.2Smattdefine	T_EMBEDDED_FP_DATA	T_EMBEDDED_FP_DATA
911.2Smattdefine	T_EMBEDDED_FP_ROUND	T_EMBEDDED_FP_ROUND
921.2Smattdefine	T_EMBEDDED_PERF_MONITOR	T_EMBEDDED_PERF_MONITOR
931.2Smattdefine	T_AST			T_AST
941.2Smatt
951.2Smattdefine	PTE_SCALESHIFT	ilog2(sizeof(pt_entry_t))
961.2Smattdefine	PTR_SCALESHIFT	ilog2(sizeof(void *))
971.5Smattdefine	NSEGPG_SCALESHIFT	PAGE_SHIFT - ilog2(sizeof(void *))
981.5Smattdefine	NPTEPG_SCALESHIFT	PAGE_SHIFT - ilog2(sizeof(pt_entry_t))
991.5Smatt
1001.2Smattdefine	MSR_DS		31 - ilog2(PSL_DS)
1011.2Smattdefine	MSR_IS		31 - ilog2(PSL_IS)
102