summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-05 13:32:39 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-05 13:32:39 +0000
commitf773c0122a4412a8846764a35cccb241efa034c2 (patch)
treed5e623ff112535491866477204be4c207a07c301 /cpukit/score/include
parent2008-08-04 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-f773c0122a4412a8846764a35cccb241efa034c2.tar.bz2
2008-08-04 Sebastian Huber <sebastian.huber@embedded-brains.de>
* rtems/include/rtems/rtems/sem.h, rtems/src/semobtain.c: Changed option set type to rtems_option. * score/src/objectgetinfo.c: Check return value of _Objects_API_maximum_class(). * libmisc/monitor/mon-mpci.c, libmisc/monitor/monitor.h, rtems/include/rtems/rtems/message.h, rtems/src/msgmp.c, rtems/src/msgqallocate.c, rtems/src/msgqbroadcast.c, rtems/src/msgqcreate.c, rtems/src/msgqreceive.c, rtems/src/msgqsend.c, rtems/src/msgqurgent.c, score/include/rtems/score/coremsg.h, score/include/rtems/score/mpci.h, score/include/rtems/score/thread.h, score/inline/rtems/score/coremsg.inl, score/src/coremsg.c, score/src/coremsgbroadcast.c, score/src/coremsgseize.c, score/src/coremsgsubmit.c: Removed parameters of _Message_queue_Allocate(). Changed option set type to rtems_option. Changed type of maximum message and packet size to size_t. Changed the input buffer type for message send functions to "const void *". Changed the pointer to the second return argument in the thread wait information to a union. This union can contain a pointer to an immutable or a mutable object. This is somewhat fragile. An alternative would be to add a third pointer for immutable objects, but this would increase the structure size.
Diffstat (limited to 'cpukit/score/include')
-rw-r--r--cpukit/score/include/rtems/score/coremsg.h10
-rw-r--r--cpukit/score/include/rtems/score/mpci.h2
-rw-r--r--cpukit/score/include/rtems/score/thread.h22
3 files changed, 25 insertions, 9 deletions
diff --git a/cpukit/score/include/rtems/score/coremsg.h b/cpukit/score/include/rtems/score/coremsg.h
index c35574f3fc..f34eecee50 100644
--- a/cpukit/score/include/rtems/score/coremsg.h
+++ b/cpukit/score/include/rtems/score/coremsg.h
@@ -201,7 +201,7 @@ typedef struct {
/** This is the size in bytes of the largest message which may be
* sent via this queue.
*/
- uint32_t maximum_message_size;
+ size_t maximum_message_size;
/** This chain is the set of pending messages. It may be ordered by
* message priority or in FIFO order.
*/
@@ -244,7 +244,7 @@ boolean _CORE_message_queue_Initialize(
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Attributes *the_message_queue_attributes,
uint32_t maximum_pending_messages,
- uint32_t maximum_message_size
+ size_t maximum_message_size
);
/**
@@ -326,7 +326,7 @@ void _CORE_message_queue_Flush_waiting_threads(
*/
CORE_message_queue_Status _CORE_message_queue_Broadcast(
CORE_message_queue_Control *the_message_queue,
- void *buffer,
+ const void *buffer,
size_t size,
Objects_Id id,
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
@@ -360,7 +360,7 @@ CORE_message_queue_Status _CORE_message_queue_Broadcast(
*/
CORE_message_queue_Status _CORE_message_queue_Submit(
CORE_message_queue_Control *the_message_queue,
- void *buffer,
+ const void *buffer,
size_t size,
Objects_Id id,
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
@@ -396,7 +396,7 @@ void _CORE_message_queue_Seize(
CORE_message_queue_Control *the_message_queue,
Objects_Id id,
void *buffer,
- size_t *size,
+ size_t *size_p,
boolean wait,
Watchdog_Interval timeout
);
diff --git a/cpukit/score/include/rtems/score/mpci.h b/cpukit/score/include/rtems/score/mpci.h
index 424875fc8e..09e2aea52c 100644
--- a/cpukit/score/include/rtems/score/mpci.h
+++ b/cpukit/score/include/rtems/score/mpci.h
@@ -122,7 +122,7 @@ typedef struct {
* MPCI layer. This size places a limit on the size of a message
* which can be transmitted over this interface.
**/
- uint32_t maximum_packet_size;
+ size_t maximum_packet_size;
/** This field points to the MPCI initialization entry point. */
MPCI_initialization_entry initialization;
/** This field points to the MPCI get packet entry point. */
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 6057cec5c7..5539dc29e2 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -209,6 +209,21 @@ typedef struct {
*/
#define THREAD_STATUS_PROXY_BLOCKING 0x1111111
+/**
+ * @brief Union type to hold a pointer to an immutable or a mutable object.
+ *
+ * The main purpose is to enable passing of pointers to read-only send buffers
+ * in the message passing subsystem. This approach is somewhat fragile since
+ * it prevents the compiler to check if the operations on objects are valid
+ * with respect to the constant qualifier. An alternative would be to add a
+ * third pointer argument for immutable objects, but this would increase the
+ * structure size.
+ */
+typedef union {
+ void *mutable_object;
+ const void *immutable_object;
+} Thread_Wait_information_Object_argument_type;
+
/** @brief Thread Blocking Management Information
*
* This contains the information required to manage a thread while it is
@@ -219,10 +234,11 @@ typedef struct {
Objects_Id id;
/** This field is used to return an integer while when blocked. */
uint32_t count;
- /** This field is the first pointer to a user return argument. */
+ /** This field is for a pointer to a user return argument. */
void *return_argument;
- /** This field is the second pointer to a user return argument. */
- void *return_argument_1;
+ /** This field is for a pointer to a second user return argument. */
+ Thread_Wait_information_Object_argument_type
+ return_argument_second;
/** This field contains any options in effect on this blocking operation. */
uint32_t option;
/** This field will contain the return status from a blocking operation.