From 499492793b17b9378cbba9b19d7394dea728adeb Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 1 Apr 2014 10:01:52 +0200 Subject: score: Move __log2table to separate file --- cpukit/score/Makefile.am | 1 + cpukit/score/src/log2table.c | 43 +++++++++++++++++++++++++++++++++++++++ cpukit/score/src/prioritybitmap.c | 21 ------------------- 3 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 cpukit/score/src/log2table.c diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index e2d23a4a69..852360c9e5 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -190,6 +190,7 @@ libscore_a_SOURCES += src/objectallocate.c src/objectclose.c \ src/objectactivecount.c ## SCHEDULER_C_FILES +libscore_a_SOURCES += src/log2table.c libscore_a_SOURCES += src/prioritybitmap.c libscore_a_SOURCES += src/scheduler.c libscore_a_SOURCES += src/schedulerdefaultallocatefree.c diff --git a/cpukit/score/src/log2table.c b/cpukit/score/src/log2table.c new file mode 100644 index 0000000000..f81f82154e --- /dev/null +++ b/cpukit/score/src/log2table.c @@ -0,0 +1,43 @@ +/* + * @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.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#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/prioritybitmap.c b/cpukit/score/src/prioritybitmap.c index 28461a1806..1fda42fb0c 100644 --- a/cpukit/score/src/prioritybitmap.c +++ b/cpukit/score/src/prioritybitmap.c @@ -25,24 +25,3 @@ 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 -- cgit v1.2.3