<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 24, 2020 at 7:13 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Add Message_queue_Control::is_global if RTEMS_MULTIPROCESSING is defined. This<br>
reduces the Message_queue_Control size in standard RTEMS configurations.<br>
<br>
Update #4007.<br>
---<br>
cpukit/include/rtems/rtems/messagedata.h | 6 ++++--<br>
cpukit/libmisc/monitor/mon-queue.c | 16 +++++++++++++++-<br>
cpukit/rtems/src/msgqcreate.c | 12 ++++++------<br>
cpukit/rtems/src/msgqdelete.c | 2 +-<br>
4 files changed, 26 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/cpukit/include/rtems/rtems/messagedata.h b/cpukit/include/rtems/rtems/messagedata.h<br>
index fa1f681473..8c72fba078 100644<br>
--- a/cpukit/include/rtems/rtems/messagedata.h<br>
+++ b/cpukit/include/rtems/rtems/messagedata.h<br>
@@ -40,8 +40,10 @@ typedef struct {<br>
Objects_Control Object;<br>
/** This field is the instance of the SuperCore Message Queue. */<br>
CORE_message_queue_Control message_queue;<br>
- /** This field is the attribute set as defined by the API. */<br>
- rtems_attribute attribute_set;<br>
+#if defined(RTEMS_MULTIPROCESSING)<br>
+ /** This field is true if the message queue is offered globally */<br>
+ bool is_global;<br>
+#endif<br>
} Message_queue_Control;<br>
<br>
/**<br>
diff --git a/cpukit/libmisc/monitor/mon-queue.c b/cpukit/libmisc/monitor/mon-queue.c<br>
index 9430797c6c..aadfcd3989 100644<br>
--- a/cpukit/libmisc/monitor/mon-queue.c<br>
+++ b/cpukit/libmisc/monitor/mon-queue.c<br>
@@ -16,7 +16,21 @@ rtems_monitor_queue_canonical(<br>
{<br>
const Message_queue_Control *rtems_queue = (const Message_queue_Control *) queue_void;<br>
<br>
- canonical_queue->attributes = rtems_queue->attribute_set;<br>
+ canonical_queue->attributes = 0;<br>
+<br>
+ if (<br>
+ rtems_queue->message_queue.operations<br>
+ == &_Thread_queue_Operations_priority<br>
+ ) {<br></blockquote><div><br></div><div>Why the odd formatting on this? I would think it should be:</div><div> if ( rtems_queue->message_queue.operations == </div><div> &_Thread_queue_Operations_priority ) { <br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ canonical_queue->attributes |= RTEMS_PRIORITY;<br>
+ }<br>
+<br>
+#if defined(RTEMS_MULTIPROCESSING)<br>
+ if ( rtems_queue->is_global ) {<br>
+ canonical_queue->attributes |= RTEMS_GLOBAL;<br>
+ }<br>
+#endif<br>
+<br>
canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size;<br>
canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages;<br>
canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages;<br>
diff --git a/cpukit/rtems/src/msgqcreate.c b/cpukit/rtems/src/msgqcreate.c<br>
index 79b198199e..20787f00a6 100644<br>
--- a/cpukit/rtems/src/msgqcreate.c<br>
+++ b/cpukit/rtems/src/msgqcreate.c<br>
@@ -53,11 +53,11 @@ rtems_status_code rtems_message_queue_create(<br>
return RTEMS_INVALID_ADDRESS;<br>
<br>
#if defined(RTEMS_MULTIPROCESSING)<br>
- if ( !_System_state_Is_multiprocessing ) {<br>
- attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL );<br>
+ if ( _System_state_Is_multiprocessing ) {<br>
+ is_global = _Attributes_Is_global( attribute_set );<br>
+ } else {<br>
+ is_global = false;<br>
}<br>
-<br>
- is_global = _Attributes_Is_global( attribute_set );<br>
#endif<br>
<br>
if ( count == 0 )<br>
@@ -99,9 +99,9 @@ rtems_status_code rtems_message_queue_create(<br>
_Objects_Allocator_unlock();<br>
return RTEMS_TOO_MANY;<br>
}<br>
-#endif<br>
<br>
- the_message_queue->attribute_set = attribute_set;<br>
+ the_message_queue->is_global = is_global;<br>
+#endif<br>
<br>
if (_Attributes_Is_priority( attribute_set ) )<br>
discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY;<br>
diff --git a/cpukit/rtems/src/msgqdelete.c b/cpukit/rtems/src/msgqdelete.c<br>
index 791f96e676..e1d57addc9 100644<br>
--- a/cpukit/rtems/src/msgqdelete.c<br>
+++ b/cpukit/rtems/src/msgqdelete.c<br>
@@ -60,7 +60,7 @@ rtems_status_code rtems_message_queue_delete(<br>
);<br>
<br>
#if defined(RTEMS_MULTIPROCESSING)<br>
- if ( _Attributes_Is_global( the_message_queue->attribute_set ) ) {<br>
+ if ( the_message_queue->is_global ) {<br>
_Objects_MP_Close(<br>
&_Message_queue_Information,<br>
the_message_queue->Object.id<br>
-- <br>
2.26.2<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>