summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-09 14:16:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-20 10:14:03 +0200
commita78e575ba58250b35787bfa19a8770c075db5e8b (patch)
tree4b17cd95ecdf7ef93552dc11fad85fe76649079a
parentscore: _Scheduler_priority_Ready_queue_first() (diff)
downloadrtems-a78e575ba58250b35787bfa19a8770c075db5e8b.tar.bz2
score: _Scheduler_priority_Ready_queue_initialize()
Move workspace allocation to _Scheduler_priority_Initialize().
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriorityimpl.h14
-rw-r--r--cpukit/score/src/schedulerpriority.c10
-rw-r--r--cpukit/score/src/schedulerpriorityallocate.c1
3 files changed, 14 insertions, 11 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
index 5983c743c3..9f45f21fcd 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
@@ -25,7 +25,6 @@
#include <rtems/score/prioritybitmapimpl.h>
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
#ifdef __cplusplus
extern "C" {
@@ -47,18 +46,13 @@ _Scheduler_priority_Get_ready_queues( void )
*
* This routine initializes @a the_ready_queue for priority-based scheduling.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_initialize(void)
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_initialize(
+ Chain_Control *ready_queues
+)
{
- size_t index;
- Chain_Control *ready_queues;
-
- /* allocate ready queue structures */
- _Scheduler.information = _Workspace_Allocate_or_fatal_error(
- ((size_t) PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control)
- );
+ size_t index;
/* initialize ready queue structures */
- ready_queues = _Scheduler_priority_Get_ready_queues();
for( index=0; index <= PRIORITY_MAXIMUM; index++)
_Chain_Initialize_empty( &ready_queues[index] );
}
diff --git a/cpukit/score/src/schedulerpriority.c b/cpukit/score/src/schedulerpriority.c
index 7314da4965..ab17063008 100644
--- a/cpukit/score/src/schedulerpriority.c
+++ b/cpukit/score/src/schedulerpriority.c
@@ -19,6 +19,7 @@
#endif
#include <rtems/score/schedulerpriorityimpl.h>
+#include <rtems/score/wkspace.h>
/* Instantiate any global variables needed by the priority scheduler */
volatile Priority_bit_map_Control _Priority_Major_bit_map;
@@ -27,6 +28,13 @@ Priority_bit_map_Control _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
void _Scheduler_priority_Initialize(void)
{
- _Scheduler_priority_Ready_queue_initialize();
+ /* allocate ready queue structures */
+ Chain_Control *ready_queues = _Workspace_Allocate_or_fatal_error(
+ ((size_t) PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control)
+ );
+
+ _Scheduler_priority_Ready_queue_initialize( ready_queues );
_Priority_bit_map_Handler_initialization();
+
+ _Scheduler.information = ready_queues;
}
diff --git a/cpukit/score/src/schedulerpriorityallocate.c b/cpukit/score/src/schedulerpriorityallocate.c
index ec0f21042d..ef6322ecc2 100644
--- a/cpukit/score/src/schedulerpriorityallocate.c
+++ b/cpukit/score/src/schedulerpriorityallocate.c
@@ -19,6 +19,7 @@
#endif
#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/thread.h>
#include <rtems/score/wkspace.h>
void *_Scheduler_priority_Allocate (