summaryrefslogtreecommitdiffstats
path: root/libc/string/mips
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string/mips')
-rw-r--r--libc/string/mips/Makefile6
-rw-r--r--libc/string/mips/Makefile.arch26
-rw-r--r--libc/string/mips/memcpy.S10
-rw-r--r--libc/string/mips/memset.S10
-rw-r--r--libc/string/mips/sysdep.h45
5 files changed, 60 insertions, 37 deletions
diff --git a/libc/string/mips/Makefile b/libc/string/mips/Makefile
index ac0063770..0a95346fd 100644
--- a/libc/string/mips/Makefile
+++ b/libc/string/mips/Makefile
@@ -5,9 +5,9 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-top_srcdir=../../../
-top_builddir=../../../
+top_srcdir:=../../../
+top_builddir:=../../../
all: objs
include $(top_builddir)Rules.mak
-include Makefile.arch
+include ../Makefile.in
include $(top_srcdir)Makerules
diff --git a/libc/string/mips/Makefile.arch b/libc/string/mips/Makefile.arch
deleted file mode 100644
index a110c291e..000000000
--- a/libc/string/mips/Makefile.arch
+++ /dev/null
@@ -1,26 +0,0 @@
-# Makefile for uClibc
-#
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
-#
-# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#
-
-SSRC:=memcpy.S memset.S
-
-STRING_ARCH_DIR:=$(top_srcdir)libc/string/mips
-STRING_ARCH_OUT:=$(top_builddir)libc/string/mips
-
-STRING_ARCH_SRC:=$(patsubst %.S,$(STRING_ARCH_DIR)/%.S,$(SSRC))
-STRING_ARCH_OBJ:=$(patsubst %.S,$(STRING_ARCH_OUT)/%.o,$(SSRC))
-
-STRING_ARCH_OBJS:=$(STRING_ARCH_OBJ)
-
-libc-a-$(UCLIBC_HAS_STRING_ARCH_OPT)+=$(STRING_ARCH_OBJS)
-libc-so-$(UCLIBC_HAS_STRING_ARCH_OPT)+=$(STRING_ARCH_OBJS:.o=.os)
-
-libc-nomulti-$(UCLIBC_HAS_STRING_ARCH_OPT)+=$(STRING_ARCH_OBJS)
-
-objclean-y+=string_arch_objclean
-
-string_arch_objclean:
- $(RM) $(STRING_ARCH_OUT)/*.{o,os}
diff --git a/libc/string/mips/memcpy.S b/libc/string/mips/memcpy.S
index 991b44eb4..155bc1128 100644
--- a/libc/string/mips/memcpy.S
+++ b/libc/string/mips/memcpy.S
@@ -17,8 +17,10 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <sysdep.h>
+#include <features.h>
+/*#include <sysdep.h>*/
#include <endian.h>
+#include "sysdep.h"
#ifdef __mips64
#error mips32 code being compiled for mips64!
@@ -38,7 +40,7 @@
# define SWLO swl /* low part is left in little-endian */
#endif
-ENTRY (__memcpy)
+ENTRY (memcpy)
.set noreorder
slti t0, a2, 8 # Less than 8?
@@ -135,6 +137,6 @@ L(shfth):
move a2, t0
.set reorder
-END (__memcpy)
+END (memcpy)
-strong_alias(__memcpy,memcpy)
+libc_hidden_def(memcpy)
diff --git a/libc/string/mips/memset.S b/libc/string/mips/memset.S
index 8e814a49b..9169ad58a 100644
--- a/libc/string/mips/memset.S
+++ b/libc/string/mips/memset.S
@@ -17,8 +17,10 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <sysdep.h>
+#include <features.h>
+/*#include <sysdep.h>*/
#include <endian.h>
+#include "sysdep.h"
#ifdef __mips64
#error mips32 code being compiled for mips64!
@@ -32,7 +34,7 @@
# define SWHI swr /* high part is right in little-endian */
#endif
-ENTRY (__memset)
+ENTRY (memset)
.set noreorder
slti t1, a2, 8 # Less than 8?
@@ -85,6 +87,6 @@ L(exit):
nop
.set reorder
-END (__memset)
+END (memset)
-strong_alias(__memset,memset)
+libc_hidden_def(memset)
diff --git a/libc/string/mips/sysdep.h b/libc/string/mips/sysdep.h
new file mode 100644
index 000000000..96f088c94
--- /dev/null
+++ b/libc/string/mips/sysdep.h
@@ -0,0 +1,45 @@
+/* Adapted from glibc's sysdeps/unix/mips/sysdep.h */
+
+/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Brendan Kehoe (brendan@zen.org).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef __ASSEMBLER__
+
+#include <sgidefs.h>
+#include <sys/regdef.h>
+
+#define ENTRY(name) \
+ .globl name; \
+ .align 2; \
+ .ent name,0; \
+ name##:
+
+#undef END
+#define END(function) \
+ .end function; \
+ .size function,.-function
+
+#if _MIPS_SIM == _MIPS_SIM_ABI32 || _MIPS_SIM == _MIPS_SIM_ABIO64
+# define L(label) $L ## label
+#else
+# define L(label) .L ## label
+#endif
+
+#endif