(self, ql: Qiling, intno: int)
| 144 | raise QlErrorNotImplemented(f'Unhandled interrupt number ({intno})') |
| 145 | |
| 146 | def interrupt_handler(self, ql: Qiling, intno: int): |
| 147 | basepri = self.regs.basepri & 0xf0 |
| 148 | |
| 149 | if basepri and basepri <= ql.hw.nvic.get_priority(intno): |
| 150 | return |
| 151 | |
| 152 | if intno > IRQ.HARD_FAULT and (self.regs.primask & 0x1): |
| 153 | return |
| 154 | |
| 155 | if intno != IRQ.NMI and (self.regs.faultmask & 0x1): |
| 156 | return |
| 157 | |
| 158 | if ql.verbose >= QL_VERBOSE.DISASM: |
| 159 | ql.log.debug(f'Handle the intno: {intno}') |
| 160 | |
| 161 | with QlInterruptContext(ql): |
| 162 | isr = intno + 16 |
| 163 | offset = isr * 4 |
| 164 | |
| 165 | entry = ql.mem.read_ptr(offset) |
| 166 | exc_return = 0xFFFFFFFD if self.using_psp() else 0xFFFFFFF9 |
| 167 | |
| 168 | self.regs.write('ipsr', isr) |
| 169 | self.regs.write('pc', entry) |
| 170 | self.regs.write('lr', exc_return) |
| 171 | |
| 172 | self.uc.emu_start(self.effective_pc, 0, 0, 0xffffff) |
no test coverage detected