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; --- 479 unchanged lines hidden (view full) --- 488 { 489 CWP = (CWP + NWindows) % NWindows; 490 tc->setMiscRegWithEffect(MISCREG_CWP, CWP); 491 } 492} 493 494void getREDVector(Addr & PC, Addr & NPC) 495{ |
496 //XXX The following constant might belong in a header file. |
497 const Addr RSTVAddr = 0xFFFFFFFFF0000000ULL; 498 PC = RSTVAddr | 0xA0; 499 NPC = PC + sizeof(MachInst); 500} 501 |
502void getHyperVector(ThreadContext * tc, Addr & PC, Addr & NPC, MiscReg TT) |
503{ |
504 Addr HTBA = tc->readMiscReg(MISCREG_HTBA); |
505 PC = (HTBA & ~mask(14)) | ((TT << 5) & mask(14)); 506 NPC = PC + sizeof(MachInst); 507} 508 |
509void getPrivVector(ThreadContext * tc, Addr & PC, Addr & NPC, MiscReg TT, MiscReg TL) |
510{ |
511 Addr TBA = tc->readMiscReg(MISCREG_TBA); |
512 PC = (TBA & ~mask(15)) | 513 (TL > 1 ? (1 << 14) : 0) | 514 ((TT << 5) & mask(14)); 515 NPC = PC + sizeof(MachInst); 516} 517 518#if FULL_SYSTEM 519 --- 32 unchanged lines hidden (view full) --- 552 //Do error_state somehow? 553 //Probably inject a WDR fault using the interrupt mechanism. 554 //What should the PC and NPC be set to? 555 } 556 else if(TL > MaxPTL && level == Privileged) 557 { 558 //guest_watchdog fault 559 doNormalFault(tc, trapType(), true); |
560 getHyperVector(tc, PC, NPC, 2); |
561 } 562 else if(level == Hyperprivileged) 563 { 564 doNormalFault(tc, trapType(), true); |
565 getHyperVector(tc, PC, NPC, trapType()); |
566 } 567 else 568 { 569 doNormalFault(tc, trapType(), false); |
570 getPrivVector(tc, PC, NPC, trapType(), TL+1); |
571 } 572 573 tc->setPC(PC); 574 tc->setNextPC(NPC); 575 tc->setNextNPC(NPC + sizeof(MachInst)); 576} 577 578void PowerOnReset::invoke(ThreadContext * tc) --- 95 unchanged lines hidden --- |