+ (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN) \
+ (RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) \
+ (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN))
+#define PRE_REGION_SIZE (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN)
void *
PREFIX (alloc) (grub_size_t size)
*(grub_size_t *) playground = size;
- return playground + RELOCATOR_SIZEOF (forward);
+ return playground + PRE_REGION_SIZE;
}
void *
{
char *playground;
- playground = (char *) relocator - RELOCATOR_SIZEOF (forward);
+ playground = (char *) relocator - PRE_REGION_SIZE;
playground = grub_realloc (playground, size + MAX_OVERHEAD);
if (!playground)
*(grub_size_t *) playground = size;
- return playground + RELOCATOR_SIZEOF (forward);
+ return playground + PRE_REGION_SIZE;
}
void
PREFIX(free) (void *relocator)
{
if (relocator)
- grub_free ((char *) relocator - RELOCATOR_SIZEOF (forward));
+ grub_free ((char *) relocator - PRE_REGION_SIZE);
}
grub_err_t
grub_size_t size;
char *playground;
- playground = (char *) relocator - RELOCATOR_SIZEOF (forward);
+ playground = (char *) relocator - PRE_REGION_SIZE;
size = *(grub_size_t *) playground;
grub_dprintf ("relocator",
if (UINT_TO_PTR (dest) >= relocator)
{
int overhead;
- overhead =
+ overhead = dest -
ALIGN_UP (dest - RELOCATOR_SIZEOF (backward) - RELOCATOR_ALIGN,
RELOCATOR_ALIGN);
grub_dprintf ("relocator",