2 * Copyright (c) 2006 The Regents of The University of Michigan
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.
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.
32 #include "arch/sparc/asi.hh"
36 bool AsiIsBlock(ASI asi
)
39 (asi
== ASI_BLK_AIUP
) ||
40 (asi
== ASI_BLK_AIUS
) ||
41 (asi
== ASI_BLK_AIUP_L
) ||
42 (asi
== ASI_BLK_AIUS_L
) ||
45 (asi
== ASI_BLK_PL
) ||
49 bool AsiIsPrimary(ASI asi
)
53 (asi
== ASI_BLK_AIUP
) ||
54 (asi
== ASI_AIUP_L
) ||
55 (asi
== ASI_BLK_AIUP_L
) ||
56 (asi
== ASI_LDTX_AIUP
) ||
57 (asi
== ASI_LDTX_AIUP_L
) ||
62 (asi
== ASI_PST8_P
) ||
63 (asi
== ASI_PST16_P
) ||
64 (asi
== ASI_PST32_P
) ||
65 (asi
== ASI_PST8_PL
) ||
66 (asi
== ASI_PST16_PL
) ||
67 (asi
== ASI_PST32_PL
) ||
69 (asi
== ASI_FL16_P
) ||
70 (asi
== ASI_FL8_PL
) ||
71 (asi
== ASI_FL16_PL
) ||
72 (asi
== ASI_LDTX_P
) ||
73 (asi
== ASI_LDTX_PL
) ||
78 bool AsiIsSecondary(ASI asi
)
82 (asi
== ASI_BLK_AIUS
) ||
83 (asi
== ASI_AIUS_L
) ||
84 (asi
== ASI_BLK_AIUS_L
) ||
85 (asi
== ASI_LDTX_AIUS
) ||
86 (asi
== ASI_LDTX_AIUS_L
) ||
91 (asi
== ASI_PST8_S
) ||
92 (asi
== ASI_PST16_S
) ||
93 (asi
== ASI_PST32_S
) ||
94 (asi
== ASI_PST8_SL
) ||
95 (asi
== ASI_PST16_SL
) ||
96 (asi
== ASI_PST32_SL
) ||
98 (asi
== ASI_FL16_S
) ||
99 (asi
== ASI_FL8_SL
) ||
100 (asi
== ASI_FL16_SL
) ||
101 (asi
== ASI_LDTX_S
) ||
102 (asi
== ASI_LDTX_SL
) ||
103 (asi
== ASI_BLK_S
) ||
107 bool AsiIsNucleus(ASI asi
)
112 (asi
== ASI_LDTX_N
) ||
113 (asi
== ASI_LDTX_NL
);
116 bool AsiIsAsIfUser(ASI asi
)
121 (asi
== ASI_BLK_AIUP
) ||
122 (asi
== ASI_BLK_AIUS
) ||
123 (asi
== ASI_AIUP_L
) ||
124 (asi
== ASI_AIUS_L
) ||
125 (asi
== ASI_BLK_AIUP_L
) ||
126 (asi
== ASI_BLK_AIUS_L
) ||
127 (asi
== ASI_LDTX_AIUP
) ||
128 (asi
== ASI_LDTX_AIUS
) ||
129 (asi
== ASI_LDTX_AIUP_L
) ||
130 (asi
== ASI_LDTX_AIUS_L
);
133 bool AsiIsIO(ASI asi
)
136 (asi
== ASI_REAL_IO
) ||
137 (asi
== ASI_REAL_IO_L
);
140 bool AsiIsReal(ASI asi
)
144 (asi
== ASI_REAL_IO
) ||
145 (asi
== ASI_REAL_L
) ||
146 (asi
== ASI_REAL_IO_L
) ||
147 (asi
== ASI_LDTX_REAL
) ||
148 (asi
== ASI_LDTX_REAL_L
);
151 bool AsiIsLittle(ASI asi
)
155 (asi
== ASI_AIUP_L
) ||
156 (asi
== ASI_AIUS_L
) ||
157 (asi
== ASI_REAL_L
) ||
158 (asi
== ASI_REAL_IO_L
) ||
159 (asi
== ASI_BLK_AIUP_L
) ||
160 (asi
== ASI_BLK_AIUS_L
) ||
161 (asi
== ASI_LDTX_AIUP_L
) ||
162 (asi
== ASI_LDTX_AIUS_L
) ||
163 (asi
== ASI_LDTX_REAL_L
) ||
164 (asi
== ASI_LDTX_NL
) ||
169 (asi
== ASI_PST8_PL
) ||
170 (asi
== ASI_PST8_SL
) ||
171 (asi
== ASI_PST16_PL
) ||
172 (asi
== ASI_PST16_SL
) ||
173 (asi
== ASI_PST32_PL
) ||
174 (asi
== ASI_PST32_SL
) ||
175 (asi
== ASI_FL8_PL
) ||
176 (asi
== ASI_FL8_SL
) ||
177 (asi
== ASI_FL16_PL
) ||
178 (asi
== ASI_FL16_SL
) ||
179 (asi
== ASI_LDTX_PL
) ||
180 (asi
== ASI_LDTX_SL
) ||
181 (asi
== ASI_BLK_PL
) ||
182 (asi
== ASI_BLK_SL
) ||
186 bool AsiIsTwin(ASI asi
)
189 (asi
>= ASI_LDTX_AIUP
&&
192 (asi
>= ASI_LDTX_AIUP_L
&&
193 asi
<= ASI_LDTX_NL
&&
197 asi
== ASI_LDTX_PL
||
201 bool AsiIsPartialStore(ASI asi
)
204 (asi
== ASI_PST8_P
) ||
205 (asi
== ASI_PST8_S
) ||
206 (asi
== ASI_PST16_P
) ||
207 (asi
== ASI_PST16_S
) ||
208 (asi
== ASI_PST32_P
) ||
209 (asi
== ASI_PST32_S
) ||
210 (asi
== ASI_PST8_PL
) ||
211 (asi
== ASI_PST8_SL
) ||
212 (asi
== ASI_PST16_PL
) ||
213 (asi
== ASI_PST16_SL
) ||
214 (asi
== ASI_PST32_PL
) ||
215 (asi
== ASI_PST32_SL
);
218 bool AsiIsFloatingLoad(ASI asi
)
221 (asi
== ASI_FL8_P
) ||
222 (asi
== ASI_FL8_S
) ||
223 (asi
== ASI_FL16_P
) ||
224 (asi
== ASI_FL16_S
) ||
225 (asi
== ASI_FL8_PL
) ||
226 (asi
== ASI_FL8_SL
) ||
227 (asi
== ASI_FL16_PL
) ||
228 (asi
== ASI_FL16_SL
);
231 bool AsiIsNoFault(ASI asi
)
240 bool AsiIsScratchPad(ASI asi
)
243 (asi
== ASI_SCRATCHPAD
) ||
244 (asi
== ASI_HYP_SCRATCHPAD
);
247 bool AsiIsCmt(ASI asi
)
250 (asi
== ASI_CMT_PER_STRAND
) ||
251 (asi
== ASI_CMT_SHARED
);
254 bool AsiIsQueue(ASI asi
)
256 return asi
== ASI_QUEUE
;
259 bool AsiIsInterrupt(ASI asi
)
261 return asi
== ASI_SWVR_INTR_RECEIVE
||
262 asi
== ASI_SWVR_UDB_INTR_W
||
263 asi
== ASI_SWVR_UDB_INTR_R
;
266 bool AsiIsMmu(ASI asi
)
268 return asi
== ASI_MMU
||
269 asi
== ASI_LSU_CONTROL_REG
||
270 (asi
>= ASI_DMMU_CTXT_ZERO_TSB_BASE_PS0
&&
271 asi
<= ASI_IMMU_CTXT_ZERO_CONFIG
) ||
272 (asi
>= ASI_DMMU_CTXT_NONZERO_TSB_BASE_PS0
&&
273 asi
<= ASI_IMMU_CTXT_NONZERO_CONFIG
) ||
275 asi
<= ASI_IMMU_TSB_PS1_PTR_REG
) ||
276 (asi
>= ASI_ITLB_DATA_IN_REG
&&
277 asi
<= ASI_TLB_INVALIDATE_ALL
);
280 bool AsiIsUnPriv(ASI asi
)
285 bool AsiIsPriv(ASI asi
)
291 bool AsiIsHPriv(ASI asi
)
293 return asi
>= 0x30 && asi
<= 0x7f;
296 bool AsiIsReg(ASI asi
)
298 return AsiIsMmu(asi
) || AsiIsScratchPad(asi
) ||
299 AsiIsSparcError(asi
) || AsiIsInterrupt(asi
)
303 bool AsiIsSparcError(ASI asi
)
305 return asi
== ASI_SPARC_ERROR_EN_REG
||
306 asi
== ASI_SPARC_ERROR_STATUS_REG
;