This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] More Arm EABI support routines


The attached patch adds some more routines defined by Arm EABI. These are 
implemented as wrappers around existing routines.

I'm not sure about the preferred implementation of strong_alias. I copied from 
libc/sys/linux/libc-symbols.h.

Tested with cross to arm-none-eabi.
Ok?

Paul

2005-08-31  Paul Brook  <paul@codesourcery.com>

	* libc/sys/arm/Makefile.am (lib_a_SOURCES): Add aeabi_memclr.c,
	aeabi_memcpy.c, aeabi_memmove.c and aeabi_memset.c.
	* libc/sys/arm/Makefile.in: Regenerate.
	* libc/sys/arm/aeabi.h: New file.
	* libc/sys/arm/aeabi_memclr.c: New file.
	* libc/sys/arm/aeabi_memcpy.c: New file.
	* libc/sys/arm/aeabi_memmove.c: New file.
	* libc/sys/arm/aeabi_memset.c: New file.
Index: newlib/libc/sys/arm/Makefile.am
===================================================================
RCS file: /var/cvsroot/src-cvs/src/newlib/libc/sys/arm/Makefile.am,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile.am
--- newlib/libc/sys/arm/Makefile.am	31 Aug 2005 20:39:43 -0000	1.5
+++ newlib/libc/sys/arm/Makefile.am	31 Aug 2005 22:17:09 -0000
@@ -12,7 +12,8 @@ else
 extra_objs =
 endif
 
-lib_a_SOURCES = aeabi_atexit.c
+lib_a_SOURCES = aeabi_atexit.c aeabi_memclr.c aeabi_memcpy.c \
+		aeabi_memmove.c aeabi_memset.c
 lib_a_LIBADD = $(extra_objs)
 lib_a_DEPENDENCIES = $(extra_objs)
 
Index: newlib/libc/sys/arm/Makefile.in
===================================================================
RCS file: /var/cvsroot/src-cvs/src/newlib/libc/sys/arm/Makefile.in,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile.in
--- newlib/libc/sys/arm/Makefile.in	31 Aug 2005 20:39:43 -0000	1.10
+++ newlib/libc/sys/arm/Makefile.in	31 Aug 2005 22:17:31 -0000
@@ -91,7 +91,8 @@ noinst_LIBRARIES = lib.a
 @MAY_SUPPLY_SYSCALLS_TRUE@extra_objs = libcfunc.o trap.o syscalls.o
 @MAY_SUPPLY_SYSCALLS_FALSE@extra_objs = 
 
-lib_a_SOURCES = aeabi_atexit.c
+lib_a_SOURCES = aeabi_atexit.c aeabi_memclr.c aeabi_memcpy.c 		aeabi_memmove.c aeabi_memset.c
+
 lib_a_LIBADD = $(extra_objs)
 lib_a_DEPENDENCIES = $(extra_objs)
 
@@ -106,7 +107,8 @@ LIBRARIES =  $(noinst_LIBRARIES)
 DEFS = @DEFS@ -I. -I$(srcdir) 
 CPPFLAGS = @CPPFLAGS@
 LIBS = @LIBS@
-lib_a_OBJECTS =  aeabi_atexit.o
+lib_a_OBJECTS =  aeabi_atexit.o aeabi_memclr.o aeabi_memcpy.o \
+aeabi_memmove.o aeabi_memset.o
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
Index: newlib/libc/sys/arm/aeabi.h
===================================================================
RCS file: newlib/libc/sys/arm/aeabi.h
diff -N newlib/libc/sys/arm/aeabi.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ newlib/libc/sys/arm/aeabi.h	31 Aug 2005 22:14:56 -0000
@@ -0,0 +1,7 @@
+/* Include file with common definitions used by The Arm EABI support
+   routines.  */
+
+# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+# define _strong_alias(name, aliasname) \
+  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+
Index: newlib/libc/sys/arm/aeabi_memclr.c
===================================================================
RCS file: newlib/libc/sys/arm/aeabi_memclr.c
diff -N newlib/libc/sys/arm/aeabi_memclr.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ newlib/libc/sys/arm/aeabi_memclr.c	31 Aug 2005 21:57:07 -0000
@@ -0,0 +1,13 @@
+#include <string.h>
+#include "aeabi.h"
+
+/* Clear memory.  */
+void
+__aeabi_memclr (void *dest, size_t n)
+{
+  memset (dest, 0, n);
+}
+
+/* Versions of the above which may assume memory alignment.  */
+strong_alias (__aeabi_memclr, __aeabi_memclr4)
+strong_alias (__aeabi_memclr, __aeabi_memclr8)
Index: newlib/libc/sys/arm/aeabi_memcpy.c
===================================================================
RCS file: newlib/libc/sys/arm/aeabi_memcpy.c
diff -N newlib/libc/sys/arm/aeabi_memcpy.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ newlib/libc/sys/arm/aeabi_memcpy.c	31 Aug 2005 21:57:53 -0000
@@ -0,0 +1,13 @@
+#include <string.h>
+#include "aeabi.h"
+
+/* Copy memory like memcpy, but no return value required.  */
+void
+__aeabi_memcpy (void *dest, const void *src, size_t n)
+{
+  memcpy (dest, src, n);
+}
+
+/* Versions of the above which may assume memory alignment.  */
+strong_alias (__aeabi_memcpy, __aeabi_memcpy4)
+strong_alias (__aeabi_memcpy, __aeabi_memcpy8)
Index: newlib/libc/sys/arm/aeabi_memmove.c
===================================================================
RCS file: newlib/libc/sys/arm/aeabi_memmove.c
diff -N newlib/libc/sys/arm/aeabi_memmove.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ newlib/libc/sys/arm/aeabi_memmove.c	31 Aug 2005 21:58:26 -0000
@@ -0,0 +1,13 @@
+#include <string.h>
+#include "aeabi.h"
+
+/* Copy memory like memmove, but no return value required.  */
+void
+__aeabi_memmove (void *dest, const void *src, size_t n)
+{
+  memmove (dest, src, n);
+}
+
+/* Versions of the above which may assume memory alignment.  */
+strong_alias (__aeabi_memmove, __aeabi_memmove4)
+strong_alias (__aeabi_memmove, __aeabi_memmove8)
Index: newlib/libc/sys/arm/aeabi_memset.c
===================================================================
RCS file: newlib/libc/sys/arm/aeabi_memset.c
diff -N newlib/libc/sys/arm/aeabi_memset.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ newlib/libc/sys/arm/aeabi_memset.c	31 Aug 2005 21:58:54 -0000
@@ -0,0 +1,14 @@
+#include <string.h>
+#include "aeabi.h"
+
+/* Set memory like memset, but different argument order and no return
+   value required.  */
+void
+__aeabi_memset (void *dest, size_t n, int c)
+{
+  memset (dest, c, n);
+}
+
+/* Versions of the above which may assume memory alignment.  */
+strong_alias (__aeabi_memset, __aeabi_memset4)
+strong_alias (__aeabi_memset, __aeabi_memset8)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]