提交 66991942 创建 作者: Austin Clements's avatar Austin Clements

Mark all syscall functions with a special comment

上级 1c260e53
...@@ -52,6 +52,7 @@ pread_allocwork(struct inode *ip, size_t count, off_t off, ...@@ -52,6 +52,7 @@ pread_allocwork(struct inode *ip, size_t count, off_t off,
return w; return w;
} }
//SYSCALL
int int
sys_async(int fd, size_t count, off_t off, sys_async(int fd, size_t count, off_t off,
int msgid, int pageid) int msgid, int pageid)
......
...@@ -28,6 +28,7 @@ script_mmap_work(void *a0, void *a1, void *a2, void *a3) ...@@ -28,6 +28,7 @@ script_mmap_work(void *a0, void *a1, void *a2, void *a3)
*donep += 1; *donep += 1;
} }
//SYSCALL
int int
sys_script(void *addr, u64 len, u64 chunk) sys_script(void *addr, u64 len, u64 chunk)
{ {
......
...@@ -28,6 +28,7 @@ fdalloc(file *f) ...@@ -28,6 +28,7 @@ fdalloc(file *f)
return myproc()->ftable->allocfd(f); return myproc()->ftable->allocfd(f);
} }
//SYSCALL
int int
sys_dup(int ofd) sys_dup(int ofd)
{ {
...@@ -44,6 +45,7 @@ sys_dup(int ofd) ...@@ -44,6 +45,7 @@ sys_dup(int ofd)
return fd; return fd;
} }
//SYSCALL
ssize_t ssize_t
sys_read(int fd, void *p, size_t n) sys_read(int fd, void *p, size_t n)
{ {
...@@ -54,6 +56,7 @@ sys_read(int fd, void *p, size_t n) ...@@ -54,6 +56,7 @@ sys_read(int fd, void *p, size_t n)
return f->read(static_cast<char*>(p), n); return f->read(static_cast<char*>(p), n);
} }
//SYSCALL
ssize_t ssize_t
sys_pread(int fd, void *ubuf, size_t count, off_t offset) sys_pread(int fd, void *ubuf, size_t count, off_t offset)
{ {
...@@ -70,6 +73,7 @@ sys_pread(int fd, void *ubuf, size_t count, off_t offset) ...@@ -70,6 +73,7 @@ sys_pread(int fd, void *ubuf, size_t count, off_t offset)
return f->pread((char*)ubuf, count, offset); return f->pread((char*)ubuf, count, offset);
} }
//SYSCALL
ssize_t ssize_t
sys_write(int fd, const void *p, size_t n) sys_write(int fd, const void *p, size_t n)
{ {
...@@ -80,6 +84,7 @@ sys_write(int fd, const void *p, size_t n) ...@@ -80,6 +84,7 @@ sys_write(int fd, const void *p, size_t n)
return f->write(static_cast<const char*>(p), n); return f->write(static_cast<const char*>(p), n);
} }
//SYSCALL
int int
sys_close(int fd) sys_close(int fd)
{ {
...@@ -91,6 +96,7 @@ sys_close(int fd) ...@@ -91,6 +96,7 @@ sys_close(int fd)
return 0; return 0;
} }
//SYSCALL
int int
sys_fstat(int fd, struct stat *st) sys_fstat(int fd, struct stat *st)
{ {
...@@ -102,6 +108,7 @@ sys_fstat(int fd, struct stat *st) ...@@ -102,6 +108,7 @@ sys_fstat(int fd, struct stat *st)
} }
// Create the path new as a link to the same inode as old. // Create the path new as a link to the same inode as old.
//SYSCALL
int int
sys_link(const char *old, const char *newn) sys_link(const char *old, const char *newn)
{ {
...@@ -155,6 +162,7 @@ isdirempty(struct inode *dp) ...@@ -155,6 +162,7 @@ isdirempty(struct inode *dp)
return empty; return empty;
} }
//SYSCALL
int int
sys_unlink(const char *path) sys_unlink(const char *path)
{ {
...@@ -266,6 +274,7 @@ create(inode *cwd, const char *path, short type, short major, short minor) ...@@ -266,6 +274,7 @@ create(inode *cwd, const char *path, short type, short major, short minor)
return ip; return ip;
} }
//SYSCALL
int int
sys_openat(int dirfd, const char *path, int omode) sys_openat(int dirfd, const char *path, int omode)
{ {
...@@ -363,6 +372,7 @@ sys_openat(int dirfd, const char *path, int omode) ...@@ -363,6 +372,7 @@ sys_openat(int dirfd, const char *path, int omode)
return fd; return fd;
} }
//SYSCALL
int int
sys_mkdirat(int dirfd, const char *path) sys_mkdirat(int dirfd, const char *path)
{ {
...@@ -388,6 +398,7 @@ sys_mkdirat(int dirfd, const char *path) ...@@ -388,6 +398,7 @@ sys_mkdirat(int dirfd, const char *path)
return 0; return 0;
} }
//SYSCALL
int int
sys_mknod(const char *path, int major, int minor) sys_mknod(const char *path, int major, int minor)
{ {
...@@ -401,6 +412,7 @@ sys_mknod(const char *path, int major, int minor) ...@@ -401,6 +412,7 @@ sys_mknod(const char *path, int major, int minor)
return 0; return 0;
} }
//SYSCALL
int int
sys_chdir(const char *path) sys_chdir(const char *path)
{ {
...@@ -419,6 +431,7 @@ sys_chdir(const char *path) ...@@ -419,6 +431,7 @@ sys_chdir(const char *path)
return 0; return 0;
} }
//SYSCALL
int int
sys_exec(const char *upath, userptr<userptr<const char> > uargv) sys_exec(const char *upath, userptr<userptr<const char> > uargv)
{ {
...@@ -456,6 +469,7 @@ clean: ...@@ -456,6 +469,7 @@ clean:
return r; return r;
} }
//SYSCALL
int int
sys_pipe(int *fd) sys_pipe(int *fd)
{ {
...@@ -522,6 +536,7 @@ allocsocket(struct file **rf, int *rfd) ...@@ -522,6 +536,7 @@ allocsocket(struct file **rf, int *rfd)
return 0; return 0;
} }
//SYSCALL
int int
sys_socket(int domain, int type, int protocol) sys_socket(int domain, int type, int protocol)
{ {
...@@ -543,6 +558,7 @@ sys_socket(int domain, int type, int protocol) ...@@ -543,6 +558,7 @@ sys_socket(int domain, int type, int protocol)
return fd; return fd;
} }
//SYSCALL
int int
sys_bind(int xsock, const struct sockaddr *xaddr, int xaddrlen) sys_bind(int xsock, const struct sockaddr *xaddr, int xaddrlen)
{ {
...@@ -555,6 +571,7 @@ sys_bind(int xsock, const struct sockaddr *xaddr, int xaddrlen) ...@@ -555,6 +571,7 @@ sys_bind(int xsock, const struct sockaddr *xaddr, int xaddrlen)
return netbind(f->socket, xaddr, xaddrlen); return netbind(f->socket, xaddr, xaddrlen);
} }
//SYSCALL
int int
sys_listen(int xsock, int backlog) sys_listen(int xsock, int backlog)
{ {
...@@ -567,6 +584,7 @@ sys_listen(int xsock, int backlog) ...@@ -567,6 +584,7 @@ sys_listen(int xsock, int backlog)
return netlisten(f->socket, backlog); return netlisten(f->socket, backlog);
} }
//SYSCALL
int int
sys_accept(int xsock, struct sockaddr *xaddr, int *xaddrlen) sys_accept(int xsock, struct sockaddr *xaddr, int *xaddrlen)
{ {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "kmtrace.hh" #include "kmtrace.hh"
#include "futex.h" #include "futex.h"
//SYSCALL
int int
sys_fork(int flags) sys_fork(int flags)
{ {
...@@ -19,6 +20,7 @@ sys_fork(int flags) ...@@ -19,6 +20,7 @@ sys_fork(int flags)
return fork(flags); return fork(flags);
} }
//SYSCALL
int int
sys_exit(void) sys_exit(void)
{ {
...@@ -26,6 +28,7 @@ sys_exit(void) ...@@ -26,6 +28,7 @@ sys_exit(void)
panic("exit() returned"); panic("exit() returned");
} }
//SYSCALL
int int
sys_wait(void) sys_wait(void)
{ {
...@@ -33,18 +36,21 @@ sys_wait(void) ...@@ -33,18 +36,21 @@ sys_wait(void)
return wait(); return wait();
} }
//SYSCALL
int int
sys_kill(int pid) sys_kill(int pid)
{ {
return proc::kill(pid); return proc::kill(pid);
} }
//SYSCALL
int int
sys_getpid(void) sys_getpid(void)
{ {
return myproc()->pid; return myproc()->pid;
} }
//SYSCALL
char* char*
sys_sbrk(int n) sys_sbrk(int n)
{ {
...@@ -55,6 +61,7 @@ sys_sbrk(int n) ...@@ -55,6 +61,7 @@ sys_sbrk(int n)
return (char*)addr; return (char*)addr;
} }
//SYSCALL
int int
sys_nsleep(u64 nsec) sys_nsleep(u64 nsec)
{ {
...@@ -83,12 +90,14 @@ sys_nsleep(u64 nsec) ...@@ -83,12 +90,14 @@ sys_nsleep(u64 nsec)
// return how many clock tick interrupts have occurred // return how many clock tick interrupts have occurred
// since boot. // since boot.
//SYSCALL
u64 u64
sys_uptime(void) sys_uptime(void)
{ {
return nsectime(); return nsectime();
} }
//SYSCALL
int int
sys_map(userptr<void> addr, size_t len) sys_map(userptr<void> addr, size_t len)
{ {
...@@ -114,6 +123,7 @@ sys_map(userptr<void> addr, size_t len) ...@@ -114,6 +123,7 @@ sys_map(userptr<void> addr, size_t len)
return r; return r;
} }
//SYSCALL
int int
sys_unmap(userptr<void> addr, size_t len) sys_unmap(userptr<void> addr, size_t len)
{ {
...@@ -134,6 +144,7 @@ sys_unmap(userptr<void> addr, size_t len) ...@@ -134,6 +144,7 @@ sys_unmap(userptr<void> addr, size_t len)
return 0; return 0;
} }
//SYSCALL
int int
sys_halt(void) sys_halt(void)
{ {
...@@ -145,6 +156,7 @@ sys_halt(void) ...@@ -145,6 +156,7 @@ sys_halt(void)
return 0; return 0;
} }
//SYSCALL
int int
sys_setfs(u64 base) sys_setfs(u64 base)
{ {
...@@ -154,12 +166,14 @@ sys_setfs(u64 base) ...@@ -154,12 +166,14 @@ sys_setfs(u64 base)
return 0; return 0;
} }
//SYSCALL
int int
sys_setaffinity(int cpu) sys_setaffinity(int cpu)
{ {
return myproc()->set_cpu_pin(cpu); return myproc()->set_cpu_pin(cpu);
} }
//SYSCALL
long long
sys_futex(const u64* addr, int op, u64 val, u64 timer) sys_futex(const u64* addr, int op, u64 val, u64 timer)
{ {
......
...@@ -52,6 +52,7 @@ uwq_trywork(void) ...@@ -52,6 +52,7 @@ uwq_trywork(void)
return false; return false;
} }
//SYSCALL
int int
sys_wqwait(void) sys_wqwait(void)
{ {
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论