Skip to content

Commit

Permalink
add usys.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
ejunjsh committed Jun 23, 2021
1 parent 78e9488 commit 6c9cc9a
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions user/usys.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/perl -w

# Generate usys.S, the stubs for syscalls.

print "# generated by usys.pl - do not edit\n";

print "#include \"kernel/syscall.h\"\n";

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");

0 comments on commit 6c9cc9a

Please sign in to comment.