[OpenBIOS] [PATCH] Implement new pv_align_mem_alloc romvec interface for allocating aligned memory.

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Wed Apr 20 21:16:38 CEST 2011


On 19/04/11 20:31, Blue Swirl wrote:

>> -char *obp_dumb_memalloc(char *va, unsigned int size)
>> +char *obp_align_memalloc(char *va, unsigned int size, unsigned int align)

Apparently there is a v2 and a v3 version of malloc() within romvec, so 
it's pretty likely that this is the v3 version given its position within 
the structure. I'll rename this to something that makes it more obvious 
it is v3 related.

>>   void obp_dumb_memfree(__attribute__((unused))char *va,
>> diff --git a/openbios-devel/arch/sparc32/openprom.h b/openbios-devel/arch/sparc32/openprom.h
>> index 0a2074b..5f05014 100644
>> --- a/openbios-devel/arch/sparc32/openprom.h
>> +++ b/openbios-devel/arch/sparc32/openprom.h
>> @@ -135,7 +135,10 @@ struct linux_romvec {
>>         struct linux_bootargs_v2 pv_v2bootargs;
>>         struct linux_dev_v2_funcs pv_v2devops;
>>
>> -       int filler[15];
>> +       /* Allocate memory to specified alignment */
>> +       char * (*pv_align_mem_alloc)(char *va, unsigned int size, unsigned int align);
>> +
>> +       int filler[11];
>
> This would shorten the structure by 12 bytes, please use 14 instead of 11.

Ah yes, my mistake - it's an int rather than a char. Will re-submit 
shortly with these two changes.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the OpenBIOS mailing list