faults.cc (3825:9b5e6c4d3ecb) faults.cc (3826:e35adf01a285)
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;

--- 537 unchanged lines hidden (view full) ---

546 current = Hyperprivileged;
547 else if(PSTATE & (1 << 2))
548 current = Privileged;
549 else
550 current = User;
551
552 PrivilegeLevel level = getNextLevel(current);
553
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;

--- 537 unchanged lines hidden (view full) ---

546 current = Hyperprivileged;
547 else if(PSTATE & (1 << 2))
548 current = Privileged;
549 else
550 current = User;
551
552 PrivilegeLevel level = getNextLevel(current);
553
554 if(HPSTATE & (1 << 5) || TL == MaxTL - 1)
555 {
554 if(HPSTATE & (1 << 5) || TL == MaxTL - 1) {
556 getREDVector(5, PC, NPC);
557 doREDFault(tc, TT);
558 //This changes the hpstate and pstate, so we need to make sure we
559 //save the old version on the trap stack in doREDFault.
560 enterREDState(tc);
555 getREDVector(5, PC, NPC);
556 doREDFault(tc, TT);
557 //This changes the hpstate and pstate, so we need to make sure we
558 //save the old version on the trap stack in doREDFault.
559 enterREDState(tc);
561 }
562 else if(TL == MaxTL)
563 {
560 } else if(TL == MaxTL) {
564 panic("Should go to error state here.. crap\n");
565 //Do error_state somehow?
566 //Probably inject a WDR fault using the interrupt mechanism.
567 //What should the PC and NPC be set to?
561 panic("Should go to error state here.. crap\n");
562 //Do error_state somehow?
563 //Probably inject a WDR fault using the interrupt mechanism.
564 //What should the PC and NPC be set to?
568 }
569 else if(TL > MaxPTL && level == Privileged)
570 {
565 } else if(TL > MaxPTL && level == Privileged) {
571 //guest_watchdog fault
572 doNormalFault(tc, trapType(), true);
573 getHyperVector(tc, PC, NPC, 2);
566 //guest_watchdog fault
567 doNormalFault(tc, trapType(), true);
568 getHyperVector(tc, PC, NPC, 2);
574 }
575 else if(level == Hyperprivileged)
576 {
569 } else if(level == Hyperprivileged ||
570 level == Privileged && trapType() >= 384) {
577 doNormalFault(tc, trapType(), true);
578 getHyperVector(tc, PC, NPC, trapType());
571 doNormalFault(tc, trapType(), true);
572 getHyperVector(tc, PC, NPC, trapType());
579 }
580 else
581 {
573 } else {
582 doNormalFault(tc, trapType(), false);
583 getPrivVector(tc, PC, NPC, trapType(), TL+1);
584 }
585
586 tc->setPC(PC);
587 tc->setNextPC(NPC);
588 tc->setNextNPC(NPC + sizeof(MachInst));
589}

--- 120 unchanged lines hidden ---
574 doNormalFault(tc, trapType(), false);
575 getPrivVector(tc, PC, NPC, trapType(), TL+1);
576 }
577
578 tc->setPC(PC);
579 tc->setNextPC(NPC);
580 tc->setNextNPC(NPC + sizeof(MachInst));
581}

--- 120 unchanged lines hidden ---