[SeaBIOS] [PATCH] Remove the pmm handle argument from _malloc().
Don Slutz
dslutz at verizon.com
Mon Dec 30 01:55:57 CET 2013
On 12/27/13 17:19, Kevin O'Connor wrote:
> On Fri, Dec 27, 2013 at 05:07:17PM -0500, Don Slutz wrote:
>> On 12/27/13 11:35, Kevin O'Connor wrote:
>>> The PMM handle argument will almost always be 0xffffffff. Use
>>> separate code for the few rare cases where it may not be the default
>>> value. Gcc produces better code if _malloc() only requires three
>>> parameters.
> [...]
>>> +// Set a handle associated with an allocation.
>>> +void
>>> +malloc_sethandle(void *data, u32 handle)
>>> +{
>>> + ASSERT32FLAT();
>>> + struct allocinfo_s *info = findAlloc(data);
>>> + if (!info || data == (void*)info || data == info->dataend)
>>> + return;
>>> + struct allocdetail_s *detail = container_of(
>>> + info, struct allocdetail_s, datainfo);
>>> + detail->handle = handle;
>> I would think a "dprint(8" should be here like:
>>
>> dprintf(8, "malloc_sethandle handle=%x data=%p (detail=%p)\n"
>> , handle, data, detail);
> Thanks for reviewing. The only place that calls malloc_sethandle
> already shows the handle (handle_pmm00) and the rest of the info is
> displayed by _malloc().
>
> -Kevin
Ok, you can add my:
Reviewed-by: Don Slutz <dslutz at verizon.com>
-Don Slutz
More information about the SeaBIOS
mailing list