From: Matthias Kruk Date: Sat, 23 Nov 2019 06:43:48 +0000 (+0900) Subject: Move cxsend(), cxrecv(), cxsendrecv() syscalls from core into klibc X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=88036fb036642af4bd68cb77927cb5bd64c22ea0;p=corax Move cxsend(), cxrecv(), cxsendrecv() syscalls from core into klibc --- diff --git a/kernel/core/syscall.S b/kernel/core/syscall.S index 61717ef..fbb6308 100644 --- a/kernel/core/syscall.S +++ b/kernel/core/syscall.S @@ -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 diff --git a/kernel/klibc/Makefile b/kernel/klibc/Makefile index 5c90aca..f4f88a0 100644 --- a/kernel/klibc/Makefile +++ b/kernel/klibc/Makefile @@ -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 index 0000000..5dc0bc9 --- /dev/null +++ b/kernel/klibc/coraxcall.S @@ -0,0 +1,43 @@ +#define __ASSEMBLY_SOURCE + +#include +#include + + .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