def execute(self, processor): if processor.condition_passed(): if self.option == 0b0010: domain = MBReqDomain.OUTER_SHAREABLE types = MBReqTypes.WRITES elif self.option == 0b0011: domain = MBReqDomain.OUTER_SHAREABLE types = MBReqTypes.ALL elif self.option == 0b0110: domain = MBReqDomain.NONSHAREABLE types = MBReqTypes.WRITES elif self.option == 0b0111: domain = MBReqDomain.NONSHAREABLE types = MBReqTypes.ALL elif self.option == 0b1010: domain = MBReqDomain.INNER_SHAREABLE types = MBReqTypes.WRITES elif self.option == 0b1011: domain = MBReqDomain.INNER_SHAREABLE types = MBReqTypes.ALL elif self.option == 0b1110: domain = MBReqDomain.FULL_SYSTEM types = MBReqTypes.WRITES else: domain = MBReqDomain.FULL_SYSTEM types = MBReqTypes.ALL if (have_virt_ext() and not processor.registers.is_secure() and not processor.registers.current_mode_is_hyp()): if processor.registers.hcr.bsu == 0b11: domain = MBReqDomain.FULL_SYSTEM if processor.registers.hcr.bsu == 0b10 and domain != MBReqDomain.FULL_SYSTEM: domain = MBReqDomain.OUTER_SHAREABLE if processor.registers.hcr.bsu == 0b01 and domain == MBReqDomain.NONSHAREABLE: domain = MBReqDomain.INNER_SHAREABLE processor.data_synchronization_barrier(domain, types)
def execute(self, processor): if processor.condition_passed(): if (have_virt_ext() and not processor.registers.is_secure() and not processor.registers.current_mode_is_hyp() and processor.registers.hcr.twi): hsr_string = 0b0000000000000000000000000 processor.write_hsr(0b000001, hsr_string) processor.registers.take_hyp_trap_exception() else: processor.wait_for_interrupt()
def execute(self, processor): if processor.condition_passed(): if (have_virt_ext() and not processor.registers.is_secure() and not processor.registers.current_mode_is_hyp() and processor.registers.hstr.tjdbx): hsr_string = self.m processor.write_hsr(0b001010, hsr_string) processor.registers.take_hyp_trap_exception() elif (not processor.registers.jmcr.je or processor.registers.current_instr_set() == InstrSet.THUMB_EE): processor.bx_write_pc(processor.registers.get(self.m)) else: if jazelle_accepts_execution(): processor.switch_to_jazelle_execution() else: # SUBARCHITECTURE_DEFINED handler call raise NotImplementedError()
def execute(self, processor): if processor.condition_passed(): if (have_virt_ext() and not processor.registers.is_secure() and not processor.registers.current_mode_is_hyp() and processor.registers.hstr.get_tjdbx()): hsr_string = zeros(25) hsr_string[-4:] = self.m processor.write_hsr(BitArray(bin="001010"), hsr_string) processor.registers.take_hyp_trap_exception() elif (not processor.registers.jmcr.get_je() or processor.registers.current_instr_set() == InstrSet.InstrSet_ThumbEE): processor.bx_write_pc(processor.registers.get(self.m)) else: if jazelle_accepts_execution(): processor.switch_to_jazelle_execution() else: # SUBARCHITECTURE_DEFINED handler call raise NotImplementedError()
def execute(self, processor): if processor.condition_passed(): if have_security_ext( ) and processor.registers.current_mode_is_not_user(): if (have_virt_ext() and not processor.registers.is_secure() and not processor.registers.current_mode_is_hyp() and processor.registers.hcr.tsc): hsr_string = 0b0000000000000000000000000 processor.write_hsr(0b010011, hsr_string) processor.registers.take_hyp_trap_exception() else: if processor.registers.scr.scd: if processor.registers.is_secure(): print('unpredictable') else: raise UndefinedInstructionException() else: raise SMCException() else: raise UndefinedInstructionException()
def execute(self, processor): if processor.condition_passed(): if self.option == "0b0010": domain = MBReqDomain.MBReqDomain_OuterShareable types = MBReqTypes.MBReqTypes_Writes elif self.option == "0b0011": domain = MBReqDomain.MBReqDomain_OuterShareable types = MBReqTypes.MBReqTypes_All elif self.option == "0b0110": domain = MBReqDomain.MBReqDomain_Nonshareable types = MBReqTypes.MBReqTypes_Writes elif self.option == "0b0111": domain = MBReqDomain.MBReqDomain_Nonshareable types = MBReqTypes.MBReqTypes_All elif self.option == "0b1010": domain = MBReqDomain.MBReqDomain_InnerShareable types = MBReqTypes.MBReqTypes_Writes elif self.option == "0b1011": domain = MBReqDomain.MBReqDomain_InnerShareable types = MBReqTypes.MBReqTypes_All elif self.option == "0b1110": domain = MBReqDomain.MBReqDomain_FullSystem types = MBReqTypes.MBReqTypes_Writes else: domain = MBReqDomain.MBReqDomain_FullSystem types = MBReqTypes.MBReqTypes_All if (have_virt_ext() and not processor.registers.is_secure() and not processor.registers.current_mode_is_hyp()): if processor.registers.hcr.get_bsu() == "0b11": domain = MBReqDomain.MBReqDomain_FullSystem if processor.registers.hcr.get_bsu() == "0b10" and domain != MBReqDomain.MBReqDomain_FullSystem: domain = MBReqDomain.MBReqDomain_OuterShareable if processor.registers.hcr.get_bsu() == "0b01" and domain == MBReqDomain.MBReqDomain_Nonshareable: domain = MBReqDomain.MBReqDomain_InnerShareable processor.data_synchronization_barrier(domain, types)