1/*
2 * Copyright (c) 1993 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef EV5_OSFALPHA_DEFS_INCLUDED
30#define EV5_OSFALPHA_DEFS_INCLUDED 1
31
32// from ev5_osfalpha_defs.mar from Lance's fetch directory
33// lowercaseified and $ changed to _ and reformatting for gas...pb Nov/95
34
35//
36// PS Layout - PS
37//	Loc	Size	name 	function
38//	------	------	-----	-----------------------------------
39//	<0:2>	3	IPL	Prio level
40//	<3>	1	CM	Current Mode
41//
42
43#define	osfps_v_mode		3
44#define	osfps_m_mode		(1<<osfps_v_mode)
45#define	osfps_v_ipl		0
46#define	osfps_m_ipl		(7<<osfps_v_ipl)
47
48#define	osfipl_c_mchk		7
49#define	osfipl_c_rt		6
50#define	osfipl_c_clk		5
51#define	osfipl_c_dev1		4
52#define	osfipl_c_dev0		3
53#define	osfipl_c_sw1		2
54#define	osfipl_c_sw0		1
55#define	osfipl_c_zero		0
56
57#define	osfint_c_mchk		2
58#define	osfint_c_clk		1
59#define	osfint_c_dev		3
60#define	osfint_c_ip		0
61#define	osfint_c_perf		4
62#define	osfint_c_passrel	5
63
64//
65// PTE layout - symbol prefix osfpte_
66//
67//	Loc	Size	name 	function
68//	------	------	------	-----------------------------------
69//	<63:32>	32	PFN	Page Frame Number
70//	<31:16>	16	SOFT	Bits reserved for software use
71//	<15:14>	2
72//	<13>	1	UWE	User write enable
73//	<12>	1	KWE	Kernel write enable
74//	<11:10>	2
75//	<9>	1	URE	User read enable
76//	<8>	1	KRE	Kernel read enable
77//	<7:6>	2	RES	Reserved SBZ
78//	<5>	1	HPF	Huge Page Flag
79//	<4>	1	ASM	Wild card address space number match
80//	<3>	1	FOE	Fault On execute
81//	<2>	1	FOW	Fault On Write
82//	<1>	1	FOR	Fault On Read
83// 	<0>	1	V	valid bit
84//
85
86#define	osfpte_v_pfn	32
87#define	osfpte_m_soft	(0xFFFF0000)
88#define	osfpte_v_soft	16
89#define	osfpte_m_uwe	(0x2000)
90#define	osfpte_v_uwe	13
91#define	osfpte_m_kwe	(0x1000)
92#define	osfpte_v_kwe	12
93#define	osfpte_m_ure	(0x0200)
94#define	osfpte_v_ure	 9
95#define	osfpte_m_kre	(0x0100)
96#define	osfpte_v_kre	 8
97#define	osfpte_m_hpf	(0x0020)
98#define	osfpte_v_hpf	5
99#define	osfpte_m_asm	(0x0010)
100#define	osfpte_v_asm	4
101#define	osfpte_m_foe	(0x0008)
102#define	osfpte_v_foe	3
103#define	osfpte_m_fow	(0x0004)
104#define	osfpte_v_fow	2
105#define	osfpte_m_for	(0x0002)
106#define	osfpte_v_for	1
107#define	osfpte_m_v	(0x0001)
108#define	osfpte_v_v	0
109
110#define	osfpte_m_ksegbits	(osfpte_m_kre | osfpte_m_kwe | osfpte_m_v | osfpte_m_asm)
111#define	osfpte_m_prot	(osfpte_m_ure+osfpte_m_uwe | osfpte_m_kre | osfpte_m_kwe)
112
113//
114// VA layout - symbol prefix VA_
115//
116//	Loc	Size	name 	function
117//	------	------	-------	-----------------------------------
118//	<42:33>	10	SEG1	First seg table offset for mapping
119//	<32:23>	10	SEG2	Second seg table offset for mapping
120//	<22:13>	10	SEG3	Third seg table offset for mapping
121//	<12:0>	13	OFFSET	Byte within page
122//
123
124#define	osfva_m_offset	(0x000000001FFF)
125#define	osfva_v_offset	0
126#define	osfva_m_seg3	(0x0000007FE000)
127#define	osfva_v_seg3	13
128#define	osfva_m_seg2	(0x0001FF800000)
129#define	osfva_v_seg2	23
130#define	osfva_m_seg1	(0x7FE00000000)
131#define	osfva_v_seg1	33
132
133#define	osfpcb_q_ksp	(0x0000)
134#define	osfpcb_q_usp	(0x0008)
135#define	osfpcb_q_Usp	(0x0008)
136#define	osfpcb_q_mmptr	(0x0010)
137#define	osfpcb_q_Mmptr	(0x0010)
138#define	osfpcb_l_cc	(0x0018)
139#define	osfpcb_l_asn	(0x001C)
140#define	osfpcb_q_unique (0x0020)
141#define	osfpcb_q_fen	(0x0028)
142#define	osfpcb_v_pme	62
143
144#define	osfsf_ps	(0x00)
145#define	osfsf_pc	(0x08)
146#define	osfsf_gp	(0x10)
147#define	osfsf_a0	(0x18)
148#define	osfsf_a1	(0x20)
149#define	osfsf_a2	(0x28)
150#define	osfsf_c_size	(0x30)
151
152#endif
153