[rtems commit] score: Relax <sys/lock.h> static assertions

Sebastian Huber sebh at rtems.org
Fri Dec 23 12:55:23 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec 23 13:54:11 2016 +0100

score: Relax <sys/lock.h> static assertions

Only require that the Newlib defined structure is big enough.

---

 cpukit/score/src/condition.c | 2 +-
 cpukit/score/src/futex.c     | 2 +-
 cpukit/score/src/mutex.c     | 8 ++++----
 cpukit/score/src/semaphore.c | 4 ++--
 cpukit/score/src/threadq.c   | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/cpukit/score/src/condition.c b/cpukit/score/src/condition.c
index ea36316..cf92914 100644
--- a/cpukit/score/src/condition.c
+++ b/cpukit/score/src/condition.c
@@ -41,7 +41,7 @@ RTEMS_STATIC_ASSERT(
 );
 
 RTEMS_STATIC_ASSERT(
-  sizeof( Condition_Control ) == sizeof( struct _Condition_Control ),
+  sizeof( Condition_Control ) <= sizeof( struct _Condition_Control ),
   CONDITION_CONTROL_SIZE
 );
 
diff --git a/cpukit/score/src/futex.c b/cpukit/score/src/futex.c
index f200895..ea4cc89 100644
--- a/cpukit/score/src/futex.c
+++ b/cpukit/score/src/futex.c
@@ -39,7 +39,7 @@ RTEMS_STATIC_ASSERT(
 );
 
 RTEMS_STATIC_ASSERT(
-  sizeof( Futex_Control ) == sizeof( struct _Futex_Control ),
+  sizeof( Futex_Control ) <= sizeof( struct _Futex_Control ),
   FUTEX_CONTROL_SIZE
 );
 
diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c
index edd2e41..30fba4e 100644
--- a/cpukit/score/src/mutex.c
+++ b/cpukit/score/src/mutex.c
@@ -39,7 +39,7 @@ RTEMS_STATIC_ASSERT(
 );
 
 RTEMS_STATIC_ASSERT(
-  sizeof( Mutex_Control ) == sizeof( struct _Mutex_Control ),
+  sizeof( Mutex_Control ) <= sizeof( struct _Mutex_Control ),
   MUTEX_CONTROL_SIZE
 );
 
@@ -50,19 +50,19 @@ typedef struct {
 
 RTEMS_STATIC_ASSERT(
   offsetof( Mutex_recursive_Control, Mutex )
-    == offsetof( struct _Mutex_recursive_Control, _Mutex ),
+    <= offsetof( struct _Mutex_recursive_Control, _Mutex ),
   MUTEX_RECURSIVE_CONTROL_MUTEX
 );
 
 RTEMS_STATIC_ASSERT(
   offsetof( Mutex_recursive_Control, nest_level )
-    == offsetof( struct _Mutex_recursive_Control, _nest_level ),
+    <= offsetof( struct _Mutex_recursive_Control, _nest_level ),
   MUTEX_RECURSIVE_CONTROL_NEST_LEVEL
 );
 
 RTEMS_STATIC_ASSERT(
   sizeof( Mutex_recursive_Control )
-    == sizeof( struct _Mutex_recursive_Control ),
+    <= sizeof( struct _Mutex_recursive_Control ),
   MUTEX_RECURSIVE_CONTROL_SIZE
 );
 
diff --git a/cpukit/score/src/semaphore.c b/cpukit/score/src/semaphore.c
index df33532..7619147 100644
--- a/cpukit/score/src/semaphore.c
+++ b/cpukit/score/src/semaphore.c
@@ -39,12 +39,12 @@ RTEMS_STATIC_ASSERT(
 
 RTEMS_STATIC_ASSERT(
   offsetof( Semaphore_Control, count )
-    == offsetof( struct _Semaphore_Control, _count ),
+    <= offsetof( struct _Semaphore_Control, _count ),
   SEMAPHORE_CONTROL_COUNT
 );
 
 RTEMS_STATIC_ASSERT(
-  sizeof( Semaphore_Control ) == sizeof( struct _Semaphore_Control ),
+  sizeof( Semaphore_Control ) <= sizeof( struct _Semaphore_Control ),
   SEMAPHORE_CONTROL_SIZE
 );
 
diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c
index c200079..d427431 100644
--- a/cpukit/score/src/threadq.c
+++ b/cpukit/score/src/threadq.c
@@ -58,7 +58,7 @@ RTEMS_STATIC_ASSERT(
 
 RTEMS_STATIC_ASSERT(
   sizeof( Thread_queue_Syslock_queue )
-    == sizeof( struct _Thread_queue_Queue ),
+    <= sizeof( struct _Thread_queue_Queue ),
   THREAD_QUEUE_SYSLOCK_QUEUE_SIZE
 );
 



More information about the vc mailing list