diff --git a/user/usys.py b/user/usys.py index ad4e4c7..45dea8f 100755 --- a/user/usys.py +++ b/user/usys.py @@ -1,13 +1,18 @@ #!/usr/bin/env python3 -template = """.global {name} +template = """ +.global {name} {name}: li a7, SYS_{name} ecall - ret""" + ret +""".strip() def genstub(syscall: str): + if not 3 >= len(syscall) <= 15: + raise ValueError("Syscall {} is too short/long!".format(syscall[:35])) + return template.format(name=syscall)