provide global syscall symbols if flag is set
This commit is contained in:
parent
11568ec9b0
commit
a1b9cf7f22
@ -27,6 +27,10 @@ class CPU:
|
||||
self.regs = Registers(conf)
|
||||
self.syscall_int = SyscallInterface()
|
||||
|
||||
# provide global syscall symbols if option is set
|
||||
if conf.include_scall_symbols:
|
||||
self.mmu.global_symbols.update(self.syscall_int.get_syscall_symbols())
|
||||
|
||||
def load(self, e: 'Executable'):
|
||||
return self.mmu.load_bin(e)
|
||||
|
||||
|
@ -165,3 +165,8 @@ class SyscallInterface:
|
||||
def exit(self, scall: Syscall):
|
||||
scall.cpu.exit = True
|
||||
scall.cpu.exit_code = scall.registers.get('a0')
|
||||
|
||||
def get_syscall_symbols(self):
|
||||
symbols = dict()
|
||||
for num, name in SYSCALLS.items():
|
||||
symbols['SCALL_' + name.upper()] = num
|
Loading…
Reference in New Issue
Block a user