]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Align scratch
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 21 Sep 2010 22:52:33 +0000 (00:52 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 21 Sep 2010 22:52:33 +0000 (00:52 +0200)
grub-core/boot/decompressor/minilib.c

index d1f021933bdb399a95128cdb9b556675f52676bc..f2a2ef7e5cb53d2945159fd3af984ea2c96e96f4 100644 (file)
@@ -87,13 +87,16 @@ find_scratch (void *src, void *dst, unsigned long srcsize,
   /* Decoding from ROM.  */
   if (((grub_addr_t) src & 0x10000000))
     {
-      grub_decompressor_scratch = (char *) dst + dstsize;
+      grub_decompressor_scratch = (void *) ALIGN_UP((grub_addr_t) dst + dstsize,
+                                                   256);
       return;
     }
 #endif
   if ((char *) src + srcsize > (char *) dst + dstsize)
-    grub_decompressor_scratch = (char *) src + srcsize;
+    grub_decompressor_scratch = (void *) ALIGN_UP ((grub_addr_t) src + srcsize,
+                                                  256);
   else
-    grub_decompressor_scratch = (char *) dst + dstsize;
+    grub_decompressor_scratch = (void *) ALIGN_UP ((grub_addr_t) dst + dstsize,
+                                                  256);
   return;
 }