summaryrefslogtreecommitdiff
path: root/src/user/lib/syscall.s
diff options
context:
space:
mode:
authordzwdz2022-07-11 21:54:51 +0200
committerdzwdz2022-07-11 21:54:51 +0200
commit2e79a2e5af3affa7a6a3becdffb1c91d89af90af (patch)
treec253761c4ec010ad14b08f9ee8dfc1a50411b30f /src/user/lib/syscall.s
parent6c01d9a7e34e1fccc2775b0e2187ac5e50dd4392 (diff)
user: reorganize the userland sources
Diffstat (limited to 'src/user/lib/syscall.s')
-rw-r--r--src/user/lib/syscall.s24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/user/lib/syscall.s b/src/user/lib/syscall.s
new file mode 100644
index 0000000..0af49f3
--- /dev/null
+++ b/src/user/lib/syscall.s
@@ -0,0 +1,24 @@
+.section .text
+.global _syscall
+.type _syscall, @function
+_syscall:
+ push %ebx // preserve registers
+ push %esi
+ push %edi
+ push %ebp
+
+ mov 20(%esp), %eax
+ mov 24(%esp), %ebx
+ mov %esp, %ecx
+ mov $_syscall_ret, %edx
+ mov 28(%esp), %esi
+ mov 32(%esp), %edi
+ mov 36(%esp), %ebp
+ sysenter
+
+_syscall_ret:
+ pop %ebp
+ pop %edi
+ pop %esi
+ pop %ebx
+ ret