summaryrefslogtreecommitdiff
path: root/src/user/usys.S
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-01-02 10:09:37 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-01-02 10:09:37 +0800
commit1c8e37f63d413a559825020289178d442537449e (patch)
tree9779a712b5eec91035272e7646eb6811979d7eab /src/user/usys.S
parentd8eaa13f2efc1eeca4e5f230d5a2d535aaf27338 (diff)
downloadlume-1c8e37f63d413a559825020289178d442537449e.tar.gz
lume-1c8e37f63d413a559825020289178d442537449e.tar.xz
dev(sell): add simple libc and implement shell
please see the log for detail.
Diffstat (limited to 'src/user/usys.S')
-rw-r--r--src/user/usys.S13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/user/usys.S b/src/user/usys.S
index 65937cc..f85917e 100644
--- a/src/user/usys.S
+++ b/src/user/usys.S
@@ -7,8 +7,16 @@
ecall; \
ret
+#define SYSCALL_NAME(name, sysname) \
+ .global name; \
+ name: \
+ li a7, SYS_ ## sysname; \
+ ecall; \
+ ret
+
+SYSCALL_NAME(sys_exit, exit)
+
SYSCALL(fork)
-SYSCALL(exit)
SYSCALL(wait)
SYSCALL(pipe)
SYSCALL(read)
@@ -29,4 +37,5 @@ SYSCALL(sbrk)
SYSCALL(sleep)
SYSCALL(uptime)
SYSCALL(putc)
-SYSCALL(disk_test) \ No newline at end of file
+SYSCALL(disk_test)
+SYSCALL(lseek) \ No newline at end of file