[PATCH] rtems: Remove Modes_Control

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Nov 8 08:18:55 UTC 2018


Use rtems_mode directly.  This is in line with rtems_attribute and
rtems_option.

Update #3598.
---
 cpukit/include/rtems/rtems/asrdata.h   |  2 +-
 cpukit/include/rtems/rtems/modes.h     |  4 ++--
 cpukit/include/rtems/rtems/modesimpl.h | 26 +++++++++++++-------------
 cpukit/include/rtems/rtems/types.h     |  5 -----
 cpukit/rtems/src/modes.c               |  2 +-
 cpukit/rtems/src/signalcatch.c         |  2 +-
 testsuites/sptests/sp08/init.c         |  3 +--
 testsuites/sptests/sp47/init.c         |  3 +--
 8 files changed, 20 insertions(+), 27 deletions(-)

diff --git a/cpukit/include/rtems/rtems/asrdata.h b/cpukit/include/rtems/rtems/asrdata.h
index 1068bc2e48..8ad5a1ec57 100644
--- a/cpukit/include/rtems/rtems/asrdata.h
+++ b/cpukit/include/rtems/rtems/asrdata.h
@@ -39,7 +39,7 @@ typedef struct {
   /** This field indicates if address of the signal handler function. */
   rtems_asr_entry   handler;
   /** This field indicates if the task mode the signal will run with. */
-  Modes_Control     mode_set;
+  rtems_mode     mode_set;
   /** This field indicates the signal set that is posted. */
   rtems_signal_set  signals_posted;
   /** This field indicates the signal set that is pending. */
diff --git a/cpukit/include/rtems/rtems/modes.h b/cpukit/include/rtems/rtems/modes.h
index 547ae13e05..4c9f74edba 100644
--- a/cpukit/include/rtems/rtems/modes.h
+++ b/cpukit/include/rtems/rtems/modes.h
@@ -41,7 +41,7 @@ extern "C" {
  *  The following type defines the control block used to manage
  *  each a mode set.
  */
-typedef uint32_t   Modes_Control;
+typedef uint32_t   rtems_mode;
 
 /**
  *  The following constants define the individual modes and masks
@@ -118,7 +118,7 @@ extern const uint32_t rtems_interrupt_mask;
  * @note This variable is used by bindings from languages other than
  *       C and C++.
  */
-Modes_Control rtems_interrupt_level_body(
+rtems_mode rtems_interrupt_level_body(
   uint32_t   level
 );
 
diff --git a/cpukit/include/rtems/rtems/modesimpl.h b/cpukit/include/rtems/rtems/modesimpl.h
index 8c1acc7cb9..318cc36fd7 100644
--- a/cpukit/include/rtems/rtems/modesimpl.h
+++ b/cpukit/include/rtems/rtems/modesimpl.h
@@ -39,8 +39,8 @@ extern "C" {
  *  are set in mode_set, and FALSE otherwise.
  */
 RTEMS_INLINE_ROUTINE bool _Modes_Mask_changed (
-  Modes_Control mode_set,
-  Modes_Control masks
+  rtems_mode mode_set,
+  rtems_mode masks
 )
 {
    return ( mode_set & masks ) ? true : false;
@@ -53,7 +53,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Mask_changed (
  *  Signal Processing is disabled, and FALSE otherwise.
  */
 RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled (
-  Modes_Control mode_set
+  rtems_mode mode_set
 )
 {
    return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
@@ -66,7 +66,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled (
  *  is enabled, and FALSE otherwise.
  */
 RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
-  Modes_Control mode_set
+  rtems_mode mode_set
 )
 {
    return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
@@ -79,7 +79,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
  *  is enabled, and FALSE otherwise.
  */
 RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
-  Modes_Control mode_set
+  rtems_mode mode_set
 )
 {
   return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
@@ -91,7 +91,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
  *  This function returns the interrupt level portion of the mode_set.
  */
 RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
-  Modes_Control mode_set
+  rtems_mode mode_set
 )
 {
   return ( mode_set & RTEMS_INTERRUPT_MASK );
@@ -104,7 +104,7 @@ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
  *  in the mode_set.
  */
 RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
-  Modes_Control mode_set
+  rtems_mode mode_set
 )
 {
   _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
@@ -120,14 +120,14 @@ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
  *  is returned in changed.
  */
 RTEMS_INLINE_ROUTINE void _Modes_Change (
-  Modes_Control  old_mode_set,
-  Modes_Control  new_mode_set,
-  Modes_Control  mask,
-  Modes_Control *out_mode_set,
-  Modes_Control *changed
+  rtems_mode  old_mode_set,
+  rtems_mode  new_mode_set,
+  rtems_mode  mask,
+  rtems_mode *out_mode_set,
+  rtems_mode *changed
 )
 {
-  Modes_Control _out_mode;
+  rtems_mode _out_mode;
 
   _out_mode      =  old_mode_set;
   _out_mode     &= ~mask;
diff --git a/cpukit/include/rtems/rtems/types.h b/cpukit/include/rtems/rtems/types.h
index 874b077b79..2028c427f0 100644
--- a/cpukit/include/rtems/rtems/types.h
+++ b/cpukit/include/rtems/rtems/types.h
@@ -167,11 +167,6 @@ typedef struct {
   uint32_t   ticks;
 }   rtems_time_of_day;
 
-/**
- * @brief Task mode type.
- */
-typedef Modes_Control rtems_mode;
-
 /*
  *  MPCI related entries
  */
diff --git a/cpukit/rtems/src/modes.c b/cpukit/rtems/src/modes.c
index acc499377c..198ce29329 100644
--- a/cpukit/rtems/src/modes.c
+++ b/cpukit/rtems/src/modes.c
@@ -26,7 +26,7 @@
 
 const uint32_t rtems_interrupt_mask = RTEMS_INTERRUPT_MASK;
 
-Modes_Control rtems_interrupt_level_body(
+rtems_mode rtems_interrupt_level_body(
   uint32_t   level
 )
 {
diff --git a/cpukit/rtems/src/signalcatch.c b/cpukit/rtems/src/signalcatch.c
index 9c264b7869..435ea2fa54 100644
--- a/cpukit/rtems/src/signalcatch.c
+++ b/cpukit/rtems/src/signalcatch.c
@@ -36,7 +36,7 @@ void _Signal_Action_handler(
   RTEMS_API_Control *api;
   ASR_Information   *asr;
   rtems_signal_set   signal_set;
-  Modes_Control      prev_mode;
+  rtems_mode      prev_mode;
 
   (void) action;
 
diff --git a/testsuites/sptests/sp08/init.c b/testsuites/sptests/sp08/init.c
index 6a9ee76119..98a7fccdcf 100644
--- a/testsuites/sptests/sp08/init.c
+++ b/testsuites/sptests/sp08/init.c
@@ -20,8 +20,7 @@ const char rtems_test_name[] = "SP 8";
 /* forward declarations to avoid warnings */
 rtems_task Init(rtems_task_argument argument);
 
-#define PRIxModes_Control 	PRIx32
-#define PRIxrtems_mode		PRIxModes_Control
+#define PRIxrtems_mode 	PRIx32
 
 #define put_mode( _comment, _output_mode ) \
    printf( "%s %08" PRIxrtems_mode "\n", _comment, _output_mode );
diff --git a/testsuites/sptests/sp47/init.c b/testsuites/sptests/sp47/init.c
index ae295089af..c0503477ab 100644
--- a/testsuites/sptests/sp47/init.c
+++ b/testsuites/sptests/sp47/init.c
@@ -10,8 +10,7 @@
 
 const char rtems_test_name[] = "SP 47";
 
-#define PRIXModes_Control 	PRIX32
-#define PRIXrtems_mode		PRIXModes_Control
+#define PRIXrtems_mode 	PRIX32
 
 rtems_task test_asr(rtems_task_argument unused);
 rtems_task Init(rtems_task_argument ignored);
-- 
2.16.4



More information about the devel mailing list