[rtems-central commit] spec: Fix message queue construct

Sebastian Huber sebh at rtems.org
Fri Mar 5 09:36:06 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    9dab58fcef9d93976f13e79be44d320ad0586fe0
Changeset: http://git.rtems.org/rtems-central/commit/?id=9dab58fcef9d93976f13e79be44d320ad0586fe0

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar  4 07:33:50 2021 +0100

spec: Fix message queue construct

---

 spec/rtems/message/req/construct-errors.yml | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/spec/rtems/message/req/construct-errors.yml b/spec/rtems/message/req/construct-errors.yml
index c4c5d75..19e7b40 100644
--- a/spec/rtems/message/req/construct-errors.yml
+++ b/spec/rtems/message/req/construct-errors.yml
@@ -148,7 +148,18 @@ pre-conditions:
   states:
   - name: Valid
     test-code: |
-      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;
+      }
     text: |
       The maximum message size of the message queue configuration shall be
       valid.



More information about the vc mailing list