]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Make arm-emu work.
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 8 Dec 2013 01:59:21 +0000 (02:59 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 8 Dec 2013 01:59:21 +0000 (02:59 +0100)
ChangeLog
conf/Makefile.common
grub-core/kern/emu/cache.c
grub-core/kern/emu/cache_s.S
grub-core/kern/emu/full.c
grub-core/kern/emu/lite.c
grub-core/kern/misc.c
grub-core/tests/video_checksum.c

index ca2e17fe89647a2cfbd3a09f6c4eba07761656c8..0a725555b9f342baa5404915014d57b4ddfb1b45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 4ec2b811e5735a5d1e22baa42ae3f07457a7062b..47f3b9a038590c0bee2641ea3c13b4db8863be4b 100644 (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
index 543e457e5e9f884d333a8ff2676c8f523af81e87..4a701f44ac764046af675897fab579bf8fe4960f 100644 (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);
index 8ca695c28e4b8a0a414940d184582141f365b715..7fbebb80d20b0a5bf7a6b30e02c0b44bd40af57a 100644 (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
index e056ded97be68749c0f7c4e74beb1635f155272c..03888d8ece6c29d495f889734aa4b774e66e2bfb 100644 (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
 
index 00b811bf57cf6bf068e210ea23ddb6e06448c2fc..be1e678767de5bd67bd77a3dbd9b20e05e3b0b5b 100644 (file)
 #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
index cbd2748edf445c8c5c926f5d8b7d4d144b899b2d..05cb1faf7a01e0de8563c25bb61b57e6e358afb4 100644 (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__)
 
index 996b936cb607be653e6a20ffddce62ce79f9eaea..f8927555f933cdeafaec0522516bd6d175da4f93 100644 (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++)