1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 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 * Authors: Gabe Black 29 * Kevin Lim 30 */ 31 32#ifndef __ALPHA_FAULTS_HH__ 33#define __ALPHA_FAULTS_HH__ 34 35#include "sim/faults.hh" 36 37// The design of the "name" and "vect" functions is in sim/faults.hh 38 39namespace SparcISA 40{ 41 42typedef const uint32_t TrapType; 43typedef const uint32_t FaultPriority; 44 45class SparcFault : public FaultBase 46{ 47 public: 48#if FULL_SYSTEM 49 void invoke(ThreadContext * tc); 50#endif 51 virtual TrapType trapType() = 0; 52 virtual FaultPriority priority() = 0; 53 virtual FaultStat & countStat() = 0; 54}; 55 56class InternalProcessorError : public SparcFault 57{ 58 private: 59 static FaultName _name; 60 static TrapType _trapType; 61 static FaultPriority _priority; 62 static FaultStat _count; 63 public: 64 FaultName name() {return _name;} 65 TrapType trapType() {return _trapType;} 66 FaultPriority priority() {return _priority;} 67 FaultStat & countStat() {return _count;} 68 bool isMachineCheckFault() {return true;} 69}; 70 71class MemAddressNotAligned : public SparcFault 72{ 73 private: 74 static FaultName _name; 75 static TrapType _trapType; 76 static FaultPriority _priority; 77 static FaultStat _count; 78 public: 79 FaultName name() {return _name;} 80 TrapType trapType() {return _trapType;} 81 FaultPriority priority() {return _priority;} 82 FaultStat & countStat() {return _count;} 83 bool isAlignmentFault() {return true;} 84}; 85
| 1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 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 * Authors: Gabe Black 29 * Kevin Lim 30 */ 31 32#ifndef __ALPHA_FAULTS_HH__ 33#define __ALPHA_FAULTS_HH__ 34 35#include "sim/faults.hh" 36 37// The design of the "name" and "vect" functions is in sim/faults.hh 38 39namespace SparcISA 40{ 41 42typedef const uint32_t TrapType; 43typedef const uint32_t FaultPriority; 44 45class SparcFault : public FaultBase 46{ 47 public: 48#if FULL_SYSTEM 49 void invoke(ThreadContext * tc); 50#endif 51 virtual TrapType trapType() = 0; 52 virtual FaultPriority priority() = 0; 53 virtual FaultStat & countStat() = 0; 54}; 55 56class InternalProcessorError : public SparcFault 57{ 58 private: 59 static FaultName _name; 60 static TrapType _trapType; 61 static FaultPriority _priority; 62 static FaultStat _count; 63 public: 64 FaultName name() {return _name;} 65 TrapType trapType() {return _trapType;} 66 FaultPriority priority() {return _priority;} 67 FaultStat & countStat() {return _count;} 68 bool isMachineCheckFault() {return true;} 69}; 70 71class MemAddressNotAligned : public SparcFault 72{ 73 private: 74 static FaultName _name; 75 static TrapType _trapType; 76 static FaultPriority _priority; 77 static FaultStat _count; 78 public: 79 FaultName name() {return _name;} 80 TrapType trapType() {return _trapType;} 81 FaultPriority priority() {return _priority;} 82 FaultStat & countStat() {return _count;} 83 bool isAlignmentFault() {return true;} 84}; 85
|
86static inline Fault genMachineCheckFault() 87{ 88 return new InternalProcessorError; 89} 90 91static inline Fault genAlignmentFault() 92{ 93 return new MemAddressNotAligned; 94} 95 96class PowerOnReset : public SparcFault 97{ 98 private: 99 static FaultName _name; 100 static TrapType _trapType; 101 static FaultPriority _priority; 102 static FaultStat _count; 103 public: 104 FaultName name() {return _name;} 105 TrapType trapType() {return _trapType;} 106 FaultPriority priority() {return _priority;} 107 FaultStat & countStat() {return _count;} 108}; 109 110class WatchDogReset : public SparcFault 111{ 112 private: 113 static FaultName _name; 114 static TrapType _trapType; 115 static FaultPriority _priority; 116 static FaultStat _count; 117 public: 118 FaultName name() {return _name;} 119 TrapType trapType() {return _trapType;} 120 FaultPriority priority() {return _priority;} 121 FaultStat & countStat() {return _count;} 122}; 123 124class ExternallyInitiatedReset : public SparcFault 125{ 126 private: 127 static FaultName _name; 128 static TrapType _trapType; 129 static FaultPriority _priority; 130 static FaultStat _count; 131 public: 132 FaultName name() {return _name;} 133 TrapType trapType() {return _trapType;} 134 FaultPriority priority() {return _priority;} 135 FaultStat & countStat() {return _count;} 136}; 137 138class SoftwareInitiatedReset : public SparcFault 139{ 140 private: 141 static FaultName _name; 142 static TrapType _trapType; 143 static FaultPriority _priority; 144 static FaultStat _count; 145 public: 146 FaultName name() {return _name;} 147 TrapType trapType() {return _trapType;} 148 FaultPriority priority() {return _priority;} 149 FaultStat & countStat() {return _count;} 150}; 151 152class REDStateException : public SparcFault 153{ 154 private: 155 static FaultName _name; 156 static TrapType _trapType; 157 static FaultPriority _priority; 158 static FaultStat _count; 159 public: 160 FaultName name() {return _name;} 161 TrapType trapType() {return _trapType;} 162 FaultPriority priority() {return _priority;} 163 FaultStat & countStat() {return _count;} 164}; 165 166class InstructionAccessException : public SparcFault 167{ 168 private: 169 static FaultName _name; 170 static TrapType _trapType; 171 static FaultPriority _priority; 172 static FaultStat _count; 173 public: 174 FaultName name() {return _name;} 175 TrapType trapType() {return _trapType;} 176 FaultPriority priority() {return _priority;} 177 FaultStat & countStat() {return _count;} 178}; 179 180class InstructionAccessMMUMiss : public SparcFault 181{ 182 private: 183 static FaultName _name; 184 static TrapType _trapType; 185 static FaultPriority _priority; 186 static FaultStat _count; 187 public: 188 FaultName name() {return _name;} 189 TrapType trapType() {return _trapType;} 190 FaultPriority priority() {return _priority;} 191 FaultStat & countStat() {return _count;} 192}; 193 194class InstructionAccessError : public SparcFault 195{ 196 private: 197 static FaultName _name; 198 static TrapType _trapType; 199 static FaultPriority _priority; 200 static FaultStat _count; 201 public: 202 FaultName name() {return _name;} 203 TrapType trapType() {return _trapType;} 204 FaultPriority priority() {return _priority;} 205 FaultStat & countStat() {return _count;} 206}; 207 208class IllegalInstruction : public SparcFault 209{ 210 private: 211 static FaultName _name; 212 static TrapType _trapType; 213 static FaultPriority _priority; 214 static FaultStat _count; 215 public: 216 FaultName name() {return _name;} 217 TrapType trapType() {return _trapType;} 218 FaultPriority priority() {return _priority;} 219 FaultStat & countStat() {return _count;} 220}; 221 222class PrivilegedOpcode : public SparcFault 223{ 224 private: 225 static FaultName _name; 226 static TrapType _trapType; 227 static FaultPriority _priority; 228 static FaultStat _count; 229 public: 230 FaultName name() {return _name;} 231 TrapType trapType() {return _trapType;} 232 FaultPriority priority() {return _priority;} 233 FaultStat & countStat() {return _count;} 234}; 235 236class UnimplementedLDD : public SparcFault 237{ 238 private: 239 static FaultName _name; 240 static TrapType _trapType; 241 static FaultPriority _priority; 242 static FaultStat _count; 243 public: 244 FaultName name() {return _name;} 245 TrapType trapType() {return _trapType;} 246 FaultPriority priority() {return _priority;} 247 FaultStat & countStat() {return _count;} 248}; 249 250class UnimplementedSTD : public SparcFault 251{ 252 private: 253 static FaultName _name; 254 static TrapType _trapType; 255 static FaultPriority _priority; 256 static FaultStat _count; 257 public: 258 FaultName name() {return _name;} 259 TrapType trapType() {return _trapType;} 260 FaultPriority priority() {return _priority;} 261 FaultStat & countStat() {return _count;} 262}; 263 264class FpDisabled : public SparcFault 265{ 266 private: 267 static FaultName _name; 268 static TrapType _trapType; 269 static FaultPriority _priority; 270 static FaultStat _count; 271 public: 272 FaultName name() {return _name;} 273 TrapType trapType() {return _trapType;} 274 FaultPriority priority() {return _priority;} 275 FaultStat & countStat() {return _count;} 276}; 277 278class FpExceptionIEEE754 : public SparcFault 279{ 280 private: 281 static FaultName _name; 282 static TrapType _trapType; 283 static FaultPriority _priority; 284 static FaultStat _count; 285 public: 286 FaultName name() {return _name;} 287 TrapType trapType() {return _trapType;} 288 FaultPriority priority() {return _priority;} 289 FaultStat & countStat() {return _count;} 290}; 291 292class FpExceptionOther : public SparcFault 293{ 294 private: 295 static FaultName _name; 296 static TrapType _trapType; 297 static FaultPriority _priority; 298 static FaultStat _count; 299 public: 300 FaultName name() {return _name;} 301 TrapType trapType() {return _trapType;} 302 FaultPriority priority() {return _priority;} 303 FaultStat & countStat() {return _count;} 304}; 305 306class TagOverflow : public SparcFault 307{ 308 private: 309 static FaultName _name; 310 static TrapType _trapType; 311 static FaultPriority _priority; 312 static FaultStat _count; 313 public: 314 FaultName name() {return _name;} 315 TrapType trapType() {return _trapType;} 316 FaultPriority priority() {return _priority;} 317 FaultStat & countStat() {return _count;} 318}; 319 320class DivisionByZero : public SparcFault 321{ 322 private: 323 static FaultName _name; 324 static TrapType _trapType; 325 static FaultPriority _priority; 326 static FaultStat _count; 327 public: 328 FaultName name() {return _name;} 329 TrapType trapType() {return _trapType;} 330 FaultPriority priority() {return _priority;} 331 FaultStat & countStat() {return _count;} 332}; 333 334class DataAccessException : public SparcFault 335{ 336 private: 337 static FaultName _name; 338 static TrapType _trapType; 339 static FaultPriority _priority; 340 static FaultStat _count; 341 public: 342 FaultName name() {return _name;} 343 TrapType trapType() {return _trapType;} 344 FaultPriority priority() {return _priority;} 345 FaultStat & countStat() {return _count;} 346}; 347 348class DataAccessMMUMiss : public SparcFault 349{ 350 private: 351 static FaultName _name; 352 static TrapType _trapType; 353 static FaultPriority _priority; 354 static FaultStat _count; 355 public: 356 FaultName name() {return _name;} 357 TrapType trapType() {return _trapType;} 358 FaultPriority priority() {return _priority;} 359 FaultStat & countStat() {return _count;} 360}; 361 362class DataAccessError : public SparcFault 363{ 364 private: 365 static FaultName _name; 366 static TrapType _trapType; 367 static FaultPriority _priority; 368 static FaultStat _count; 369 public: 370 FaultName name() {return _name;} 371 TrapType trapType() {return _trapType;} 372 FaultPriority priority() {return _priority;} 373 FaultStat & countStat() {return _count;} 374}; 375 376class DataAccessProtection : public SparcFault 377{ 378 private: 379 static FaultName _name; 380 static TrapType _trapType; 381 static FaultPriority _priority; 382 static FaultStat _count; 383 public: 384 FaultName name() {return _name;} 385 TrapType trapType() {return _trapType;} 386 FaultPriority priority() {return _priority;} 387 FaultStat & countStat() {return _count;} 388}; 389 390class LDDFMemAddressNotAligned : public SparcFault 391{ 392 private: 393 static FaultName _name; 394 static TrapType _trapType; 395 static FaultPriority _priority; 396 static FaultStat _count; 397 public: 398 FaultName name() {return _name;} 399 TrapType trapType() {return _trapType;} 400 FaultPriority priority() {return _priority;} 401 FaultStat & countStat() {return _count;} 402}; 403 404class STDFMemAddressNotAligned : public SparcFault 405{ 406 private: 407 static FaultName _name; 408 static TrapType _trapType; 409 static FaultPriority _priority; 410 static FaultStat _count; 411 public: 412 FaultName name() {return _name;} 413 TrapType trapType() {return _trapType;} 414 FaultPriority priority() {return _priority;} 415 FaultStat & countStat() {return _count;} 416}; 417 418class PrivilegedAction : public SparcFault 419{ 420 private: 421 static FaultName _name; 422 static TrapType _trapType; 423 static FaultPriority _priority; 424 static FaultStat _count; 425 public: 426 FaultName name() {return _name;} 427 TrapType trapType() {return _trapType;} 428 FaultPriority priority() {return _priority;} 429 FaultStat & countStat() {return _count;} 430}; 431 432class LDQFMemAddressNotAligned : public SparcFault 433{ 434 private: 435 static FaultName _name; 436 static TrapType _trapType; 437 static FaultPriority _priority; 438 static FaultStat _count; 439 public: 440 FaultName name() {return _name;} 441 TrapType trapType() {return _trapType;} 442 FaultPriority priority() {return _priority;} 443 FaultStat & countStat() {return _count;} 444}; 445 446class STQFMemAddressNotAligned : public SparcFault 447{ 448 private: 449 static FaultName _name; 450 static TrapType _trapType; 451 static FaultPriority _priority; 452 static FaultStat _count; 453 public: 454 FaultName name() {return _name;} 455 TrapType trapType() {return _trapType;} 456 FaultPriority priority() {return _priority;} 457 FaultStat & countStat() {return _count;} 458}; 459 460class AsyncDataError : public SparcFault 461{ 462 private: 463 static FaultName _name; 464 static TrapType _trapType; 465 static FaultPriority _priority; 466 static FaultStat _count; 467 public: 468 FaultName name() {return _name;} 469 TrapType trapType() {return _trapType;} 470 FaultPriority priority() {return _priority;} 471 FaultStat & countStat() {return _count;} 472}; 473 474class CleanWindow : public SparcFault 475{ 476 private: 477 static FaultName _name; 478 static TrapType _trapType; 479 static FaultPriority _priority; 480 static FaultStat _count; 481 public: 482 FaultName name() {return _name;} 483 TrapType trapType() {return _trapType;} 484 FaultPriority priority() {return _priority;} 485 FaultStat & countStat() {return _count;} 486}; 487 488class EnumeratedFault : public SparcFault 489{ 490 protected: 491 uint32_t _n; 492 virtual TrapType baseTrapType() = 0; 493 public: 494 EnumeratedFault(uint32_t n) : SparcFault() {_n = n;} 495 TrapType trapType() {return baseTrapType() + _n;} 496}; 497 498class InterruptLevelN : public EnumeratedFault 499{ 500 private: 501 static FaultName _name; 502 static TrapType _baseTrapType; 503 static FaultStat _count; 504 TrapType baseTrapType() {return _baseTrapType;} 505 public: 506 InterruptLevelN(uint32_t n) : EnumeratedFault(n) {;} 507 FaultName name() {return _name;} 508 FaultPriority priority() {return 32 - _n;} 509 FaultStat & countStat() {return _count;} 510}; 511 512class SpillNNormal : public EnumeratedFault 513{ 514 private: 515 static FaultName _name; 516 static TrapType _baseTrapType; 517 static FaultPriority _priority; 518 static FaultStat _count; 519 TrapType baseTrapType() {return _baseTrapType;} 520 public: 521 SpillNNormal(uint32_t n) : EnumeratedFault(n) {;} 522 FaultName name() {return _name;} 523 FaultPriority priority() {return _priority;} 524 FaultStat & countStat() {return _count;} 525}; 526 527class SpillNOther : public EnumeratedFault 528{ 529 private: 530 static FaultName _name; 531 static TrapType _baseTrapType; 532 static FaultPriority _priority; 533 static FaultStat _count; 534 TrapType baseTrapType() {return _baseTrapType;} 535 public: 536 SpillNOther(uint32_t n) : EnumeratedFault(n) {;} 537 FaultName name() {return _name;} 538 FaultPriority priority() {return _priority;} 539 FaultStat & countStat() {return _count;} 540}; 541 542class FillNNormal : public EnumeratedFault 543{ 544 private: 545 static FaultName _name; 546 static TrapType _baseTrapType; 547 static FaultPriority _priority; 548 static FaultStat _count; 549 TrapType baseTrapType() {return _baseTrapType;} 550 public: 551 FillNNormal(uint32_t n) : EnumeratedFault(n) {;} 552 FaultName name() {return _name;} 553 FaultPriority priority() {return _priority;} 554 FaultStat & countStat() {return _count;} 555}; 556 557class FillNOther : public EnumeratedFault 558{ 559 private: 560 static FaultName _name; 561 static TrapType _baseTrapType; 562 static FaultPriority _priority; 563 static FaultStat _count; 564 TrapType baseTrapType() {return _baseTrapType;} 565 public: 566 FillNOther(uint32_t n) : EnumeratedFault(n) {;} 567 FaultName name() {return _name;} 568 FaultPriority priority() {return _priority;} 569 FaultStat & countStat() {return _count;} 570}; 571 572class TrapInstruction : public EnumeratedFault 573{ 574 private: 575 static FaultName _name; 576 static TrapType _baseTrapType; 577 static FaultPriority _priority; 578 static FaultStat _count; 579 uint64_t syscall_num; 580 TrapType baseTrapType() {return _baseTrapType;} 581 public: 582 TrapInstruction(uint32_t n, uint64_t syscall) : 583 EnumeratedFault(n), syscall_num(syscall) {;} 584 FaultName name() {return _name;} 585 FaultPriority priority() {return _priority;} 586 FaultStat & countStat() {return _count;} 587#if !FULL_SYSTEM 588 void invoke(ThreadContext * tc); 589#endif 590}; 591
| 111static inline Fault genMachineCheckFault() 112{ 113 return new InternalProcessorError; 114} 115 116static inline Fault genAlignmentFault() 117{ 118 return new MemAddressNotAligned; 119} 120 121class PowerOnReset : public SparcFault 122{ 123 private: 124 static FaultName _name; 125 static TrapType _trapType; 126 static FaultPriority _priority; 127 static FaultStat _count; 128 public: 129 FaultName name() {return _name;} 130 TrapType trapType() {return _trapType;} 131 FaultPriority priority() {return _priority;} 132 FaultStat & countStat() {return _count;} 133}; 134 135class WatchDogReset : public SparcFault 136{ 137 private: 138 static FaultName _name; 139 static TrapType _trapType; 140 static FaultPriority _priority; 141 static FaultStat _count; 142 public: 143 FaultName name() {return _name;} 144 TrapType trapType() {return _trapType;} 145 FaultPriority priority() {return _priority;} 146 FaultStat & countStat() {return _count;} 147}; 148 149class ExternallyInitiatedReset : public SparcFault 150{ 151 private: 152 static FaultName _name; 153 static TrapType _trapType; 154 static FaultPriority _priority; 155 static FaultStat _count; 156 public: 157 FaultName name() {return _name;} 158 TrapType trapType() {return _trapType;} 159 FaultPriority priority() {return _priority;} 160 FaultStat & countStat() {return _count;} 161}; 162 163class SoftwareInitiatedReset : public SparcFault 164{ 165 private: 166 static FaultName _name; 167 static TrapType _trapType; 168 static FaultPriority _priority; 169 static FaultStat _count; 170 public: 171 FaultName name() {return _name;} 172 TrapType trapType() {return _trapType;} 173 FaultPriority priority() {return _priority;} 174 FaultStat & countStat() {return _count;} 175}; 176 177class REDStateException : public SparcFault 178{ 179 private: 180 static FaultName _name; 181 static TrapType _trapType; 182 static FaultPriority _priority; 183 static FaultStat _count; 184 public: 185 FaultName name() {return _name;} 186 TrapType trapType() {return _trapType;} 187 FaultPriority priority() {return _priority;} 188 FaultStat & countStat() {return _count;} 189}; 190 191class InstructionAccessException : public SparcFault 192{ 193 private: 194 static FaultName _name; 195 static TrapType _trapType; 196 static FaultPriority _priority; 197 static FaultStat _count; 198 public: 199 FaultName name() {return _name;} 200 TrapType trapType() {return _trapType;} 201 FaultPriority priority() {return _priority;} 202 FaultStat & countStat() {return _count;} 203}; 204 205class InstructionAccessMMUMiss : public SparcFault 206{ 207 private: 208 static FaultName _name; 209 static TrapType _trapType; 210 static FaultPriority _priority; 211 static FaultStat _count; 212 public: 213 FaultName name() {return _name;} 214 TrapType trapType() {return _trapType;} 215 FaultPriority priority() {return _priority;} 216 FaultStat & countStat() {return _count;} 217}; 218 219class InstructionAccessError : public SparcFault 220{ 221 private: 222 static FaultName _name; 223 static TrapType _trapType; 224 static FaultPriority _priority; 225 static FaultStat _count; 226 public: 227 FaultName name() {return _name;} 228 TrapType trapType() {return _trapType;} 229 FaultPriority priority() {return _priority;} 230 FaultStat & countStat() {return _count;} 231}; 232 233class IllegalInstruction : public SparcFault 234{ 235 private: 236 static FaultName _name; 237 static TrapType _trapType; 238 static FaultPriority _priority; 239 static FaultStat _count; 240 public: 241 FaultName name() {return _name;} 242 TrapType trapType() {return _trapType;} 243 FaultPriority priority() {return _priority;} 244 FaultStat & countStat() {return _count;} 245}; 246 247class PrivilegedOpcode : public SparcFault 248{ 249 private: 250 static FaultName _name; 251 static TrapType _trapType; 252 static FaultPriority _priority; 253 static FaultStat _count; 254 public: 255 FaultName name() {return _name;} 256 TrapType trapType() {return _trapType;} 257 FaultPriority priority() {return _priority;} 258 FaultStat & countStat() {return _count;} 259}; 260 261class UnimplementedLDD : public SparcFault 262{ 263 private: 264 static FaultName _name; 265 static TrapType _trapType; 266 static FaultPriority _priority; 267 static FaultStat _count; 268 public: 269 FaultName name() {return _name;} 270 TrapType trapType() {return _trapType;} 271 FaultPriority priority() {return _priority;} 272 FaultStat & countStat() {return _count;} 273}; 274 275class UnimplementedSTD : public SparcFault 276{ 277 private: 278 static FaultName _name; 279 static TrapType _trapType; 280 static FaultPriority _priority; 281 static FaultStat _count; 282 public: 283 FaultName name() {return _name;} 284 TrapType trapType() {return _trapType;} 285 FaultPriority priority() {return _priority;} 286 FaultStat & countStat() {return _count;} 287}; 288 289class FpDisabled : public SparcFault 290{ 291 private: 292 static FaultName _name; 293 static TrapType _trapType; 294 static FaultPriority _priority; 295 static FaultStat _count; 296 public: 297 FaultName name() {return _name;} 298 TrapType trapType() {return _trapType;} 299 FaultPriority priority() {return _priority;} 300 FaultStat & countStat() {return _count;} 301}; 302 303class FpExceptionIEEE754 : public SparcFault 304{ 305 private: 306 static FaultName _name; 307 static TrapType _trapType; 308 static FaultPriority _priority; 309 static FaultStat _count; 310 public: 311 FaultName name() {return _name;} 312 TrapType trapType() {return _trapType;} 313 FaultPriority priority() {return _priority;} 314 FaultStat & countStat() {return _count;} 315}; 316 317class FpExceptionOther : public SparcFault 318{ 319 private: 320 static FaultName _name; 321 static TrapType _trapType; 322 static FaultPriority _priority; 323 static FaultStat _count; 324 public: 325 FaultName name() {return _name;} 326 TrapType trapType() {return _trapType;} 327 FaultPriority priority() {return _priority;} 328 FaultStat & countStat() {return _count;} 329}; 330 331class TagOverflow : public SparcFault 332{ 333 private: 334 static FaultName _name; 335 static TrapType _trapType; 336 static FaultPriority _priority; 337 static FaultStat _count; 338 public: 339 FaultName name() {return _name;} 340 TrapType trapType() {return _trapType;} 341 FaultPriority priority() {return _priority;} 342 FaultStat & countStat() {return _count;} 343}; 344 345class DivisionByZero : public SparcFault 346{ 347 private: 348 static FaultName _name; 349 static TrapType _trapType; 350 static FaultPriority _priority; 351 static FaultStat _count; 352 public: 353 FaultName name() {return _name;} 354 TrapType trapType() {return _trapType;} 355 FaultPriority priority() {return _priority;} 356 FaultStat & countStat() {return _count;} 357}; 358 359class DataAccessException : public SparcFault 360{ 361 private: 362 static FaultName _name; 363 static TrapType _trapType; 364 static FaultPriority _priority; 365 static FaultStat _count; 366 public: 367 FaultName name() {return _name;} 368 TrapType trapType() {return _trapType;} 369 FaultPriority priority() {return _priority;} 370 FaultStat & countStat() {return _count;} 371}; 372 373class DataAccessMMUMiss : public SparcFault 374{ 375 private: 376 static FaultName _name; 377 static TrapType _trapType; 378 static FaultPriority _priority; 379 static FaultStat _count; 380 public: 381 FaultName name() {return _name;} 382 TrapType trapType() {return _trapType;} 383 FaultPriority priority() {return _priority;} 384 FaultStat & countStat() {return _count;} 385}; 386 387class DataAccessError : public SparcFault 388{ 389 private: 390 static FaultName _name; 391 static TrapType _trapType; 392 static FaultPriority _priority; 393 static FaultStat _count; 394 public: 395 FaultName name() {return _name;} 396 TrapType trapType() {return _trapType;} 397 FaultPriority priority() {return _priority;} 398 FaultStat & countStat() {return _count;} 399}; 400 401class DataAccessProtection : public SparcFault 402{ 403 private: 404 static FaultName _name; 405 static TrapType _trapType; 406 static FaultPriority _priority; 407 static FaultStat _count; 408 public: 409 FaultName name() {return _name;} 410 TrapType trapType() {return _trapType;} 411 FaultPriority priority() {return _priority;} 412 FaultStat & countStat() {return _count;} 413}; 414 415class LDDFMemAddressNotAligned : public SparcFault 416{ 417 private: 418 static FaultName _name; 419 static TrapType _trapType; 420 static FaultPriority _priority; 421 static FaultStat _count; 422 public: 423 FaultName name() {return _name;} 424 TrapType trapType() {return _trapType;} 425 FaultPriority priority() {return _priority;} 426 FaultStat & countStat() {return _count;} 427}; 428 429class STDFMemAddressNotAligned : public SparcFault 430{ 431 private: 432 static FaultName _name; 433 static TrapType _trapType; 434 static FaultPriority _priority; 435 static FaultStat _count; 436 public: 437 FaultName name() {return _name;} 438 TrapType trapType() {return _trapType;} 439 FaultPriority priority() {return _priority;} 440 FaultStat & countStat() {return _count;} 441}; 442 443class PrivilegedAction : public SparcFault 444{ 445 private: 446 static FaultName _name; 447 static TrapType _trapType; 448 static FaultPriority _priority; 449 static FaultStat _count; 450 public: 451 FaultName name() {return _name;} 452 TrapType trapType() {return _trapType;} 453 FaultPriority priority() {return _priority;} 454 FaultStat & countStat() {return _count;} 455}; 456 457class LDQFMemAddressNotAligned : public SparcFault 458{ 459 private: 460 static FaultName _name; 461 static TrapType _trapType; 462 static FaultPriority _priority; 463 static FaultStat _count; 464 public: 465 FaultName name() {return _name;} 466 TrapType trapType() {return _trapType;} 467 FaultPriority priority() {return _priority;} 468 FaultStat & countStat() {return _count;} 469}; 470 471class STQFMemAddressNotAligned : public SparcFault 472{ 473 private: 474 static FaultName _name; 475 static TrapType _trapType; 476 static FaultPriority _priority; 477 static FaultStat _count; 478 public: 479 FaultName name() {return _name;} 480 TrapType trapType() {return _trapType;} 481 FaultPriority priority() {return _priority;} 482 FaultStat & countStat() {return _count;} 483}; 484 485class AsyncDataError : public SparcFault 486{ 487 private: 488 static FaultName _name; 489 static TrapType _trapType; 490 static FaultPriority _priority; 491 static FaultStat _count; 492 public: 493 FaultName name() {return _name;} 494 TrapType trapType() {return _trapType;} 495 FaultPriority priority() {return _priority;} 496 FaultStat & countStat() {return _count;} 497}; 498 499class CleanWindow : public SparcFault 500{ 501 private: 502 static FaultName _name; 503 static TrapType _trapType; 504 static FaultPriority _priority; 505 static FaultStat _count; 506 public: 507 FaultName name() {return _name;} 508 TrapType trapType() {return _trapType;} 509 FaultPriority priority() {return _priority;} 510 FaultStat & countStat() {return _count;} 511}; 512 513class EnumeratedFault : public SparcFault 514{ 515 protected: 516 uint32_t _n; 517 virtual TrapType baseTrapType() = 0; 518 public: 519 EnumeratedFault(uint32_t n) : SparcFault() {_n = n;} 520 TrapType trapType() {return baseTrapType() + _n;} 521}; 522 523class InterruptLevelN : public EnumeratedFault 524{ 525 private: 526 static FaultName _name; 527 static TrapType _baseTrapType; 528 static FaultStat _count; 529 TrapType baseTrapType() {return _baseTrapType;} 530 public: 531 InterruptLevelN(uint32_t n) : EnumeratedFault(n) {;} 532 FaultName name() {return _name;} 533 FaultPriority priority() {return 32 - _n;} 534 FaultStat & countStat() {return _count;} 535}; 536 537class SpillNNormal : public EnumeratedFault 538{ 539 private: 540 static FaultName _name; 541 static TrapType _baseTrapType; 542 static FaultPriority _priority; 543 static FaultStat _count; 544 TrapType baseTrapType() {return _baseTrapType;} 545 public: 546 SpillNNormal(uint32_t n) : EnumeratedFault(n) {;} 547 FaultName name() {return _name;} 548 FaultPriority priority() {return _priority;} 549 FaultStat & countStat() {return _count;} 550}; 551 552class SpillNOther : public EnumeratedFault 553{ 554 private: 555 static FaultName _name; 556 static TrapType _baseTrapType; 557 static FaultPriority _priority; 558 static FaultStat _count; 559 TrapType baseTrapType() {return _baseTrapType;} 560 public: 561 SpillNOther(uint32_t n) : EnumeratedFault(n) {;} 562 FaultName name() {return _name;} 563 FaultPriority priority() {return _priority;} 564 FaultStat & countStat() {return _count;} 565}; 566 567class FillNNormal : public EnumeratedFault 568{ 569 private: 570 static FaultName _name; 571 static TrapType _baseTrapType; 572 static FaultPriority _priority; 573 static FaultStat _count; 574 TrapType baseTrapType() {return _baseTrapType;} 575 public: 576 FillNNormal(uint32_t n) : EnumeratedFault(n) {;} 577 FaultName name() {return _name;} 578 FaultPriority priority() {return _priority;} 579 FaultStat & countStat() {return _count;} 580}; 581 582class FillNOther : public EnumeratedFault 583{ 584 private: 585 static FaultName _name; 586 static TrapType _baseTrapType; 587 static FaultPriority _priority; 588 static FaultStat _count; 589 TrapType baseTrapType() {return _baseTrapType;} 590 public: 591 FillNOther(uint32_t n) : EnumeratedFault(n) {;} 592 FaultName name() {return _name;} 593 FaultPriority priority() {return _priority;} 594 FaultStat & countStat() {return _count;} 595}; 596 597class TrapInstruction : public EnumeratedFault 598{ 599 private: 600 static FaultName _name; 601 static TrapType _baseTrapType; 602 static FaultPriority _priority; 603 static FaultStat _count; 604 uint64_t syscall_num; 605 TrapType baseTrapType() {return _baseTrapType;} 606 public: 607 TrapInstruction(uint32_t n, uint64_t syscall) : 608 EnumeratedFault(n), syscall_num(syscall) {;} 609 FaultName name() {return _name;} 610 FaultPriority priority() {return _priority;} 611 FaultStat & countStat() {return _count;} 612#if !FULL_SYSTEM 613 void invoke(ThreadContext * tc); 614#endif 615}; 616
|