This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-08-03 13:50:02 +02:00
parent c2a583ec38
commit fe7546f39a

View file

@ -70,7 +70,8 @@ grub_relocator32_alloc (grub_size_t size)
playground = grub_malloc ((RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN)
+ size
+ (RELOCATOR_SIZEOF(backward) + RELOCATOR_ALIGN));
+ (RELOCATOR_SIZEOF (backward) +
RELOCATOR_ALIGN));
if (!playground)
return 0;
@ -102,7 +103,9 @@ grub_relocator32_boot (void *relocator, grub_uint32_t dest,
{
int overhead;
overhead = ALIGN_UP (dest - RELOCATOR_SIZEOF(backward) - RELOCATOR_ALIGN, RELOCATOR_ALIGN);
overhead =
ALIGN_UP (dest - RELOCATOR_SIZEOF (backward) - RELOCATOR_ALIGN,
RELOCATOR_ALIGN);
grub_relocator32_backward_dest = dest - overhead;
grub_relocator32_backward_src = PTR_TO_UINT64 (relocator - overhead);
grub_relocator32_backward_size = size + overhead;
@ -138,8 +141,11 @@ grub_relocator32_boot (void *relocator, grub_uint32_t dest,
grub_relocator32_forward_esp = state.esp;
grub_memmove (relocator + size + overhead - RELOCATOR_SIZEOF (forward),
&grub_relocator32_forward_start, RELOCATOR_SIZEOF(forward));
entry = (void (*) ()) (relocator + size + overhead - RELOCATOR_SIZEOF(forward));
&grub_relocator32_forward_start,
RELOCATOR_SIZEOF (forward));
entry =
(void (*)()) (relocator + size + overhead -
RELOCATOR_SIZEOF (forward));
}
entry ();