MCPcopy Create free account
hub / github.com/qilingframework/qiling / interrupt_handler

Method interrupt_handler

qiling/arch/cortex_m.py:146–172  ·  view source on GitHub ↗
(self, ql: Qiling, intno: int)

Source from the content-addressed store, hash-verified

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)

Callers 1

stepMethod · 0.80

Calls 6

using_pspMethod · 0.95
QlInterruptContextClass · 0.85
read_ptrMethod · 0.80
get_priorityMethod · 0.45
writeMethod · 0.45
emu_startMethod · 0.45

Tested by

no test coverage detected