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; --- 326 unchanged lines hidden (view full) --- 335 tc->setMiscReg(MISCREG_HTSTATE, HPSTATE); 336 337 //TT = trap type; 338 tc->setMiscReg(MISCREG_TT, tt); 339 340 //Update GL 341 tc->setMiscRegWithEffect(MISCREG_GL, min<int>(GL+1, MaxGL)); 342 |
343 PSTATE = mbits(PSTATE, 2, 2); // just save the priv bit 344 PSTATE |= (1 << 4); //set PSTATE.pef to 1 |
345 tc->setMiscReg(MISCREG_PSTATE, PSTATE); 346 347 //set HPSTATE.red to 1 348 HPSTATE |= (1 << 5); 349 //set HPSTATE.hpriv to 1 350 HPSTATE |= (1 << 2); 351 //set HPSTATE.ibe to 0 352 HPSTATE &= ~(1 << 10); --- 70 unchanged lines hidden (view full) --- 423 424 //Update the global register level 425 if (!gotoHpriv) 426 tc->setMiscRegWithEffect(MISCREG_GL, min<int>(GL+1, MaxPGL)); 427 else 428 tc->setMiscRegWithEffect(MISCREG_GL, min<int>(GL+1, MaxGL)); 429 430 //PSTATE.mm is unchanged |
431 PSTATE |= (1 << 4); //PSTATE.pef = whether or not an fpu is present 432 PSTATE &= ~(1 << 3); //PSTATE.am = 0 433 PSTATE &= ~(1 << 1); //PSTATE.ie = 0 |
434 //PSTATE.tle is unchanged 435 //PSTATE.tct = 0 |
436 437 if (gotoHpriv) 438 { |
439 PSTATE &= ~(1 << 9); // PSTATE.cle = 0 440 //The manual says PSTATE.priv should be 0, but Legion leaves it alone 441 HPSTATE &= ~(1 << 5); //HPSTATE.red = 0 442 HPSTATE |= (1 << 2); //HPSTATE.hpriv = 1 443 HPSTATE &= ~(1 << 10); //HPSTATE.ibe = 0 |
444 //HPSTATE.tlz is unchanged 445 tc->setMiscReg(MISCREG_HPSTATE, HPSTATE); |
446 } else { // we are going to priv 447 PSTATE |= (1 << 2); //PSTATE.priv = 1 448 replaceBits(PSTATE, 9, 9, PSTATE >> 8); //PSTATE.cle = PSTATE.tle |
449 } |
450 tc->setMiscReg(MISCREG_PSTATE, PSTATE); |
451 |
452 |
453 bool changedCWP = true; 454 if (tt == 0x24) 455 CWP++; 456 else if (0x80 <= tt && tt <= 0xbf) 457 CWP += (CANSAVE + 2); 458 else if (0xc0 <= tt && tt <= 0xff) 459 CWP--; 460 else --- 208 unchanged lines hidden --- |