Return the allocated address of the memory block in the request structure
if a memory allocation was actually done. Leave the address untouched
otherwise. This enables a caller who wants to use the allocated memory
directly, rather than adding the memory to the heap, to see where memory
was allocated. None of the current callers need this but the converted
ieee1275 loader will make use of it.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Pavithra Prakash <pavrampu@in.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Carolyn Scherrer <cpscherr@us.ibm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
if (rcr->init_region)
grub_mm_init_region ((void *) (grub_addr_t) addr, len);
rcr->total -= len;
+
+ rcr->addr = addr;
}
*(grub_uint32_t *) data = rcr->total;
unsigned int flags; /* GRUB_MM_ADD_REGION_(NONE|CONSECUTIVE) */
grub_uint32_t total; /* number of requested bytes */
bool init_region; /* whether to add memory to the heap using grub_mm_init_region() */
+ grub_uint64_t addr; /* result address */
};
#endif /* GRUB_IEEE1275_ALLOC_HEADER */