2019-05-31 15:45:42 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
# Generate usys.S, the stubs for syscalls.
|
|
|
|
|
|
|
|
print "# generated by usys.pl - do not edit\n";
|
|
|
|
|
2019-06-11 13:57:14 +00:00
|
|
|
print "#include \"kernel/syscall.h\"\n";
|
2019-05-31 15:45:42 +00:00
|
|
|
|
|
|
|
sub entry {
|
|
|
|
my $name = shift;
|
|
|
|
print ".global $name\n";
|
|
|
|
print "${name}:\n";
|
|
|
|
print " li a7, SYS_${name}\n";
|
|
|
|
print " ecall\n";
|
|
|
|
print " ret\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
entry("fork");
|
|
|
|
entry("exit");
|
|
|
|
entry("wait");
|
|
|
|
entry("pipe");
|
|
|
|
entry("read");
|
|
|
|
entry("write");
|
|
|
|
entry("close");
|
|
|
|
entry("kill");
|
|
|
|
entry("exec");
|
|
|
|
entry("open");
|
|
|
|
entry("mknod");
|
|
|
|
entry("unlink");
|
|
|
|
entry("fstat");
|
|
|
|
entry("link");
|
|
|
|
entry("mkdir");
|
|
|
|
entry("chdir");
|
|
|
|
entry("dup");
|
|
|
|
entry("getpid");
|
|
|
|
entry("sbrk");
|
|
|
|
entry("sleep");
|
|
|
|
entry("uptime");
|