Compare commits

...

2 commits

Author SHA1 Message Date
Imbus
0b46382a56 Formatting 2025-01-21 23:54:00 +01:00
Imbus
99b9c7533d Cleaner assembly formatting string, syscall length checking 2025-01-21 23:53:56 +01:00

View file

@ -1,13 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
template = """.global {name} template = """
.global {name}
{name}: {name}:
li a7, SYS_{name} li a7, SYS_{name}
ecall ecall
ret""" ret
""".strip()
def genstub(syscall: str): 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) return template.format(name=syscall)
@ -55,7 +60,9 @@ with open("kernel/syscall.h", "r") as sfile:
missing_in_header_calls = calls - header_calls missing_in_header_calls = calls - header_calls
if missing_in_calls: if missing_in_calls:
print("#These items are in header_calls but not in calls:", missing_in_calls) print(
"#These items are in header_calls but not in calls:", missing_in_calls
)
if missing_in_header_calls: if missing_in_header_calls:
print( print(
"#These items are in calls but not in header_calls:", "#These items are in calls but not in header_calls:",