From d689de0b3ce1a758d8b46fb5ea79758a3d76a9ff Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 9 Sep 2011 10:57:58 +0000 Subject: [PATCH] 2011-09-09 Sebastian Huber * score/include/rtems/score/basedefs.h: Typo. * score/src/mpci.c, rtems/src/eventmp.c, rtems/src/msgmp.c, rtems/src/partmp.c, rtems/src/regionmp.c, rtems/src/semmp.c, rtems/src/signalmp.c, rtems/src/taskmp.c: Use RTEMS_STATIC_ASSERT() to ensure that the packet size is small enough. --- cpukit/ChangeLog | 8 ++++++++ cpukit/rtems/src/eventmp.c | 5 +++++ cpukit/rtems/src/msgmp.c | 8 ++++++++ cpukit/rtems/src/partmp.c | 5 +++++ cpukit/rtems/src/regionmp.c | 5 +++++ cpukit/rtems/src/semmp.c | 5 +++++ cpukit/rtems/src/signalmp.c | 5 +++++ cpukit/rtems/src/taskmp.c | 5 +++++ cpukit/score/include/rtems/score/basedefs.h | 2 +- cpukit/score/src/mpci.c | 5 +++++ 10 files changed, 52 insertions(+), 1 deletion(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 21f72132fb..492fe7bd46 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,11 @@ +2011-09-09 Sebastian Huber + + * score/include/rtems/score/basedefs.h: Typo. + * score/src/mpci.c, rtems/src/eventmp.c, rtems/src/msgmp.c, + rtems/src/partmp.c, rtems/src/regionmp.c, rtems/src/semmp.c, + rtems/src/signalmp.c, rtems/src/taskmp.c: Use RTEMS_STATIC_ASSERT() to + ensure that the packet size is small enough. + 2011-09-02 Sebastian Huber * libmisc/monitor/mon-monitor.c: Removed "exit" and "quit" commands to diff --git a/cpukit/rtems/src/eventmp.c b/cpukit/rtems/src/eventmp.c index cfec3fffc3..f6f8d3bbfc 100644 --- a/cpukit/rtems/src/eventmp.c +++ b/cpukit/rtems/src/eventmp.c @@ -26,6 +26,11 @@ #include #include +RTEMS_STATIC_ASSERT( + sizeof(Event_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, + Event_MP_Packet +); + /* * _Event_MP_Send_process_packet * diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c index a8de383033..83a28a4598 100644 --- a/cpukit/rtems/src/msgmp.c +++ b/cpukit/rtems/src/msgmp.c @@ -27,6 +27,14 @@ #include #include +#define MESSAGE_QUEUE_MP_PACKET_SIZE \ + offsetof(Message_queue_MP_Packet, Buffer.buffer) + +RTEMS_STATIC_ASSERT( + MESSAGE_QUEUE_MP_PACKET_SIZE <= MP_PACKET_MINIMUM_PACKET_SIZE, + Message_queue_MP_Packet +); + /* * _Message_queue_MP_Send_process_packet * diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c index ffc3746798..32e246015d 100644 --- a/cpukit/rtems/src/partmp.c +++ b/cpukit/rtems/src/partmp.c @@ -26,6 +26,11 @@ #include #include +RTEMS_STATIC_ASSERT( + sizeof(Partition_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, + Partition_MP_Packet +); + /* * _Partition_MP_Send_process_packet * diff --git a/cpukit/rtems/src/regionmp.c b/cpukit/rtems/src/regionmp.c index 979e0c35da..99d0e63146 100644 --- a/cpukit/rtems/src/regionmp.c +++ b/cpukit/rtems/src/regionmp.c @@ -26,6 +26,11 @@ #include #include +RTEMS_STATIC_ASSERT( + sizeof(Region_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, + Region_MP_Packet +); + /* * _Region_MP_Send_process_packet * diff --git a/cpukit/rtems/src/semmp.c b/cpukit/rtems/src/semmp.c index 724e362e65..5962283489 100644 --- a/cpukit/rtems/src/semmp.c +++ b/cpukit/rtems/src/semmp.c @@ -27,6 +27,11 @@ #include #include +RTEMS_STATIC_ASSERT( + sizeof(Semaphore_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, + Semaphore_MP_Packet +); + /* * _Semaphore_MP_Send_process_packet * diff --git a/cpukit/rtems/src/signalmp.c b/cpukit/rtems/src/signalmp.c index 3b67520212..9b13bede3b 100644 --- a/cpukit/rtems/src/signalmp.c +++ b/cpukit/rtems/src/signalmp.c @@ -28,6 +28,11 @@ #include #include +RTEMS_STATIC_ASSERT( + sizeof(Signal_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, + Signal_MP_Packet +); + /* * _Signal_MP_Send_process_packet * diff --git a/cpukit/rtems/src/taskmp.c b/cpukit/rtems/src/taskmp.c index c1b991ca9e..14a49c78ab 100644 --- a/cpukit/rtems/src/taskmp.c +++ b/cpukit/rtems/src/taskmp.c @@ -27,6 +27,11 @@ #include #include +RTEMS_STATIC_ASSERT( + sizeof(RTEMS_tasks_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, + RTEMS_tasks_MP_Packet +); + /* * _RTEMS_tasks_MP_Send_process_packet * diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h index 086c9fd5c2..2f1c39870a 100644 --- a/cpukit/score/include/rtems/score/basedefs.h +++ b/cpukit/score/include/rtems/score/basedefs.h @@ -166,7 +166,7 @@ #endif #define RTEMS_STATIC_ASSERT(cond, msg) \ - typedef int rtems_static_assert ## msg [(cond) ? 1 : -1] + typedef int rtems_static_assert_ ## msg [(cond) ? 1 : -1] #ifndef ASM #ifdef RTEMS_DEPRECATED_TYPES diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c index 5a9c4d136c..28e5a5232c 100644 --- a/cpukit/score/src/mpci.c +++ b/cpukit/score/src/mpci.c @@ -34,6 +34,11 @@ #include #include +RTEMS_STATIC_ASSERT( + sizeof(MPCI_Internal_packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, + MPCI_Internal_packet +); + /** * This is the core semaphore which the MPCI Receive Server blocks on. */