forked from Imagelibrary/rtems
rtems: Remove Message_queue_Control::attribute_set
Add Message_queue_Control::is_global if RTEMS_MULTIPROCESSING is defined. This reduces the Message_queue_Control size in standard RTEMS configurations. Update #4007.
This commit is contained in:
@@ -40,8 +40,10 @@ typedef struct {
|
|||||||
Objects_Control Object;
|
Objects_Control Object;
|
||||||
/** This field is the instance of the SuperCore Message Queue. */
|
/** This field is the instance of the SuperCore Message Queue. */
|
||||||
CORE_message_queue_Control message_queue;
|
CORE_message_queue_Control message_queue;
|
||||||
/** This field is the attribute set as defined by the API. */
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
rtems_attribute attribute_set;
|
/** This field is true if the message queue is offered globally */
|
||||||
|
bool is_global;
|
||||||
|
#endif
|
||||||
} Message_queue_Control;
|
} Message_queue_Control;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,7 +16,21 @@ rtems_monitor_queue_canonical(
|
|||||||
{
|
{
|
||||||
const Message_queue_Control *rtems_queue = (const Message_queue_Control *) queue_void;
|
const Message_queue_Control *rtems_queue = (const Message_queue_Control *) queue_void;
|
||||||
|
|
||||||
canonical_queue->attributes = rtems_queue->attribute_set;
|
canonical_queue->attributes = 0;
|
||||||
|
|
||||||
|
if (
|
||||||
|
rtems_queue->message_queue.operations
|
||||||
|
== &_Thread_queue_Operations_priority
|
||||||
|
) {
|
||||||
|
canonical_queue->attributes |= RTEMS_PRIORITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
|
if ( rtems_queue->is_global ) {
|
||||||
|
canonical_queue->attributes |= RTEMS_GLOBAL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size;
|
canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size;
|
||||||
canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages;
|
canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages;
|
||||||
canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages;
|
canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages;
|
||||||
|
|||||||
@@ -53,11 +53,11 @@ rtems_status_code rtems_message_queue_create(
|
|||||||
return RTEMS_INVALID_ADDRESS;
|
return RTEMS_INVALID_ADDRESS;
|
||||||
|
|
||||||
#if defined(RTEMS_MULTIPROCESSING)
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
if ( !_System_state_Is_multiprocessing ) {
|
if ( _System_state_Is_multiprocessing ) {
|
||||||
attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL );
|
|
||||||
}
|
|
||||||
|
|
||||||
is_global = _Attributes_Is_global( attribute_set );
|
is_global = _Attributes_Is_global( attribute_set );
|
||||||
|
} else {
|
||||||
|
is_global = false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( count == 0 )
|
if ( count == 0 )
|
||||||
@@ -99,9 +99,9 @@ rtems_status_code rtems_message_queue_create(
|
|||||||
_Objects_Allocator_unlock();
|
_Objects_Allocator_unlock();
|
||||||
return RTEMS_TOO_MANY;
|
return RTEMS_TOO_MANY;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
the_message_queue->attribute_set = attribute_set;
|
the_message_queue->is_global = is_global;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (_Attributes_Is_priority( attribute_set ) )
|
if (_Attributes_Is_priority( attribute_set ) )
|
||||||
discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY;
|
discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ rtems_status_code rtems_message_queue_delete(
|
|||||||
);
|
);
|
||||||
|
|
||||||
#if defined(RTEMS_MULTIPROCESSING)
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
if ( _Attributes_Is_global( the_message_queue->attribute_set ) ) {
|
if ( the_message_queue->is_global ) {
|
||||||
_Objects_MP_Close(
|
_Objects_MP_Close(
|
||||||
&_Message_queue_Information,
|
&_Message_queue_Information,
|
||||||
the_message_queue->Object.id
|
the_message_queue->Object.id
|
||||||
|
|||||||
Reference in New Issue
Block a user