popl %ebx
ret
-.global fork
-fork:
- pushl %ebx
-
- movl $SYS_FORK, %eax
- int $SYSCALL_POSIX
-
- popl %ebx
- ret
-
-.global execfve
-execfve:
- pushl %ebx
-
- movl $SYS_EXECFVE, %eax
- movl 8(%esp), %ebx
- movl 12(%esp), %ecx
- movl 16(%esp), %edx
- int $SYSCALL_POSIX
-
- popl %ebx
- ret
-
.global sleep
sleep:
pushl %ebx
OUTPUT = klibc.a
-OBJECTS = string.o spinlock.o mutex.o
+OBJECTS = string.o spinlock.o mutex.o posixcall.o
PHONY = clean
INCLUDES = -I../include -I../../include -I../..
CFLAGS = -m32 -Wall -nostdlib -nodefaultlibs -nostartfiles -ffreestanding $(INCLUDES)
--- /dev/null
+#define _ASSEMBLY_SOURCE
+
+#include <config.h>
+#include <corax/syscall.h>
+
+#if FEATURE(POSIX)
+
+ .section .text
+
+ .global fork
+ .global execfve
+
+fork:
+ pushl %ebx
+
+ movl $SYS_FORK, %eax
+ int $SYSCALL_POSIX
+
+ popl %ebx
+ ret
+
+execfve:
+ pushl %ebx
+
+ movl $SYS_EXECFVE, %eax
+ movl 8(%esp), %ebx
+ movl 12(%esp), %ecx
+ movl 16(%esp), %edx
+ int $SYSCALL_POSIX
+
+ popl %ebx
+ ret
+
+#endif /* FEATURE(POSIX) */