[rtems commit] score: Remove support for RTEMS_USE_16_BIT_OBJECT

Sebastian Huber sebh at rtems.org
Wed Nov 21 07:06:44 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Nov 16 07:06:12 2018 +0100

score: Remove support for RTEMS_USE_16_BIT_OBJECT

The RTEMS_USE_16_BIT_OBJECT define is not set by an RTEMS port.  Remove
support for 16-bit object identifiers.  If someone really wants to use
RTEMS on a 16-bit target, then it is better to use self-contained
objects instead of playing around with object identifier optimizations.

Update #3603.

---

 cpukit/include/rtems/inttypes.h     |  4 ---
 cpukit/include/rtems/score/object.h | 51 ++-----------------------------------
 cpukit/libmisc/monitor/mon-driver.c |  4 ---
 cpukit/libmisc/monitor/mon-prmisc.c |  4 ---
 4 files changed, 2 insertions(+), 61 deletions(-)

diff --git a/cpukit/include/rtems/inttypes.h b/cpukit/include/rtems/inttypes.h
index a8e725d..4e6e98f 100644
--- a/cpukit/include/rtems/inttypes.h
+++ b/cpukit/include/rtems/inttypes.h
@@ -97,11 +97,7 @@ extern "C" {
  * certain system types on different targets.
  */
 
-#if defined(RTEMS_USE_16_BIT_OBJECT)
-#define PRIxrtems_id PRIx16
-#else
 #define PRIxrtems_id PRIx32
-#endif
 
 /* c.f. cpukit/score/include/rtems/score/priority.h */
 #define PRIdPriority_Control PRIu64
diff --git a/cpukit/include/rtems/score/object.h b/cpukit/include/rtems/score/object.h
index 9c2699d..e7861ec 100644
--- a/cpukit/include/rtems/score/object.h
+++ b/cpukit/include/rtems/score/object.h
@@ -61,42 +61,6 @@ typedef union {
   uint32_t    name_u32;
 } Objects_Name;
 
-#if defined(RTEMS_USE_16_BIT_OBJECT)
-/**
- *  The following type defines the control block used to manage
- *  object IDs.  The format is as follows (0=LSB):
- *
- *     Bits  0 ..  7    = index  (up to 254 objects of a type)
- *     Bits  8 .. 10    = API    (up to 7 API classes)
- *     Bits 11 .. 15    = class  (up to 31 object types per API)
- */
-typedef uint16_t   Objects_Id;
-
-/**
- * This type is used to store the maximum number of allowed objects
- * of each type.
- */
-typedef uint8_t    Objects_Maximum;
-
-#define OBJECTS_INDEX_START_BIT  0U
-#define OBJECTS_API_START_BIT    8U
-#define OBJECTS_CLASS_START_BIT 11U
-
-#define OBJECTS_INDEX_MASK      (Objects_Id)0x00ffU
-#define OBJECTS_API_MASK        (Objects_Id)0x0700U
-#define OBJECTS_CLASS_MASK      (Objects_Id)0xF800U
-
-#define OBJECTS_INDEX_VALID_BITS  (Objects_Id)0x00ffU
-#define OBJECTS_API_VALID_BITS    (Objects_Id)0x0007U
-/* OBJECTS_NODE_VALID_BITS should not be used with 16 bit Ids */
-#define OBJECTS_CLASS_VALID_BITS  (Objects_Id)0x001fU
-
-#define OBJECTS_UNLIMITED_OBJECTS 0x8000U
-
-#define OBJECTS_ID_INITIAL_INDEX  (0)
-#define OBJECTS_ID_FINAL_INDEX    (0xff)
-
-#else
 /**
  *  The following type defines the control block used to manage
  *  object IDs.  The format is as follows (0=LSB):
@@ -196,7 +160,6 @@ typedef uint16_t   Objects_Maximum;
  *  This is the highest value for the index portion of an object Id.
  */
 #define OBJECTS_ID_FINAL_INDEX    (0xffffU)
-#endif
 
 /**
  *  This enumerated type is used in the class field of the object ID.
@@ -313,15 +276,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_node(
   Objects_Id id
 )
 {
-  /*
-   * If using 16-bit Ids, then there is no node field and it MUST
-   * be a single processor system.
-   */
-  #if defined(RTEMS_USE_16_BIT_OBJECT)
-    return 1;
-  #else
-    return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS;
-  #endif
+  return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS;
 }
 
 /**
@@ -361,9 +316,7 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
 {
   return (( (Objects_Id) the_api )   << OBJECTS_API_START_BIT)   |
          (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
-         #if !defined(RTEMS_USE_16_BIT_OBJECT)
-           (( (Objects_Id) node )    << OBJECTS_NODE_START_BIT)  |
-         #endif
+         (( (Objects_Id) node )      << OBJECTS_NODE_START_BIT)  |
          (( (Objects_Id) index )     << OBJECTS_INDEX_START_BIT);
 }
 
diff --git a/cpukit/libmisc/monitor/mon-driver.c b/cpukit/libmisc/monitor/mon-driver.c
index f10b8c9..e2e95ff 100644
--- a/cpukit/libmisc/monitor/mon-driver.c
+++ b/cpukit/libmisc/monitor/mon-driver.c
@@ -107,11 +107,7 @@ rtems_monitor_driver_dump(
 {
     uint32_t            length = 0;
 
-#if defined(RTEMS_USE_16_BIT_OBJECT)
-    length += fprintf(stdout,"  %" PRId16 "", monitor_driver->id);
-#else
     length += fprintf(stdout,"  %" PRId32 "", monitor_driver->id);
-#endif
     length += rtems_monitor_pad(13, length);
     length += fprintf(stdout,"init: ");
     length += rtems_monitor_symbol_dump(&monitor_driver->initialization, verbose);
diff --git a/cpukit/libmisc/monitor/mon-prmisc.c b/cpukit/libmisc/monitor/mon-prmisc.c
index ecf17b0..97862ff 100644
--- a/cpukit/libmisc/monitor/mon-prmisc.c
+++ b/cpukit/libmisc/monitor/mon-prmisc.c
@@ -88,11 +88,7 @@ rtems_monitor_dump_assoc_bitfield(
 int
 rtems_monitor_dump_id(rtems_id id)
 {
-#if defined(RTEMS_USE_16_BIT_OBJECT)
-    return fprintf(stdout,"%08" PRIx16, id);
-#else
     return fprintf(stdout,"%08" PRIx32, id);
-#endif
 }
 
 int



More information about the vc mailing list