[PATCH] add freelist data structure to score

Ashi ashi08104 at gmail.com
Thu Jul 18 15:30:30 UTC 2013


On Tue, Jul 16, 2013 at 8:25 PM, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> Hello Ashi,
>
> On 07/16/2013 05:57 AM, Ashi wrote:
>
>> diff --git a/cpukit/score/include/rtems/**score/freechain.h
>> b/cpukit/score/include/rtems/**score/freechain.h
>> new file mode 100644
>> index 0000000..f645842
>> --- /dev/null
>> +++ b/cpukit/score/include/rtems/**score/freechain.h
>>
>> @@ -0,0 +1,138 @@
>> +/**
>> + * @file
>> + *
>> + * @ingroup ScoreFreechain
>> + *
>> + * @brief Freechain Handler API
>>
>> + */
>> +/*
>> + * Copyright (c) 2013 Gedare Bloom.
>> + *
>> + * The license and distribution terms for this file may be
>> + * found in the file LICENSE in this distribution or at
>> + *http://www.rtems.com/license/**LICENSE<http://www.rtems.com/license/LICENSE>
>> .
>> + */
>> +
>> +#ifndef _FREECHAIN_H
>> +#define _FREECHAIN_H
>>
>> +
>> +#include <rtems/score/chain.h>
>> +#include <rtems/rtems/types.h>
>> +#include <rtems/score/wkspace.h>
>> +
>> +/**
>> + * @defgroup ScoreFreechain Freechain Handler API
>>
>> + *
>> + * @ingroup Score
>> + *
>> + * The Freechain Handler is used to manage a chain of nodes, of which
>> size can
>>
>> + * automatically increase when there is no free node left. This handler
>> provides one data structure:
>> + * Freechain_Control.
>>
>> + */
>> +/**@{*/
>> +
>> +#ifdef __cplusplus
>> +extern "C" {
>> +#endif
>> +
>> +/**
>> + * @typedef Freechain_Control
>> + */
>> +typedef struct Freechain_Control Freechain_Control;
>> +
>> +/**
>> + * @brief Extends the freechain.
>> + *
>> + * @param[in] freechain The freechain control.
>> + */
>> +typedef void *( *Freechain_Extend )( Freechain_Control *freechain );
>>
>
> since the return value is only used to indicate the status I would use a
> bool return type here.
>
>  +
>> +/**
>> + * @typedef freechain_callout
>> + *
>> + * @param[in] freechain The freechain control.
>> + * @param[in] nodes The new added nodes.
>> + */
>> +typedef void (*freechain_callout)(
>> +  Freechain_Control *freechain,
>> +  void *nodes
>> +);
>>
>
> We no longer need this callout handler.
>
> The rest looks fine.
>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-**brains.de<sebastian.huber at embedded-brains.de>
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>

 Hi, Sebastian, Thanks, I've updated.

>the option you can use is "CONFIGURE_MEMORY_OVERHEAD". It is a "fudge
>factor" specified in KiB.

Hi, Gedare, thanks, the workspace freechain test case is added now.

Cheers,
Zhongwei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130718/21bd63e6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freechain.patch
Type: application/octet-stream
Size: 22086 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130718/21bd63e6/attachment.obj>


More information about the devel mailing list