diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-09 14:31:02 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-20 10:14:03 +0200 |
commit | c1a356e9f8895584f5c99c1c020a279e69a1f7e4 (patch) | |
tree | 5630654d0663dae0247adab44d2f1f93f7bf68c0 | |
parent | score: _Scheduler_priority_Ready_queue_initialize() (diff) | |
download | rtems-c1a356e9f8895584f5c99c1c020a279e69a1f7e4.tar.bz2 |
score: _Priority_bit_map_Handler_initialization()
Delete _Priority_bit_map_Handler_initialization() and rely on BSS
initialization. Move definition of _Priority_Major_bit_map and
_Priority_Bit_map to separate file. Move definition of __log2table also
to this file.
-rw-r--r-- | cpukit/sapi/src/exinit.c | 2 | ||||
-rw-r--r-- | cpukit/score/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/prioritybitmapimpl.h | 35 | ||||
-rw-r--r-- | cpukit/score/src/prioritybitmap.c | 48 | ||||
-rw-r--r-- | cpukit/score/src/schedulerpriority.c | 6 |
5 files changed, 50 insertions, 42 deletions
diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c index bfcfa7ce40..10c1559936 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -45,7 +45,6 @@ #include <rtems/score/interr.h> #include <rtems/score/isr.h> #include <rtems/score/priority.h> -#include <rtems/score/prioritybitmapimpl.h> #include <rtems/score/schedulerimpl.h> #include <rtems/score/threadimpl.h> #include <rtems/score/todimpl.h> @@ -128,7 +127,6 @@ void rtems_initialize_data_structures(void) _API_Mutex_Initialization( 1 ); _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); - _Priority_bit_map_Handler_initialization(); _Watchdog_Handler_initialization(); _TOD_Handler_initialization(); diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index a725ffcba1..c6954f62ec 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -178,6 +178,7 @@ libscore_a_SOURCES += src/objectallocate.c src/objectclose.c \ src/objectactivecount.c ## SCHEDULER_C_FILES +libscore_a_SOURCES += src/prioritybitmap.c libscore_a_SOURCES += src/scheduler.c libscore_a_SOURCES += src/schedulerdefaultallocatefree.c libscore_a_SOURCES += src/schedulerdefaultreleasejob.c diff --git a/cpukit/score/include/rtems/score/prioritybitmapimpl.h b/cpukit/score/include/rtems/score/prioritybitmapimpl.h index e2db0341d1..27be57e778 100644 --- a/cpukit/score/include/rtems/score/prioritybitmapimpl.h +++ b/cpukit/score/include/rtems/score/prioritybitmapimpl.h @@ -20,6 +20,7 @@ #define _RTEMS_SCORE_PRIORITYBITMAPIMPL_H #include <rtems/score/prioritybitmap.h> +#include <rtems/score/priority.h> #ifdef __cplusplus extern "C" { @@ -57,28 +58,7 @@ extern Priority_bit_map_Control * a highly optimized bit scan without the use of special CPU * instructions. */ -#ifndef SCORE_INIT extern const unsigned char __log2table[256]; -#else -const unsigned char __log2table[256] = { - 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; -#endif #endif @@ -218,19 +198,6 @@ RTEMS_INLINE_ROUTINE uint32_t _Priority_Bits_index ( extern Priority_bit_map_Control _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT; /** - * This routine performs the initialization necessary for this handler. - */ - -RTEMS_INLINE_ROUTINE void _Priority_bit_map_Handler_initialization( void ) -{ - int index; - - _Priority_Major_bit_map = 0; - for ( index=0 ; index <16 ; index++ ) - _Priority_Bit_map[ index ] = 0; -} - -/** * This routine uses the_priority_map to update the priority * bit maps to indicate that a thread has been readied. */ diff --git a/cpukit/score/src/prioritybitmap.c b/cpukit/score/src/prioritybitmap.c new file mode 100644 index 0000000000..f0e79d80eb --- /dev/null +++ b/cpukit/score/src/prioritybitmap.c @@ -0,0 +1,48 @@ +/* + * @file + * + * @brief Priority Bit Map Implementation + * + * @ingroup ScorePriorityBitmap + */ + +/* + * Copyright (C) 2010 Gedare Bloom. + * Copyright (C) 2011 On-Line Applications Research Corporation (OAR). + * + * 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. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems/score/prioritybitmapimpl.h> + +Priority_bit_map_Control _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT; + +/* Instantiate any global variables needed by the priority scheduler */ +volatile Priority_bit_map_Control _Priority_Major_bit_map; + +#if ( CPU_USE_GENERIC_BITFIELD_DATA == TRUE ) +const unsigned char __log2table[256] = { + 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif diff --git a/cpukit/score/src/schedulerpriority.c b/cpukit/score/src/schedulerpriority.c index ab17063008..e36a44b300 100644 --- a/cpukit/score/src/schedulerpriority.c +++ b/cpukit/score/src/schedulerpriority.c @@ -21,11 +21,6 @@ #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; - -Priority_bit_map_Control _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT; - void _Scheduler_priority_Initialize(void) { /* allocate ready queue structures */ @@ -34,7 +29,6 @@ void _Scheduler_priority_Initialize(void) ); _Scheduler_priority_Ready_queue_initialize( ready_queues ); - _Priority_bit_map_Handler_initialization(); _Scheduler.information = ready_queues; } |