|
@@ -23,9 +23,10 @@
|
|
We need to do some arg shifting, the syscall_number will be in
|
|
We need to do some arg shifting, the syscall_number will be in
|
|
rax. */
|
|
rax. */
|
|
|
|
|
|
-.globl syscall;
|
|
|
|
-.type syscall,@function;
|
|
|
|
-.align 16;
|
|
|
|
|
|
+.text
|
|
|
|
+.globl syscall
|
|
|
|
+.type syscall,@function
|
|
|
|
+.align 16
|
|
syscall:
|
|
syscall:
|
|
movq %rdi, %rax /* Syscall number -> rax. */
|
|
movq %rdi, %rax /* Syscall number -> rax. */
|
|
movq %rsi, %rdi /* shift arg1 - arg5. */
|
|
movq %rsi, %rdi /* shift arg1 - arg5. */
|
|
@@ -36,10 +37,10 @@ syscall:
|
|
movq 8(%rsp),%r9 /* arg6 is on the stack. */
|
|
movq 8(%rsp),%r9 /* arg6 is on the stack. */
|
|
syscall /* Do the system call. */
|
|
syscall /* Do the system call. */
|
|
cmpq $-4095, %rax /* Check %rax for error. */
|
|
cmpq $-4095, %rax /* Check %rax for error. */
|
|
- jae __syscall_error /* Branch forward if it failed. */
|
|
|
|
|
|
+ jae __error /* Branch forward if it failed. */
|
|
ret /* Return to caller. */
|
|
ret /* Return to caller. */
|
|
|
|
|
|
-__syscall_error:
|
|
|
|
- /* TODO: implement this ! :D */
|
|
|
|
|
|
+__error:
|
|
|
|
+ jmp __syscall_error
|
|
|
|
|
|
-.size syscall,.-syscall;
|
|
|
|
|
|
+.size syscall,.-syscall
|