libpayload: make functions static that are unused outside memory.c

The default_ functions in memory.c are only used to initialize a weak
variable.  They should not be used outside memory.c. Make them
invisible.

Remove the declaration from libpayload.h. For real this time.

Change-Id: Id54c1fd172c78748f01a958ce4065dd0eb53bbc3
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: http://review.coreboot.org/2394
Tested-by: build bot (Jenkins)
Reviewed-by: Gabe Black <gabeblack@chromium.org>
This commit is contained in:
Ronald G. Minnich 2013-02-14 14:36:46 -08:00 committed by Gabe Black
parent f2e10cb544
commit c1ee8641cb
1 changed files with 15 additions and 14 deletions

View File

@ -33,10 +33,7 @@
#include <libpayload.h> #include <libpayload.h>
void *memset(void *s, int c, size_t n) static void *default_memset(void *s, int c, size_t n)
__attribute__((weak, alias("default_memset")));
void *default_memset(void *s, int c, size_t n)
{ {
char *os = s; char *os = s;
@ -46,10 +43,10 @@ void *default_memset(void *s, int c, size_t n)
return s; return s;
} }
void *memcpy(void *dst, const void *src, size_t n) void *memset(void *s, int c, size_t n)
__attribute__((weak, alias("default_memcpy"))); __attribute__((weak, alias("default_memset")));
void *default_memcpy(void *dst, const void *src, size_t n) static void *default_memcpy(void *dst, const void *src, size_t n)
{ {
int i; int i;
void *ret = dst; void *ret = dst;
@ -67,10 +64,10 @@ void *default_memcpy(void *dst, const void *src, size_t n)
return ret; return ret;
} }
void *memmove(void *dst, const void *src, size_t n) void *memcpy(void *dst, const void *src, size_t n)
__attribute__((weak, alias("default_memmove"))); __attribute__((weak, alias("default_memcpy")));
void *default_memmove(void *dst, const void *src, size_t n) static void *default_memmove(void *dst, const void *src, size_t n)
{ {
int i; int i;
unsigned long offs; unsigned long offs;
@ -90,6 +87,9 @@ void *default_memmove(void *dst, const void *src, size_t n)
return dst; return dst;
} }
void *memmove(void *dst, const void *src, size_t n)
__attribute__((weak, alias("default_memmove")));
/** /**
* Compare two memory areas. * Compare two memory areas.
* *
@ -100,11 +100,12 @@ void *default_memmove(void *dst, const void *src, size_t n)
* Otherwise return non-zero. * Otherwise return non-zero.
*/ */
int memcmp(const void *s1, const void *s2, size_t len) static int default_memcmp(const void *s1, const void *s2, size_t len)
__attribute__((weak, alias("default_memcmp")));
int default_memcmp(const void *s1, const void *s2, size_t len)
{ {
for (; len && *(char *)s1++ == *(char *)s2++; len--) ; for (; len && *(char *)s1++ == *(char *)s2++; len--) ;
return len; return len;
} }
int memcmp(const void *s1, const void *s2, size_t len)
__attribute__((weak, alias("default_memcmp")));