cleaner & greener (was Re: A patch for RTEMS4.10.0 PowerPC heap space initialization)

Kate Feng feng1 at bnl.gov
Fri May 13 17:41:10 UTC 2011


I agree so.  More comments regarding the attached patch before the
PR ?

Thanks,
Kate

Gedare Bloom wrote:
> +static uintptr_t heap_sbrk_spared=0;
> Why is this declared as static global? It looks to me like it is only
> used in one function, can it go on that function's local variables?
>
> _bsp_sbrk_init()
> Should be renamed as bsp_sbrk_init() to be consistent with other bsp functions.
>
> On Fri, May 13, 2011 at 11:08 AM, Kate Feng <feng1 at bnl.gov> wrote:
>   
>> Sebastian Huber wrote:
>>     
>>> On 05/13/2011 04:13 PM, Kate Feng wrote:
>>>
>>>       
>>>> +++ rtems-4.10.0/c/src/lib/libbsp/shared/bootcard.c     2011-05-13
>>>> 09:53:27.000000000 -0400
>>>> @@ -53,6 +53,7 @@
>>>>  #include <bsp/bootcard.h>
>>>>  #include <rtems/bspIo.h>
>>>> +#include <rtems/malloc.h>
>>>>  /*
>>>>  *  At most a single pointer to the cmdline for those target
>>>> @@ -65,6 +66,9 @@
>>>>  */
>>>>  extern bool rtems_unified_work_area;
>>>>  +static uintptr_t heap_sbrk_spared=0;
>>>> +extern uintptr_t _bsp_sbrk_init(uintptr_t, uintptr_t*);
>>>>
>>>>         
>>> The _bsp_sbrk_init() function is only available on PowerPC.
>>>
>>>
>>>       
>> Thanks for your feedback.  How about the attached ?
>> I added _bsp_sbrk_init() for other BSPs at
>> c/src/lib/libbsp/shared/sbrk.c.  According to Joel, it would be needed
>> in the future.  The name seems to be OK at this level, unless Joel comes
>> up with a different name. One could fill in the function when the memory
>> protection is implemented.  It seems that other
>> non-PPC BSPs all use the sbrk() from c/src/lib/libbsp/shared/sbrk.c.
>>
>> More comments before PR ?
>>
>> Thanks,
>> Kate
>>
>>
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.org
>> http://www.rtems.org/mailman/listinfo/rtems-users
>>
>>
>>     

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtems-4.10.0-heapspace_05132011.diff
Type: text/x-patch
Size: 3648 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20110513/eae5d944/attachment-0001.bin>


More information about the users mailing list