summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-07-17 10:19:16 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-07-17 10:19:16 +0200
commit317ee8d7ffd4bb6c785f7a7d8a84ccd7f873513f (patch)
treef51362b3092abb782995f9c9d59e0252a660d3ac /cpukit/rtems
parentFix broken _endtext symbol (diff)
downloadrtems-317ee8d7ffd4bb6c785f7a7d8a84ccd7f873513f.tar.bz2
score: Change greedy allocation API
Diffstat (limited to '')
-rw-r--r--cpukit/rtems/include/rtems/rtems/support.h10
-rw-r--r--cpukit/rtems/src/workspacegreedy.c7
2 files changed, 12 insertions, 5 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/support.h b/cpukit/rtems/include/rtems/rtems/support.h
index bdabc59e8b..b2c6471c31 100644
--- a/cpukit/rtems/include/rtems/rtems/support.h
+++ b/cpukit/rtems/include/rtems/rtems/support.h
@@ -102,12 +102,16 @@ bool rtems_workspace_free(
/**
* @brief Greedy allocate that empties the workspace.
*
- * Afterward the workspace has at most @a remaining_free_space free space left
- * in one free block. All other blocks are used.
+ * Afterward the heap has at most @a block_count allocateable blocks of sizes
+ * specified by @a block_sizes. The @a block_sizes must point to an array with
+ * @a block_count members. All other blocks are used.
*
* @see rtems_workspace_greedy_free().
*/
-void *rtems_workspace_greedy_allocate( size_t remaining_free_space );
+void *rtems_workspace_greedy_allocate(
+ const uintptr_t *block_sizes,
+ size_t block_count
+);
/**
* @brief Frees space of a greedy allocation.
diff --git a/cpukit/rtems/src/workspacegreedy.c b/cpukit/rtems/src/workspacegreedy.c
index 6d8fd9b937..03781412b2 100644
--- a/cpukit/rtems/src/workspacegreedy.c
+++ b/cpukit/rtems/src/workspacegreedy.c
@@ -19,12 +19,15 @@
#include <rtems/rtems/support.h>
#include <rtems/score/wkspace.h>
-void *rtems_workspace_greedy_allocate( size_t remaining_free_space )
+void *rtems_workspace_greedy_allocate(
+ const uintptr_t *block_sizes,
+ size_t block_count
+)
{
void *opaque;
_Thread_Disable_dispatch();
- opaque = _Heap_Greedy_allocate( &_Workspace_Area, remaining_free_space );
+ opaque = _Heap_Greedy_allocate( &_Workspace_Area, block_sizes, block_count );
_Thread_Enable_dispatch();
return opaque;