]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/lib/relocator.c (grub_relocator_alloc_chunk_addr)
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 24 Mar 2011 11:45:51 +0000 (12:45 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 24 Mar 2011 11:45:51 +0000 (12:45 +0100)
[DEBUG_RELOCATOR]: Reuse grub_mm_check.
(grub_relocator_alloc_chunk_align) [DEBUG_RELOCATOR]: Likewise.

ChangeLog
grub-core/lib/relocator.c

index cfce9988bb0e8c377e85f0f958e71168586dd7d9..8744dbff32bb8c9342158132a29c6174db5de68b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-03-24  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/lib/relocator.c (grub_relocator_alloc_chunk_addr)
+       [DEBUG_RELOCATOR]: Reuse grub_mm_check.
+       (grub_relocator_alloc_chunk_align) [DEBUG_RELOCATOR]: Likewise.
+
 2011-03-24  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * include/grub/mm.h (GRUB_MM_CHECK): Rename to ...
index 421054176f500cdaf362857e16487ea3bd1ec14a..7d29ab5cc00c49d9d0a20fa6c1302c887e96448d 100644 (file)
@@ -1284,23 +1284,8 @@ grub_relocator_alloc_chunk_addr (struct grub_relocator *rel,
   chunk->srcv = grub_map_memory (chunk->src, chunk->size);
   *out = chunk;
 #ifdef DEBUG_RELOCATOR
-  {
-    grub_mm_region_t r;
-    grub_mm_header_t p;
-    grub_memset (chunk->srcv, 0xfa, chunk->size);
-    for (r = grub_mm_base; r; r = r->next)
-      {
-       p = r->first;
-       do
-         {
-           if ((grub_addr_t) p < (grub_addr_t) (r + 1)
-               || (grub_addr_t) p >= (grub_addr_t) (r + 1) + r->size)
-             grub_fatal (__FILE__ ":%d: out of range pointer: %p\n", __LINE__, p);
-           p = p->next;
-         }
-       while (p != r->first);
-      }
-  }
+  grub_memset (chunk->srcv, 0xfa, chunk->size);
+  grub_mm_check ();
 #endif
   return GRUB_ERR_NONE;
 }
@@ -1438,24 +1423,8 @@ grub_relocator_alloc_chunk_align (struct grub_relocator *rel,
   chunk->srcv = grub_map_memory (chunk->src, chunk->size);
   *out = chunk;
 #ifdef DEBUG_RELOCATOR
-  {
-    grub_mm_region_t r;
-    grub_mm_header_t p;
-
-    grub_memset (chunk->srcv, 0xfa, chunk->size);
-    for (r = grub_mm_base; r; r = r->next)
-      {
-       p = r->first;
-       do
-         {
-           if ((grub_addr_t) p < (grub_addr_t) (r + 1)
-               || (grub_addr_t) p >= (grub_addr_t) (r + 1) + r->size)
-             grub_fatal (__FILE__ "%d: out of range pointer: %p\n", __LINE__, p);
-           p = p->next;
-         }
-       while (p != r->first);
-      }
-  }
+  grub_memset (chunk->srcv, 0xfa, chunk->size);
+  grub_mm_check ();
 #endif
   return GRUB_ERR_NONE;
 }