Deleted Added
sdiff udiff text old ( 8304:16911ff780d3 ) new ( 8518:9c87727099ce )
full compact
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

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

497 yieldIop = InstObjParams("yield", "YieldInst", "PredOp", \
498 { "code" : "", "predicate_test" : predicateTest })
499 header_output += BasicDeclare.subst(yieldIop)
500 decoder_output += BasicConstructor.subst(yieldIop)
501 exec_output += PredOpExecute.subst(yieldIop)
502
503 wfeCode = '''
504#if FULL_SYSTEM
505 // WFE Sleeps if SevMailbox==0 and no unmasked interrupts are pending
506 if (SevMailbox == 1) {
507 SevMailbox = 0;
508 PseudoInst::quiesceSkip(xc->tcBase());
509 } else if (xc->tcBase()->getCpuPtr()->getInterruptController()->checkInterrupts(xc->tcBase())) {
510 PseudoInst::quiesceSkip(xc->tcBase());
511 } else {
512 PseudoInst::quiesce(xc->tcBase());
513 }
514#endif
515 '''
516 wfePredFixUpCode = '''
517#if FULL_SYSTEM
518 // WFE is predicated false, reset SevMailbox to reduce spurious sleeps
519 // and SEV interrupts
520 SevMailbox = 1;
521#endif
522 '''
523 wfeIop = InstObjParams("wfe", "WfeInst", "PredOp", \
524 { "code" : wfeCode,
525 "pred_fixup" : wfePredFixUpCode,
526 "predicate_test" : predicateTest },
527 ["IsNonSpeculative", "IsQuiesce", "IsSerializeAfter"])
528 header_output += BasicDeclare.subst(wfeIop)
529 decoder_output += BasicConstructor.subst(wfeIop)
530 exec_output += QuiescePredOpExecuteWithFixup.subst(wfeIop)
531
532 wfiCode = '''
533#if FULL_SYSTEM
534 // WFI doesn't sleep if interrupts are pending (masked or not)
535 if (xc->tcBase()->getCpuPtr()->getInterruptController()->checkRaw()) {
536 PseudoInst::quiesceSkip(xc->tcBase());
537 } else {
538 PseudoInst::quiesce(xc->tcBase());
539 }
540#endif
541 '''
542 wfiIop = InstObjParams("wfi", "WfiInst", "PredOp", \
543 { "code" : wfiCode, "predicate_test" : predicateTest },
544 ["IsNonSpeculative", "IsQuiesce", "IsSerializeAfter"])
545 header_output += BasicDeclare.subst(wfiIop)
546 decoder_output += BasicConstructor.subst(wfiIop)
547 exec_output += QuiescePredOpExecute.subst(wfiIop)
548
549 sevCode = '''
550#if FULL_SYSTEM
551 SevMailbox = 1;
552 System *sys = xc->tcBase()->getSystemPtr();
553 for (int x = 0; x < sys->numContexts(); x++) {
554 ThreadContext *oc = sys->getThreadContext(x);
555 if (oc == xc->tcBase())
556 continue;
557 // Wake CPU with interrupt if they were sleeping
558 if (oc->readMiscReg(MISCREG_SEV_MAILBOX) == 0) {
559 // Post Interrupt and wake cpu if needed
560 oc->getCpuPtr()->postInterrupt(INT_SEV, 0);
561 }
562 }
563#endif
564 '''
565 sevIop = InstObjParams("sev", "SevInst", "PredOp", \
566 { "code" : sevCode, "predicate_test" : predicateTest },
567 ["IsNonSpeculative", "IsSquashAfter"])
568 header_output += BasicDeclare.subst(sevIop)
569 decoder_output += BasicConstructor.subst(sevIop)
570 exec_output += PredOpExecute.subst(sevIop)
571

--- 234 unchanged lines hidden ---