Cleaned up style.

This commit is contained in:
Joel Sherrill
1999-11-12 14:15:50 +00:00
parent 3ad17f56e0
commit 3c49a508aa
2 changed files with 452 additions and 460 deletions

View File

@@ -1,4 +1,6 @@
/*
* ITRON Message Buffer Manager
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
@@ -12,7 +14,8 @@
#include <rtems/itron/task.h>
ER _ITRON_Message_buffer_Translate_core_message_buffer_return_code(
CORE_message_queue_Status status)
CORE_message_queue_Status status
)
{
switch (status) {
case CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL:
@@ -67,7 +70,6 @@ void _ITRON_Message_buffer_Manager_initialization(
*
* NOTE: No MP Support YET in RTEMS ITRON implementation.
*/
}
/*
@@ -154,7 +156,6 @@ ER del_mbf(
Objects_Locations location;
the_message_buffer = _ITRON_Message_buffer_Get(mbfid, &location);
switch (location) {
case OBJECTS_REMOTE:
case OBJECTS_ERROR: /* Multiprocessing not supported */
@@ -162,10 +163,10 @@ ER del_mbf(
case OBJECTS_LOCAL:
_CORE_message_queue_Flush(&the_message_buffer->message_queue);
_ITRON_Objects_Close(
&_ITRON_Message_buffer_Information,
_ITRON_Objects_Close( &_ITRON_Message_buffer_Information,
&the_message_buffer->Object);
_ITRON_Message_buffer_Free(the_message_buffer);
/*
* If multiprocessing were supported, this is where we would announce
* the existence of the semaphore to the rest of the system.
@@ -223,11 +224,11 @@ ER psnd_mbf(
msgsz,
the_message_buffer->Object.id,
NULL,
CORE_MESSAGE_QUEUE_SEND_REQUEST);
CORE_MESSAGE_QUEUE_SEND_REQUEST
);
_Thread_Enable_dispatch();
return
_ITRON_Message_buffer_Translate_core_message_buffer_return_code(
status);
_ITRON_Message_buffer_Translate_core_message_buffer_return_code(status);
}
/*
@@ -326,14 +327,12 @@ ER trcv_mbf(
msg,
p_msgsz,
wait,
interval);
interval
);
_Thread_Enable_dispatch();
status =
(CORE_message_queue_Status)_Thread_Executing->Wait.return_code;
status = (CORE_message_queue_Status)_Thread_Executing->Wait.return_code;
return
_ITRON_Message_buffer_Translate_core_message_buffer_return_code
(status);
_ITRON_Message_buffer_Translate_core_message_buffer_return_code(status);
}
/*
@@ -357,6 +356,7 @@ ER ref_mbf(
{
ITRON_Message_buffer_Control *the_message_buffer;
Objects_Locations location;
CORE_message_queue_Control *the_core_msgq;
if ( !pk_rmbf )
return E_PAR; /* XXX check this error code */
@@ -368,20 +368,17 @@ ER ref_mbf(
return _ITRON_Message_buffer_Clarify_get_id_error( mbfid );
case OBJECTS_LOCAL:
the_core_msgq = &the_message_buffer->message_queue;
/*
* Fill in the size of message to be sent
*/
if(the_message_buffer->message_queue.
number_of_pending_messages == 0) {
if (the_core_msgq->number_of_pending_messages == 0) {
pk_rmbf->msgsz = 0;
}
else {
CORE_message_queue_Buffer_control *the_message;
the_message = (CORE_message_queue_Buffer_control*)
the_message_buffer->message_queue.
Pending_messages.first;
pk_rmbf->msgsz = the_message->Contents.size;
} else {
pk_rmbf->msgsz = ((CORE_message_queue_Buffer_control *)
the_core_msgq->Pending_messages.first)->Contents.size;
}
/*
@@ -389,17 +386,16 @@ ER ref_mbf(
*/
pk_rmbf->frbufsz =
(the_message_buffer->message_queue.maximum_pending_messages-
the_message_buffer->message_queue.number_of_pending_messages)*
the_message_buffer->message_queue.maximum_message_size;
(the_core_msgq->maximum_pending_messages -
the_core_msgq->number_of_pending_messages) *
the_core_msgq->maximum_message_size;
/*
* Fill in whether or not there is a waiting task
*/
if ( !_Thread_queue_First(
&the_message_buffer->message_queue.Wait_queue ) )
if ( !_Thread_queue_First(&the_core_msgq->Wait_queue ) )
pk_rmbf->wtsk = FALSE;
else
pk_rmbf->wtsk = TRUE;

View File

@@ -1,4 +1,6 @@
/*
* ITRON Message Buffer Manager
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
@@ -12,7 +14,8 @@
#include <rtems/itron/task.h>
ER _ITRON_Message_buffer_Translate_core_message_buffer_return_code(
CORE_message_queue_Status status)
CORE_message_queue_Status status
)
{
switch (status) {
case CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL:
@@ -67,7 +70,6 @@ void _ITRON_Message_buffer_Manager_initialization(
*
* NOTE: No MP Support YET in RTEMS ITRON implementation.
*/
}
/*
@@ -154,7 +156,6 @@ ER del_mbf(
Objects_Locations location;
the_message_buffer = _ITRON_Message_buffer_Get(mbfid, &location);
switch (location) {
case OBJECTS_REMOTE:
case OBJECTS_ERROR: /* Multiprocessing not supported */
@@ -162,10 +163,10 @@ ER del_mbf(
case OBJECTS_LOCAL:
_CORE_message_queue_Flush(&the_message_buffer->message_queue);
_ITRON_Objects_Close(
&_ITRON_Message_buffer_Information,
_ITRON_Objects_Close( &_ITRON_Message_buffer_Information,
&the_message_buffer->Object);
_ITRON_Message_buffer_Free(the_message_buffer);
/*
* If multiprocessing were supported, this is where we would announce
* the existence of the semaphore to the rest of the system.
@@ -223,11 +224,11 @@ ER psnd_mbf(
msgsz,
the_message_buffer->Object.id,
NULL,
CORE_MESSAGE_QUEUE_SEND_REQUEST);
CORE_MESSAGE_QUEUE_SEND_REQUEST
);
_Thread_Enable_dispatch();
return
_ITRON_Message_buffer_Translate_core_message_buffer_return_code(
status);
_ITRON_Message_buffer_Translate_core_message_buffer_return_code(status);
}
/*
@@ -326,14 +327,12 @@ ER trcv_mbf(
msg,
p_msgsz,
wait,
interval);
interval
);
_Thread_Enable_dispatch();
status =
(CORE_message_queue_Status)_Thread_Executing->Wait.return_code;
status = (CORE_message_queue_Status)_Thread_Executing->Wait.return_code;
return
_ITRON_Message_buffer_Translate_core_message_buffer_return_code
(status);
_ITRON_Message_buffer_Translate_core_message_buffer_return_code(status);
}
/*
@@ -357,6 +356,7 @@ ER ref_mbf(
{
ITRON_Message_buffer_Control *the_message_buffer;
Objects_Locations location;
CORE_message_queue_Control *the_core_msgq;
if ( !pk_rmbf )
return E_PAR; /* XXX check this error code */
@@ -368,20 +368,17 @@ ER ref_mbf(
return _ITRON_Message_buffer_Clarify_get_id_error( mbfid );
case OBJECTS_LOCAL:
the_core_msgq = &the_message_buffer->message_queue;
/*
* Fill in the size of message to be sent
*/
if(the_message_buffer->message_queue.
number_of_pending_messages == 0) {
if (the_core_msgq->number_of_pending_messages == 0) {
pk_rmbf->msgsz = 0;
}
else {
CORE_message_queue_Buffer_control *the_message;
the_message = (CORE_message_queue_Buffer_control*)
the_message_buffer->message_queue.
Pending_messages.first;
pk_rmbf->msgsz = the_message->Contents.size;
} else {
pk_rmbf->msgsz = ((CORE_message_queue_Buffer_control *)
the_core_msgq->Pending_messages.first)->Contents.size;
}
/*
@@ -389,17 +386,16 @@ ER ref_mbf(
*/
pk_rmbf->frbufsz =
(the_message_buffer->message_queue.maximum_pending_messages-
the_message_buffer->message_queue.number_of_pending_messages)*
the_message_buffer->message_queue.maximum_message_size;
(the_core_msgq->maximum_pending_messages -
the_core_msgq->number_of_pending_messages) *
the_core_msgq->maximum_message_size;
/*
* Fill in whether or not there is a waiting task
*/
if ( !_Thread_queue_First(
&the_message_buffer->message_queue.Wait_queue ) )
if ( !_Thread_queue_First(&the_core_msgq->Wait_queue ) )
pk_rmbf->wtsk = FALSE;
else
pk_rmbf->wtsk = TRUE;