forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -217,19 +197,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.
|
||||
|
||||
48
cpukit/score/src/prioritybitmap.c
Normal file
48
cpukit/score/src/prioritybitmap.c
Normal file
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user