Make arm-emu work.

This commit is contained in:
Vladimir Serbinenko 2013-12-08 02:59:21 +01:00
parent c8fd2ddf6d
commit c311ced5d7
8 changed files with 22 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2013-12-08 Vladimir Serbinenko <phcoder@gmail.com>
Make arm-emu work.
2013-12-07 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkfont.c: Replace stpcpy with grub_stpcpy.

View File

@ -13,8 +13,10 @@ endif
if COND_arm
CFLAGS_PLATFORM += -mthumb-interwork
CCASFLAGS_PLATFORM = -mthumb-interwork
if !COND_emu
LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
endif
endif
if COND_arm64
CFLAGS_PLATFORM += -mcmodel=large
endif

View File

@ -1,5 +1,5 @@
#if defined(__ia64__)
#if defined(__ia64__) || defined (__arm__) || defined (__aarch64__)
#include <grub/cache.h>
void __clear_cache (char *beg, char *end);

View File

@ -23,7 +23,7 @@ FUNCTION (grub_arch_sync_caches)
.set macro
#elif defined(__powerpc__)
#include "../powerpc/cache.S"
#elif defined(__ia64__)
#elif defined(__ia64__) || defined(__arm__) || defined(__aarch64__)
#else
#error "No target cpu type is defined"
#endif

View File

@ -49,12 +49,14 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
return GRUB_ERR_BAD_MODULE;
}
#if defined (__ia64__) || defined (__powerpc__) || defined (__mips__)
void grub_arch_dl_get_tramp_got_size (const void *ehdr __attribute__ ((unused)),
grub_size_t *tramp, grub_size_t *got)
#if !defined (__i386__) && !defined (__x86_64__) && !defined (__sparc__)
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr __attribute__ ((unused)),
grub_size_t *tramp, grub_size_t *got)
{
*tramp = 0;
*got = 0;
return GRUB_ERR_BAD_MODULE;
}
#endif

View File

@ -17,6 +17,12 @@
#include "../powerpc/dl.c"
#elif defined(__ia64__)
#include "../ia64/dl.c"
#elif defined(__arm__)
#include "../arm/dl_helper.c"
#include "../arm/dl.c"
#elif defined(__aarch64__)
#include "../arm64/dl_helper.c"
#include "../arm64/dl.c"
#else
#error "No target cpu type is defined"
#endif

View File

@ -628,7 +628,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
return q;
}
#ifndef GRUB_UTIL
#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
#if defined (__arm__)

View File

@ -350,7 +350,7 @@ grub_video_capture_write_bmp (const char *fname,
for (y = mode_info->height - 1; y >= 0; y--)
{
grub_uint32_t *iptr = (grub_uint32_t *) ((grub_uint8_t *) ptr + mode_info->pitch * y);
grub_uint32_t *iptr = (grub_uint32_t *) ptr + (mode_info->pitch / 4) * y;
int x;
grub_uint8_t *optr = buffer;
for (x = 0; x < (int) mode_info->width; x++)
@ -421,7 +421,7 @@ grub_video_capture_write_bmp (const char *fname,
for (y = mode_info->height - 1; y >= 0; y--)
{
grub_uint16_t *iptr = (grub_uint16_t *) ((grub_uint8_t *) ptr + mode_info->pitch * y);
grub_uint16_t *iptr = (grub_uint16_t *) ptr + (mode_info->pitch / 2) * y;
int x;
grub_uint8_t *optr = buffer;
for (x = 0; x < (int) mode_info->width; x++)