]> git.corax.cc Git - corax/commitdiff
Move cxsend(), cxrecv(), cxsendrecv() syscalls from core into klibc
authorMatthias Kruk <m@m10k.eu>
Sat, 23 Nov 2019 06:43:48 +0000 (15:43 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 23 Nov 2019 06:43:48 +0000 (15:43 +0900)
kernel/core/syscall.S
kernel/klibc/Makefile
kernel/klibc/coraxcall.S [new file with mode: 0644]

index 61717ef9f26765edf2b11dad154d317911f9c827..fbb6308629d76a81c975d4702641481085c4d3c5 100644 (file)
@@ -187,45 +187,6 @@ bind:
        popl    %ebx
        ret
 
-/* int cxsend(pid_t dst, struct ipc_msg *buf) */
-
-.global cxsend
-cxsend:
-       pushl   %ebx
-
-       movl    $IPC_SEND, %eax
-       movl    8(%esp), %ebx
-       movl    12(%esp), %ecx
-       int             $SYSCALL_CXIPC
-
-       popl    %ebx
-       ret
-
-/* int cxrecv(pid_t src, struct ipc_msg *buf) */
-.global cxrecv
-cxrecv:
-       pushl   %ebx
-
-       movl    $IPC_RECV, %eax
-       movl    8(%esp), %ebx
-       movl    12(%esp), %ecx
-       int             $SYSCALL_CXIPC
-
-       popl    %ebx
-       ret
-
-.global cxsendrecv
-cxsendrecv:
-       pushl   %ebx
-
-       movl    $IPC_SENDRECV, %eax
-       movl    8(%esp), %ebx
-       movl    12(%esp), %ecx
-       int             $SYSCALL_CXIPC
-
-       popl    %ebx
-       ret
-
        .global sleep
 sleep:
        pushl   %ebx
index 5c90acab94e3ffb547d61d09809ec771a59d202d..f4f88a05bdc7b38bf28e698b81a7cf361b1d786e 100644 (file)
@@ -1,5 +1,5 @@
 OUTPUT = klibc.a
-OBJECTS = string.o spinlock.o mutex.o posixcall.o
+OBJECTS = string.o spinlock.o mutex.o posixcall.o coraxcall.o
 PHONY = clean
 INCLUDES = -I../include -I../../include -I../..
 CFLAGS = -m32 -Wall -nostdlib -nodefaultlibs -nostartfiles -ffreestanding $(INCLUDES)
diff --git a/kernel/klibc/coraxcall.S b/kernel/klibc/coraxcall.S
new file mode 100644 (file)
index 0000000..5dc0bc9
--- /dev/null
@@ -0,0 +1,43 @@
+#define __ASSEMBLY_SOURCE
+
+#include <config.h>
+#include <corax/syscall.h>
+
+       .section .text
+
+       .global cxsend
+       .global cxrecv
+       .global cxsendrecv
+
+cxsend:
+       pushl   %ebx
+
+       movl    $IPC_SEND, %eax
+       movl    8(%esp), %ebx
+       movl    12(%esp), %ecx
+       int             $SYSCALL_CXIPC
+
+       popl    %ebx
+       ret
+
+cxrecv:
+       pushl   %ebx
+
+       movl    $IPC_RECV, %eax
+       movl    8(%esp), %ebx
+       movl    12(%esp), %ecx
+       int             $SYSCALL_CXIPC
+
+       popl    %ebx
+       ret
+
+cxsendrecv:
+       pushl   %ebx
+
+       movl    $IPC_SENDRECV, %eax
+       movl    8(%esp), %ebx
+       movl    12(%esp), %ecx
+       int             $SYSCALL_CXIPC
+
+       popl    %ebx
+       ret