Compare commits
2 commits
fbef2ef765
...
0b46382a56
Author | SHA1 | Date | |
---|---|---|---|
|
0b46382a56 | ||
|
99b9c7533d |
1 changed files with 10 additions and 3 deletions
13
user/usys.py
13
user/usys.py
|
@ -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:",
|
||||||
|
|
Loading…
Reference in a new issue