* grub-core/lib/relocator.c (grub_relocator_alloc_chunk_addr)

[DEBUG_RELOCATOR]: Reuse grub_mm_check.
	(grub_relocator_alloc_chunk_align) [DEBUG_RELOCATOR]: Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-03-24 12:45:51 +01:00
parent 3f71cded81
commit c7064d9425
2 changed files with 10 additions and 35 deletions

View File

@ -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 ...

View 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;
}