ref: 8b3b797a2474a56c72f4c0f190910aeb320943be
parent: a312efcf46527321f1a87033214c752a6bdda62e
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Jan 21 17:28:08 EST 2020
libc: Move mem* functions to arch directory Moving these functions to the architecture allows to introduce optmized versions of these function, because at this moment they are usable as they are implemented using commmon C funcions.
--- a/src/libc/arch/amd64/Makefile
+++ b/src/libc/arch/amd64/Makefile
@@ -3,8 +3,21 @@
include $(PROJECTDIR)/scripts/rules.mk
include ../../rules.mk
-OBJS = longjmp.$O setjmp.$O
-DIRS = netbsd openbsd dragonfly linux darwin
+OBJS =\
+ longjmp.$O\
+ setjmp.$O\
+ memchr.$O\
+ memcmp.$O\
+ memcpy.$O\
+ memmove.$O\
+ memset.$O\
+
+DIRS =\
+ netbsd\
+ openbsd\
+ dragonfly\
+ linux\
+ darwin\
all: $(LIBC) $(SYS)
--- /dev/null
+++ b/src/libc/arch/amd64/memchr.c
@@ -1,0 +1,1 @@
+#include "../../string/memchr.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/amd64/memcmp.c
@@ -1,0 +1,1 @@
+#include "../../string/memcmp.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/amd64/memcpy.c
@@ -1,0 +1,1 @@
+#include "../../string/memcpy.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/amd64/memmove.c
@@ -1,0 +1,1 @@
+#include "../../string/memmove.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/amd64/memset.c
@@ -1,0 +1,1 @@
+#include "../../string/memset.c"
\ No newline at end of file
--- a/src/libc/arch/arm32/Makefile
+++ b/src/libc/arch/arm32/Makefile
@@ -3,7 +3,15 @@
include $(PROJECTDIR)/scripts/rules.mk
include ../../rules.mk
-OBJS = longjmp.$O setjmp.$O
+OBJS =\
+ longjmp.$O\
+ setjmp.$O\
+ memchr.$O\
+ memcmp.$O\
+ memcpy.$O\
+ memmove.$O\
+ memset.$O\
+
DIRS = linux
all: $(LIBC) $(SYS)
--- /dev/null
+++ b/src/libc/arch/arm32/memchr.c
@@ -1,0 +1,1 @@
+#include "../../string/memchr.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/arm32/memcmp.c
@@ -1,0 +1,1 @@
+#include "../../string/memcmp.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/arm32/memcpy.c
@@ -1,0 +1,1 @@
+#include "../../string/memcpy.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/arm32/memmove.c
@@ -1,0 +1,1 @@
+#include "../../string/memmove.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/arm32/memset.c
@@ -1,0 +1,1 @@
+#include "../../string/memset.c"
\ No newline at end of file
--- a/src/libc/arch/arm64/Makefile
+++ b/src/libc/arch/arm64/Makefile
@@ -3,7 +3,15 @@
include $(PROJECTDIR)/scripts/rules.mk
include ../../rules.mk
-OBJS = longjmp.$O setjmp.$O
+OBJS =\
+ longjmp.$O\
+ setjmp.$O\
+ memchr.$O\
+ memcmp.$O\
+ memcpy.$O\
+ memmove.$O\
+ memset.$O\
+
DIRS = linux
all: $(LIBC) $(SYS)
--- /dev/null
+++ b/src/libc/arch/arm64/memchr.c
@@ -1,0 +1,1 @@
+#include "../../string/memchr.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/arm64/memcmp.c
@@ -1,0 +1,1 @@
+#include "../../string/memcmp.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/arm64/memcpy.c
@@ -1,0 +1,1 @@
+#include "../../string/memcpy.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/arm64/memmove.c
@@ -1,0 +1,1 @@
+#include "../../string/memmove.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/arm64/memset.c
@@ -1,0 +1,1 @@
+#include "../../string/memset.c"
\ No newline at end of file
--- a/src/libc/arch/i386/Makefile
+++ b/src/libc/arch/i386/Makefile
@@ -3,7 +3,15 @@
include $(PROJECTDIR)/scripts/rules.mk
include ../../rules.mk
-OBJS = longjmp.$O setjmp.$O
+OBJS =\
+ longjmp.$O\
+ setjmp.$O\
+ memchr.$O\
+ memcmp.$O\
+ memcpy.$O\
+ memmove.$O\
+ memset.$O\
+
DIRS = linux
all: $(LIBC) $(SYS)
--- /dev/null
+++ b/src/libc/arch/i386/memchr.c
@@ -1,0 +1,1 @@
+#include "../../string/memchr.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/i386/memcmp.c
@@ -1,0 +1,1 @@
+#include "../../string/memcmp.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/i386/memcpy.c
@@ -1,0 +1,1 @@
+#include "../../../string/memcpy.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/i386/memmove.c
@@ -1,0 +1,1 @@
+#include "../../string/memmove.c"
\ No newline at end of file
--- /dev/null
+++ b/src/libc/arch/i386/memset.c
@@ -1,0 +1,1 @@
+#include "../../string/memset.c"
\ No newline at end of file
--- a/src/libc/string/Makefile
+++ b/src/libc/string/Makefile
@@ -4,11 +4,6 @@
include ../rules.mk
OBJS = \
- memchr.$O\
- memcmp.$O\
- memcpy.$O\
- memmove.$O\
- memset.$O\
strcat.$O\
strchr.$O\
strcmp.$O\