* include/grub/misc.h (memcmp) [__APPLE__]: Mark as regparm 0.
(memmove) [__APPLE__]: Likewise. (memcpy) [__APPLE__]: Likewise. (memset) [__APPLE__]: Likewise. * grub-core/kern/misc.c (memcmp) [__APPLE__]: Likewise. (memmove) [__APPLE__]: Likewise. (memcpy) [__APPLE__]: Likewise. (memset) [__APPLE__]: Likewise.
This commit is contained in:
parent
85a730ca9f
commit
f7194551c4
3 changed files with 30 additions and 7 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2012-05-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* include/grub/misc.h (memcmp) [__APPLE__]: Mark as regparm 0.
|
||||||
|
(memmove) [__APPLE__]: Likewise.
|
||||||
|
(memcpy) [__APPLE__]: Likewise.
|
||||||
|
(memset) [__APPLE__]: Likewise.
|
||||||
|
* grub-core/kern/misc.c (memcmp) [__APPLE__]: Likewise.
|
||||||
|
(memmove) [__APPLE__]: Likewise.
|
||||||
|
(memcpy) [__APPLE__]: Likewise.
|
||||||
|
(memset) [__APPLE__]: Likewise.
|
||||||
|
|
||||||
|
|
||||||
2012-05-28 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-05-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/genmod.sh.in: Fix a bug in Apple part which caused
|
* grub-core/genmod.sh.in: Fix a bug in Apple part which caused
|
||||||
|
|
|
@ -64,18 +64,20 @@ grub_memmove (void *dest, const void *src, grub_size_t n)
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef APPLE_CC
|
#ifndef __APPLE__
|
||||||
void *memmove (void *dest, const void *src, grub_size_t n)
|
void *memmove (void *dest, const void *src, grub_size_t n)
|
||||||
__attribute__ ((alias ("grub_memmove")));
|
__attribute__ ((alias ("grub_memmove")));
|
||||||
/* GCC emits references to memcpy() for struct copies etc. */
|
/* GCC emits references to memcpy() for struct copies etc. */
|
||||||
void *memcpy (void *dest, const void *src, grub_size_t n)
|
void *memcpy (void *dest, const void *src, grub_size_t n)
|
||||||
__attribute__ ((alias ("grub_memmove")));
|
__attribute__ ((alias ("grub_memmove")));
|
||||||
#else
|
#else
|
||||||
void *memcpy (void *dest, const void *src, grub_size_t n)
|
void * __attribute__ ((regparm(0)))
|
||||||
|
memcpy (void *dest, const void *src, grub_size_t n)
|
||||||
{
|
{
|
||||||
return grub_memmove (dest, src, n);
|
return grub_memmove (dest, src, n);
|
||||||
}
|
}
|
||||||
void *memmove (void *dest, const void *src, grub_size_t n)
|
void * __attribute__ ((regparm(0)))
|
||||||
|
memmove (void *dest, const void *src, grub_size_t n)
|
||||||
{
|
{
|
||||||
return grub_memmove (dest, src, n);
|
return grub_memmove (dest, src, n);
|
||||||
}
|
}
|
||||||
|
@ -230,11 +232,12 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifndef APPLE_CC
|
#ifndef __APPLE__
|
||||||
int memcmp (const void *s1, const void *s2, grub_size_t n)
|
int memcmp (const void *s1, const void *s2, grub_size_t n)
|
||||||
__attribute__ ((alias ("grub_memcmp")));
|
__attribute__ ((alias ("grub_memcmp")));
|
||||||
#else
|
#else
|
||||||
int memcmp (const void *s1, const void *s2, grub_size_t n)
|
int __attribute__ ((regparm(0)))
|
||||||
|
memcmp (const void *s1, const void *s2, grub_size_t n)
|
||||||
{
|
{
|
||||||
return grub_memcmp (s1, s2, n);
|
return grub_memcmp (s1, s2, n);
|
||||||
}
|
}
|
||||||
|
@ -505,11 +508,12 @@ grub_memset (void *s, int c, grub_size_t len)
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#ifndef APPLE_CC
|
#ifndef __APPLE__
|
||||||
void *memset (void *s, int c, grub_size_t n)
|
void *memset (void *s, int c, grub_size_t n)
|
||||||
__attribute__ ((alias ("grub_memset")));
|
__attribute__ ((alias ("grub_memset")));
|
||||||
#else
|
#else
|
||||||
void *memset (void *s, int c, grub_size_t n)
|
void * __attribute__ ((regparm(0)))
|
||||||
|
memset (void *s, int c, grub_size_t n)
|
||||||
{
|
{
|
||||||
return grub_memset (s, c, n);
|
return grub_memset (s, c, n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,11 +113,18 @@ grub_strncat (char *dest, const char *src, int c)
|
||||||
|
|
||||||
/* Prototypes for aliases. */
|
/* Prototypes for aliases. */
|
||||||
#ifndef GRUB_UTIL
|
#ifndef GRUB_UTIL
|
||||||
|
#ifdef __APPLE__
|
||||||
|
int __attribute__ ((regparm(0))) EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n);
|
||||||
|
void *__attribute__ ((regparm(0))) EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n);
|
||||||
|
void *__attribute__ ((regparm(0))) EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n);
|
||||||
|
void *__attribute__ ((regparm(0))) EXPORT_FUNC(memset) (void *s, int c, grub_size_t n);
|
||||||
|
#else
|
||||||
int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n);
|
int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n);
|
||||||
void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n);
|
void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n);
|
||||||
void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n);
|
void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n);
|
||||||
void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n);
|
void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n);
|
int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n);
|
||||||
int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2);
|
int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2);
|
||||||
|
|
Loading…
Reference in a new issue