provide global syscall symbols if flag is set

float_support
Anton Lydike 4 years ago
parent 11568ec9b0
commit a1b9cf7f22

@ -27,6 +27,10 @@ class CPU:
self.regs = Registers(conf) self.regs = Registers(conf)
self.syscall_int = SyscallInterface() 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'): def load(self, e: 'Executable'):
return self.mmu.load_bin(e) return self.mmu.load_bin(e)

@ -165,3 +165,8 @@ class SyscallInterface:
def exit(self, scall: Syscall): def exit(self, scall: Syscall):
scall.cpu.exit = True scall.cpu.exit = True
scall.cpu.exit_code = scall.registers.get('a0') 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…
Cancel
Save