[PATCH] validation: Fix for 64-bit targets

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Mar 3 09:28:45 UTC 2021


---
 testsuites/validation/tc-message-construct-errors.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/testsuites/validation/tc-message-construct-errors.c b/testsuites/validation/tc-message-construct-errors.c
index e1b36091b4..0a98a52f43 100644
--- a/testsuites/validation/tc-message-construct-errors.c
+++ b/testsuites/validation/tc-message-construct-errors.c
@@ -358,7 +358,18 @@ static void RtemsMessageReqConstructErrors_Pre_MaxSize_Prepare(
        * The maximum message size of the message queue configuration shall be
        * valid.
        */
-      ctx->config.maximum_message_size = MAX_MESSAGE_SIZE;
+      if ( ctx->config.maximum_pending_messages == UINT32_MAX ) {
+        /*
+         * At least on 64-bit systems we need a bit of help to ensure that we
+         * meet the Big state of the MaxPending pre-condition.  The following
+         * message size is valid with respect to calculations involving only
+         * the message size.
+         */
+        ctx->config.maximum_message_size = SIZE_MAX - sizeof( uintptr_t ) +
+          1 - sizeof( CORE_message_queue_Buffer );
+      } else {
+        ctx->config.maximum_message_size = MAX_MESSAGE_SIZE;
+      }
       break;
     }
 
-- 
2.26.2



More information about the devel mailing list