summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/freechain.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-22 19:14:51 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-14 07:03:29 +0100
commit21275b58a5a69c3c838082ffc8a7a3641f32ea9a (patch)
treed331e17c15d71f107d0f14581a93ddf768b05813 /cpukit/include/rtems/score/freechain.h
parentrtems: Use object information to get config max (diff)
downloadrtems-21275b58a5a69c3c838082ffc8a7a3641f32ea9a.tar.bz2
score: Static Objects_Information initialization
Statically allocate the objects information together with the initial set of objects either via <rtems/confdefs.h>. Provide default object informations with zero objects via librtemscpu.a. This greatly simplifies the workspace size estimate. RTEMS applications which do not use the unlimited objects option are easier to debug since all objects reside now in statically allocated objects of the right types. Close #3621.
Diffstat (limited to 'cpukit/include/rtems/score/freechain.h')
-rw-r--r--cpukit/include/rtems/score/freechain.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/cpukit/include/rtems/score/freechain.h b/cpukit/include/rtems/score/freechain.h
index 1540c0e2a1..6282178347 100644
--- a/cpukit/include/rtems/score/freechain.h
+++ b/cpukit/include/rtems/score/freechain.h
@@ -17,7 +17,7 @@
#define _RTEMS_SCORE_FREECHAIN_H
#include <rtems/score/basedefs.h>
-#include <rtems/score/chain.h>
+#include <rtems/score/chainimpl.h>
#ifdef __cplusplus
extern "C" {
@@ -58,16 +58,24 @@ typedef struct {
* get more nodes.
*
* @param[in] freechain The freechain control to initialize.
- * @param[in] allocator The allocator function.
+ * @param[in] initial_nodes Array with the initial nodes.
* @param[in] number_nodes The initial number of nodes.
* @param[in] node_size The node size.
*/
-void _Freechain_Initialize(
+RTEMS_INLINE_ROUTINE void _Freechain_Initialize(
Freechain_Control *freechain,
- Freechain_Allocator allocator,
+ void *initial_nodes,
size_t number_nodes,
size_t node_size
-);
+)
+{
+ _Chain_Initialize(
+ &freechain->Free,
+ initial_nodes,
+ number_nodes,
+ node_size
+ );
+}
/**
* @brief Gets a node from the freechain.