Skip to content

Commit 19646ae

Browse files
committed
Split the arch and interrupt handling
1 parent 978af70 commit 19646ae

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

qiling/arch/arm_const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class CONTROL(IntEnum):
6868
PRIV = 0b001
6969

7070
class EXC_RETURN(IntEnum):
71+
MASK = 0xfffffff0
7172
RETURN_SP = 0b0100
7273
RETURN_MODE = 0b1000
7374

qiling/core.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,12 @@ def emu_stop(self):
859859
def stop(self):
860860
if self.multithread:
861861
self.os.thread_management.stop()
862+
863+
elif self.archtype in QL_ARCH_HARDWARE:
864+
self.arch.stop()
865+
862866
else:
863-
self.uc.emu_stop()
867+
self.uc.emu_stop()
864868

865869
# start emulation
866870
def emu_start(self, begin, end, timeout=0, count=0):

qiling/hw/intc/cm4_nvic.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ def step(self):
111111
while self.intrs:
112112
IRQn = self.intrs.pop(0)
113113
self.clear_pending(IRQn)
114-
self.ql.arch.enter_intr()
115-
self.ql.arch.handle_interupt(IRQn)
116-
self.ql.arch.exit_intr()
114+
self.ql.arch.handle_interupt(IRQn)
117115

118116
def read(self, offset: int, size: int) -> int:
119117
buf = ctypes.create_string_buffer(size)

0 commit comments

Comments
 (0)