Remove grub_memalign on emu.

This commit is contained in:
Vladimir Serbinenko 2013-12-08 18:12:20 +01:00
parent fbbfb6ab11
commit 50b3a68db9
4 changed files with 10 additions and 23 deletions

View file

@ -1,3 +1,7 @@
2013-12-08 Vladimir Serbinenko <phcoder@gmail.com>
Remove grub_memalign on emu.
2013-12-08 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/ia64/efi/init.c: Fix alignment code so it doesn't

View file

@ -62,26 +62,3 @@ grub_realloc (void *ptr, grub_size_t size)
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
return ret;
}
#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN)
void *
grub_memalign (grub_size_t align, grub_size_t size)
{
void *p;
if (align < sizeof (void *))
align = sizeof (void *);
#if defined(HAVE_POSIX_MEMALIGN)
if (posix_memalign (&p, align, size) != 0)
p = 0;
#elif defined(HAVE_MEMALIGN)
p = memalign (align, size);
#endif
if (!p)
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
return p;
}
#endif

View file

@ -83,7 +83,11 @@ grub_netbuff_alloc (grub_size_t len)
len = NETBUFFMINLEN;
len = ALIGN_UP (len, NETBUFF_ALIGN);
#ifdef GRUB_MACHINE_EMU
data = grub_malloc (len + sizeof (*nb));
#else
data = grub_memalign (NETBUFF_ALIGN, len + sizeof (*nb));
#endif
if (!data)
return NULL;
nb = (struct grub_net_buff *) ((grub_properly_aligned_t *) data

View file

@ -33,7 +33,9 @@ void *EXPORT_FUNC(grub_malloc) (grub_size_t size);
void *EXPORT_FUNC(grub_zalloc) (grub_size_t size);
void EXPORT_FUNC(grub_free) (void *ptr);
void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size);
#ifndef GRUB_MACHINE_EMU
void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size);
#endif
void grub_mm_check_real (const char *file, int line);
#define grub_mm_check() grub_mm_check_real (GRUB_FILE, __LINE__);