* 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
|
@ -98,19 +98,23 @@ grub_memcpy (void *dest, const void *src, grub_size_t 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. */
|
||||
#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__
|
||||
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);
|
||||
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);
|
||||
void GRUB_BUILTIN_ATTR EXPORT_FUNC (__bzero) (void *s, grub_size_t n);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue