[rtems commit] score: Move __log2table to separate file

Sebastian Huber sebh at rtems.org
Tue Apr 1 12:03:56 UTC 2014


Module:    rtems
Branch:    master
Commit:    499492793b17b9378cbba9b19d7394dea728adeb
Changeset: http://git.rtems.org/rtems/commit/?id=499492793b17b9378cbba9b19d7394dea728adeb

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Apr  1 10:01:52 2014 +0200

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(-)

diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index e2d23a4..852360c 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 0000000..f81f821
--- /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 <rtems/score/prioritybitmapimpl.h>
+
+#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 28461a1..1fda42f 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




More information about the vc mailing list