xref: /netbsd-src/sys/arch/powerpc/booke/genassym.cf (revision 3012a05a1373a21878572f8b1cbf65031d675293)
1#	$NetBSD: genassym.cf,v 1.11 2015/01/26 04:47:53 nonaka Exp $
2
3#-
4# Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
5# All rights reserved.
6#
7# This code is derived from software contributed to The NetBSD Foundation
8# by Raytheon BBN Technologies Corp and Defense Advanced Research Projects
9# Agency and which was developed by Matt Thomas of 3am Software Foundry.
10#
11# This material is based upon work supported by the Defense Advanced Research
12# Projects Agency and Space and Naval Warfare Systems Center, Pacific, under
13# Contract No. N66001-09-C-2073.
14# Approved for Public Release, Distribution Unlimited
15#
16# Copyright (c) 2010 The NetBSD Foundation, Inc.
17# All rights reserved.
18#
19# This code is derived from software contributed to The NetBSD Foundation
20# by Matt Thomas of 3am Software Foundry.
21#
22# Redistribution and use in source and binary forms, with or without
23# modification, are permitted provided that the following conditions
24# are met:
25# 1. Redistributions of source code must retain the above copyright
26#    notice, this list of conditions and the following disclaimer.
27# 2. Redistributions in binary form must reproduce the above copyright
28#    notice, this list of conditions and the following disclaimer in the
29#    documentation and/or other materials provided with the distribution.
30#
31# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
32# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
33# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
34# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
35# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41# POSSIBILITY OF SUCH DAMAGE.
42#+
43
44include "opt_multiprocessor.h"
45
46include <sys/param.h>
47include <sys/bitops.h>
48
49include <uvm/uvm_extern.h>
50
51include <machine/frame.h>
52include <machine/psl.h>
53include <machine/pmap.h>
54
55include <powerpc/booke/trap.h>
56include <powerpc/booke/pte.h>
57
58define	FRAME_DEAR	offsetof(struct ktrapframe, ktf_tf.tf_dear)
59define	FRAME_ESR	offsetof(struct ktrapframe, ktf_tf.tf_esr)
60define	FRAME_MCSR	offsetof(struct ktrapframe, ktf_tf.tf_mcsr)
61define	FRAME_MCAR	offsetof(struct ktrapframe, ktf_tf.tf_mcar)
62define	FRAME_SPRG1	offsetof(struct ktrapframe, ktf_tf.tf_sprg1)
63define	FRAME_SPEFSCR	offsetof(struct ktrapframe, ktf_tf.tf_spefscr)
64define	FRAME_CFRAME_LR	offsetof(struct ktrapframe, ktf_cframe_lr)
65
66define	CI_SAVELIFO	offsetof(struct cpu_info, ci_savearea[0])
67define	CI_PMAP_SEGTAB	offsetof(struct cpu_info, ci_pmap_segtabs[0])
68define	CI_EV_TLBMISS_SOFT offsetof(struct cpu_info, ci_ev_tlbmiss_soft.ev_count)
69
70define	PAGE_SIZE	PAGE_SIZE
71define	PAGE_MASK	PAGE_MASK
72define	PAGE_SHIFT	PAGE_SHIFT
73define	KERNEL_PID	KERNEL_PID
74define	USPACE		USPACE
75
76define	T_CRITIAL_INPUT		T_CRITIAL_INPUT
77define	T_MACHINE_CHECK		T_MACHINE_CHECK
78define	T_DSI			T_DSI
79define	T_ISI			T_ISI
80define	T_EXTERNAL_INPUT	T_EXTERNAL_INPUT
81define	T_ALIGNMENT		T_ALIGNMENT
82define	T_PROGRAM		T_PROGRAM
83define	T_FP_UNAVAILABLE	T_FP_UNAVAILABLE
84define	T_SYSTEM_CALL		T_SYSTEM_CALL
85define	T_AP_UNAVAILABLE	T_AP_UNAVAILABLE
86define	T_DECREMENTER		T_DECREMENTER
87define	T_FIXED_INTERVAL	T_FIXED_INTERVAL
88define	T_WATCHDOG		T_WATCHDOG
89define	T_DATA_TLB_ERROR	T_DATA_TLB_ERROR
90define	T_INSTRUCTION_TLB_ERROR	T_INSTRUCTION_TLB_ERROR
91define	T_DEBUG			T_DEBUG
92define	T_SPE_UNAVAILABLE	T_SPE_UNAVAILABLE
93define	T_EMBEDDED_FP_DATA	T_EMBEDDED_FP_DATA
94define	T_EMBEDDED_FP_ROUND	T_EMBEDDED_FP_ROUND
95define	T_EMBEDDED_PERF_MONITOR	T_EMBEDDED_PERF_MONITOR
96define	T_AST			T_AST
97
98define	PTE_SCALESHIFT	ilog2(sizeof(pt_entry_t))
99define	PTR_SCALESHIFT	ilog2(sizeof(void *))
100define	NSEGPG_SCALESHIFT	PAGE_SHIFT - ilog2(sizeof(void *))
101define	NPTEPG_SCALESHIFT	PAGE_SHIFT - ilog2(sizeof(pt_entry_t))
102
103define	MSR_DS		31 - ilog2(PSL_DS)
104define	MSR_IS		31 - ilog2(PSL_IS)
105
106ifdef MULTIPROCESSOR
107define	HATCH_CI		offsetof(struct cpu_hatch_data, hatch_ci)
108define	HATCH_HID0		offsetof(struct cpu_hatch_data, hatch_hid0)
109define	HATCH_RUNNING		offsetof(struct cpu_hatch_data, hatch_running)
110define	HATCH_SP		offsetof(struct cpu_hatch_data, hatch_sp)
111define	HATCH_TBU		offsetof(struct cpu_hatch_data, hatch_tbu)
112define	HATCH_TBL		offsetof(struct cpu_hatch_data, hatch_tbl)
113define	HATCH_TLBIDX		offsetof(struct cpu_hatch_data, hatch_tlbidx)
114
115define	__SIMPLELOCK_LOCKED	__SIMPLELOCK_LOCKED
116define	__SIMPLELOCK_UNLOCKED	__SIMPLELOCK_UNLOCKED
117endif
118