* include/grub/misc.h [__APPLE__]: Do not add regparm(0) on x86_64.
* grub-core/kern/misc.c (__bzero) [__APPLE__]: New function.
This commit is contained in:
parent
66acd9d64c
commit
8506a64149
3 changed files with 29 additions and 13 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-11-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* include/grub/misc.h [__APPLE__]: Do not add regparm(0) on x86_64.
|
||||||
|
* grub-core/kern/misc.c (__bzero) [__APPLE__]: New function.
|
||||||
|
|
||||||
2013-11-11 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-11-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* util/getroot.c (grub_util_biosdisk_get_grub_dev) [__APPLE__]:
|
* util/getroot.c (grub_util_biosdisk_get_grub_dev) [__APPLE__]:
|
||||||
|
|
|
@ -71,12 +71,12 @@ void *memmove (void *dest, const void *src, grub_size_t n)
|
||||||
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 * __attribute__ ((regparm(0)))
|
void * GRUB_BUILTIN_ATTR
|
||||||
memcpy (void *dest, const void *src, grub_size_t n)
|
memcpy (void *dest, const void *src, grub_size_t n)
|
||||||
{
|
{
|
||||||
return grub_memmove (dest, src, n);
|
return grub_memmove (dest, src, n);
|
||||||
}
|
}
|
||||||
void * __attribute__ ((regparm(0)))
|
void * GRUB_BUILTIN_ATTR
|
||||||
memmove (void *dest, const void *src, grub_size_t n)
|
memmove (void *dest, const void *src, grub_size_t n)
|
||||||
{
|
{
|
||||||
return grub_memmove (dest, src, n);
|
return grub_memmove (dest, src, n);
|
||||||
|
@ -225,7 +225,7 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n)
|
||||||
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 __attribute__ ((regparm(0)))
|
int GRUB_BUILTIN_ATTR
|
||||||
memcmp (const void *s1, const void *s2, grub_size_t n)
|
memcmp (const void *s1, const void *s2, grub_size_t n)
|
||||||
{
|
{
|
||||||
return grub_memcmp (s1, s2, n);
|
return grub_memcmp (s1, s2, n);
|
||||||
|
@ -504,11 +504,18 @@ grub_memset (void *s, int c, grub_size_t len)
|
||||||
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 * __attribute__ ((regparm(0)))
|
void * GRUB_BUILTIN_ATTR
|
||||||
memset (void *s, int c, grub_size_t n)
|
memset (void *s, int c, grub_size_t n)
|
||||||
{
|
{
|
||||||
return grub_memset (s, c, n);
|
return grub_memset (s, c, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GRUB_BUILTIN_ATTR
|
||||||
|
__bzero (void *s, grub_size_t n)
|
||||||
|
{
|
||||||
|
grub_memset (s, 0, n);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
grub_size_t
|
grub_size_t
|
||||||
|
|
|
@ -98,19 +98,23 @@ grub_memcpy (void *dest, const void *src, grub_size_t n)
|
||||||
return grub_memmove (dest, src, n);
|
return grub_memmove (dest, src, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (__APPLE__) && defined(__i386__) && !defined (GRUB_UTIL)
|
||||||
|
#define GRUB_BUILTIN_ATTR __attribute__ ((regparm(0)))
|
||||||
|
#else
|
||||||
|
#define GRUB_BUILTIN_ATTR
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Prototypes for aliases. */
|
/* Prototypes for aliases. */
|
||||||
#ifndef GRUB_UTIL
|
#ifndef GRUB_UTIL
|
||||||
|
int GRUB_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n);
|
||||||
|
void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n);
|
||||||
|
void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n);
|
||||||
|
void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memset) (void *s, int c, grub_size_t n);
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
int __attribute__ ((regparm(0))) EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n);
|
void GRUB_BUILTIN_ATTR EXPORT_FUNC (__bzero) (void *s, 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);
|
|
||||||
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(memset) (void *s, int c, grub_size_t n);
|
|
||||||
#endif
|
#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);
|
||||||
|
|
Loading…
Reference in a new issue