1// -*- mode:c++ -*- 2 3// Copyright (c) 2010-2013,2017 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 --- 656 unchanged lines hidden (view full) --- 665 666 yieldIop = InstObjParams("yield", "YieldInst", "PredOp", \ 667 { "code" : "", "predicate_test" : predicateTest }) 668 header_output += BasicDeclare.subst(yieldIop) 669 decoder_output += BasicConstructor.subst(yieldIop) 670 exec_output += PredOpExecute.subst(yieldIop) 671 672 wfeCode = ''' |
673 CPSR cpsr = Cpsr; 674 SCR scr = Scr64; |
675 676 // WFE Sleeps if SevMailbox==0 and no unmasked interrupts are pending, 677 ThreadContext *tc = xc->tcBase(); 678 if (SevMailbox == 1) { 679 SevMailbox = 0; 680 PseudoInst::quiesceSkip(tc); 681 } else if (tc->getCpuPtr()->getInterruptController( 682 tc->threadId())->checkInterrupts(tc)) { 683 PseudoInst::quiesceSkip(tc); |
684 } else { |
685 fault = trapWFx(tc, cpsr, scr, true); 686 if (fault == NoFault) { 687 PseudoInst::quiesce(tc); 688 } else { 689 PseudoInst::quiesceSkip(tc); 690 } |
691 } 692 ''' 693 wfePredFixUpCode = ''' 694 // WFE is predicated false, reset SevMailbox to reduce spurious sleeps 695 // and SEV interrupts 696 SevMailbox = 1; 697 ''' 698 wfeIop = InstObjParams("wfe", "WfeInst", "PredOp", \ --- 5 unchanged lines hidden (view full) --- 704 header_output += BasicDeclare.subst(wfeIop) 705 decoder_output += BasicConstructor.subst(wfeIop) 706 exec_output += QuiescePredOpExecuteWithFixup.subst(wfeIop) 707 708 wfiCode = ''' 709 HCR hcr = Hcr; 710 CPSR cpsr = Cpsr; 711 SCR scr = Scr64; |
712 713 // WFI doesn't sleep if interrupts are pending (masked or not) 714 ThreadContext *tc = xc->tcBase(); 715 if (tc->getCpuPtr()->getInterruptController( 716 tc->threadId())->checkWfiWake(hcr, cpsr, scr)) { 717 PseudoInst::quiesceSkip(tc); |
718 } else { |
719 fault = trapWFx(tc, cpsr, scr, false); 720 if (fault == NoFault) { 721 PseudoInst::quiesce(tc); 722 } else { 723 PseudoInst::quiesceSkip(tc); 724 } |
725 } 726 tc->getCpuPtr()->clearInterrupt(tc->threadId(), INT_ABT, 0); 727 ''' 728 wfiIop = InstObjParams("wfi", "WfiInst", "PredOp", \ 729 { "code" : wfiCode, "predicate_test" : predicateTest }, 730 ["IsNonSpeculative", "IsQuiesce", 731 "IsSerializeAfter", "IsUnverifiable"]) 732 header_output += BasicDeclare.subst(wfiIop) --- 503 unchanged lines hidden --- |