summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/posix/include/rtems/posix/condimpl.h133
-rw-r--r--cpukit/posix/include/rtems/posix/config.h112
-rw-r--r--cpukit/posix/include/rtems/posix/key.h2
-rw-r--r--cpukit/posix/include/rtems/posix/mqueueimpl.h267
-rw-r--r--cpukit/posix/include/rtems/posix/muteximpl.h152
-rw-r--r--cpukit/posix/include/rtems/posix/psignalimpl.h4
-rw-r--r--cpukit/posix/include/rtems/posix/ptimer.h45
-rw-r--r--cpukit/posix/include/rtems/posix/semaphoreimpl.h117
-rw-r--r--cpukit/posix/include/rtems/posix/timerimpl.h58
-rw-r--r--cpukit/posix/src/alarm.c21
-rw-r--r--cpukit/posix/src/condwaitsupp.c12
-rw-r--r--cpukit/posix/src/pbarrier.c23
-rw-r--r--cpukit/posix/src/pspin.c23
-rw-r--r--cpukit/posix/src/pthread.c10
-rw-r--r--cpukit/rtems/src/signalcatch.c1
15 files changed, 391 insertions, 589 deletions
diff --git a/cpukit/posix/include/rtems/posix/condimpl.h b/cpukit/posix/include/rtems/posix/condimpl.h
index 029ff48b88..def0f3eddb 100644
--- a/cpukit/posix/include/rtems/posix/condimpl.h
+++ b/cpukit/posix/include/rtems/posix/condimpl.h
@@ -1,12 +1,12 @@
/**
- * @file rtems/posix/cond.inl
+ * @file
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX condition variables.
*/
/*
- * COPYRIGHT (c) 1989-2011.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -25,67 +25,61 @@
extern "C" {
#endif
-/*
+/**
* Constant to indicate condition variable does not currently have
* a mutex assigned to it.
*/
-
#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
-/*
+/**
* The following defines the information control block used to manage
* this class of objects.
*/
-
POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information;
-/*
+/**
* The default condition variable attributes structure.
*/
-
extern const pthread_condattr_t _POSIX_Condition_variables_Default_attributes;
-/*
- * @brief Initialization Necessary for this Manager
- *
- * _POSIX_Condition_variables_Manager_initialization
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Condition Variable Manager Initialization
*
* This routine performs the initialization necessary for this manager.
*/
-
void _POSIX_Condition_variables_Manager_initialization(void);
-/*
- * _POSIX_Condition_variables_Allocate
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Condition Variable Allocate
*
* This function allocates a condition variable control block from
* the inactive chain of free condition variable control blocks.
*/
-
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
- _POSIX_Condition_variables_Allocate( void );
+ _POSIX_Condition_variables_Allocate( void )
+{
+ return (POSIX_Condition_variables_Control *)
+ _Objects_Allocate( &_POSIX_Condition_variables_Information );
+}
-/*
- * _POSIX_Condition_variables_Free
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Condition Variable Free
*
* This routine frees a condition variable control block to the
* inactive chain of free condition variable control blocks.
*/
-
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
POSIX_Condition_variables_Control *the_condition_variable
-);
+)
+{
+ _Objects_Free(
+ &_POSIX_Condition_variables_Information,
+ &the_condition_variable->Object
+ );
+}
-/*
- * _POSIX_Condition_variables_Get
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Condition Variable Get
*
* This function maps condition variable IDs to condition variable control
* blocks. If ID corresponds to a local condition variable, then it returns
@@ -95,32 +89,28 @@ RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
* and the_condition variable is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_condition variable is undefined.
*/
-
-#if 0
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
- Objects_Id *id,
+POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
+ pthread_cond_t *cond,
Objects_Locations *location
);
-#endif
-/*
- * _POSIX_Condition_variables_Is_null
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Condition Variable Is NULL
*
- * This function returns TRUE if the_condition variable is NULL
+ * This function returns TRUE if @a the_condition variable is NULL
* and FALSE otherwise.
*/
-
RTEMS_INLINE_ROUTINE bool _POSIX_Condition_variables_Is_null (
POSIX_Condition_variables_Control *the_condition_variable
-);
+)
+{
+ return !the_condition_variable;
+}
+
/**
* @brief Implements wake up version of the "signal" operation.
*
- * DESCRIPTION:
- *
* A support routine which implements guts of the broadcast and single task
* wake up version of the "signal" operation.
*/
@@ -132,8 +122,6 @@ int _POSIX_Condition_variables_Signal_support(
/**
* @brief POSIX condition variables wait support.
*
- * DESCRIPTION:
- *
* A support routine which implements guts of the blocking, non-blocking, and
* timed wait version of condition variable wait routines.
*/
@@ -144,57 +132,6 @@ int _POSIX_Condition_variables_Wait_support(
bool already_timedout
);
-/*
- * _POSIX_Condition_variables_Get
- *
- * DESCRIPTION:
- *
- * A support routine which translates the condition variable id into
- * a local pointer. As a side-effect, it may create the condition
- * variable.
- */
-
-POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
- pthread_cond_t *cond,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Condition_variables_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
- *_POSIX_Condition_variables_Allocate( void )
-{
- return (POSIX_Condition_variables_Control *)
- _Objects_Allocate( &_POSIX_Condition_variables_Information );
-}
-
-/*
- * _POSIX_Condition_variables_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
- POSIX_Condition_variables_Control *the_condition_variable
-)
-{
- _Objects_Free(
- &_POSIX_Condition_variables_Information,
- &the_condition_variable->Object
- );
-}
-
-/*
- * _POSIX_Condition_variables_Is_null
- */
-
-RTEMS_INLINE_ROUTINE bool _POSIX_Condition_variables_Is_null (
- POSIX_Condition_variables_Control *the_condition_variable
-)
-{
- return !the_condition_variable;
-}
-
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/posix/include/rtems/posix/config.h b/cpukit/posix/include/rtems/posix/config.h
index a842f7a453..83bd1def58 100644
--- a/cpukit/posix/include/rtems/posix/config.h
+++ b/cpukit/posix/include/rtems/posix/config.h
@@ -8,7 +8,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -25,42 +25,133 @@
extern "C" {
#endif
-/*
- * XXX
+/**
+ * @defgroup ClassicConfig Configuration
*
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
+ * @ingroup ClassicRTEMS
*
- * + required number of each object type
+ * This encapsulates functionality related to the application's configuration
+ * of the Classic API including the maximum number of each class of objects.
*/
+/**@{*/
-/*
+/**
* For now, we are only allowing the user to specify the entry point
* and stack size for POSIX initialization threads.
*/
-
typedef struct {
+ /** This is the entry point for a POSIX initialization thread. */
void *(*thread_entry)(void *);
+ /** This is the stack size for a POSIX initialization thread. */
int stack_size;
} posix_initialization_threads_table;
+/**
+ * The following records define the POSIX Configuration Table.
+ * The information contained in this table is required in all
+ * RTEMS systems which include POSIX threads support, whether
+ * single or multiprocessor. This table primarily defines the
+ * following:
+ *
+ * + required number of each object type
+ */
typedef struct {
+ /**
+ * This field contains the maximum number of POSIX API
+ * threads which are configured for this application.
+ */
uint32_t maximum_threads;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * mutexes which are configured for this application.
+ */
uint32_t maximum_mutexes;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * condition variables which are configured for this application.
+ */
uint32_t maximum_condition_variables;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * keys which are configured for this application.
+ */
uint32_t maximum_keys;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * key value pairs which are configured for this application.
+ *
+ * @note There can be potentially be a key/value pair for
+ * every thread to use every key. But normally this
+ * many are not needed in a system.
+ */
uint32_t maximum_key_value_pairs;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * timers which are configured for this application.
+ */
uint32_t maximum_timers;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * queued signals which are configured for this application.
+ */
uint32_t maximum_queued_signals;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * message queues which are configured for this application.
+ */
uint32_t maximum_message_queues;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * message queue file descriptors which are configured
+ * for this application.
+ *
+ * @note There can be one or more file descriptors used with
+ * each message queue. This value should be greater than
+ * or equal to the number of message queues.
+ */
uint32_t maximum_message_queue_descriptors;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * semaphores which are configured for this application.
+ */
uint32_t maximum_semaphores;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * barriers which are configured for this application.
+ */
uint32_t maximum_barriers;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * read/write locks which are configured for this application.
+ */
uint32_t maximum_rwlocks;
+
+ /**
+ * This field contains the maximum number of POSIX API
+ * spinlocks which are configured for this application.
+ */
uint32_t maximum_spinlocks;
+
+ /**
+ * This field contains the number of POSIX API Initialization
+ * threads listed in @a User_initialization_thread_table.
+ */
uint32_t number_of_initialization_threads;
+
+ /**
+ * This field contains the list of POSIX API Initialization threads.
+ */
posix_initialization_threads_table *User_initialization_threads_table;
} posix_api_configuration_table;
@@ -72,6 +163,7 @@ typedef struct {
*/
extern posix_api_configuration_table Configuration_POSIX_API;
+/**@}*/
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/posix/include/rtems/posix/key.h b/cpukit/posix/include/rtems/posix/key.h
index 9869881138..fcee90323a 100644
--- a/cpukit/posix/include/rtems/posix/key.h
+++ b/cpukit/posix/include/rtems/posix/key.h
@@ -51,7 +51,7 @@ typedef struct {
/** This field is the Thread id also used as an rbtree key */
Objects_Id thread_id;
/** This field points to the POSIX key value of specific thread */
- void *value;
+ const void *value;
} POSIX_Keys_Key_value_pair;
/**
diff --git a/cpukit/posix/include/rtems/posix/mqueueimpl.h b/cpukit/posix/include/rtems/posix/mqueueimpl.h
index 4963c20e3d..a7105f180f 100644
--- a/cpukit/posix/include/rtems/posix/mqueueimpl.h
+++ b/cpukit/posix/include/rtems/posix/mqueueimpl.h
@@ -8,7 +8,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2011.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -27,48 +27,43 @@
extern "C" {
#endif
-/*
- * The following defines the information control block used to manage
- * this class of objects. The second item is used to manage the set
- * of "file descriptors" associated with the message queues.
+/**
+ * This defines the information control block used to manage
+ * this class of objects.
*/
-
POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
+
+/**
+ * The is used to manage the set of "file descriptors" associated with
+ * the message queues.
+ */
POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information_fds;
/**
* @brief Initialize message_queue manager related data structures.
*
- * DESCRIPTION:
- *
* This routine performs the initialization necessary for this manager.
*
- * NOTE: The structure of the routines is identical to that of POSIX
- * Message_queues to leave the option of having unnamed message
- * queues at a future date. They are currently not part of the
- * POSIX standard but unnamed message_queues are. This is also
- * the reason for the apparently unnecessary tracking of
- * the process_shared attribute. [In addition to the fact that
- * it would be trivial to add pshared to the mq_attr structure
- * and have process private message queues.]
+ * @note The structure of the routines is identical to that of POSIX
+ * Message_queues to leave the option of having unnamed message
+ * queues at a future date. They are currently not part of the
+ * POSIX standard but unnamed message_queues are. This is also
+ * the reason for the apparently unnecessary tracking of
+ * the process_shared attribute. [In addition to the fact that
+ * it would be trivial to add pshared to the mq_attr structure
+ * and have process private message queues.]
*
- * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
- * time.
+ * @note This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open time.
*
*/
-
void _POSIX_Message_queue_Manager_initialization(void);
-/*
- *
- * _POSIX_Message_queue_Create_support
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Message Queue Create Support
*
* This routine performs the creation of a message queue utilizing the
* core message queue.
*/
-
int _POSIX_Message_queue_Create_support(
const char *name,
size_t name_len,
@@ -78,9 +73,7 @@ int _POSIX_Message_queue_Create_support(
);
/**
- * @brief Delete a POSIX message queue.
- *
- * DESCRIPTION:
+ * @brief Delete a POSIX Message Queue
*
* This routine supports the mq_unlink and mq_close routines by
* doing most of the work involved with removing a message queue.
@@ -89,26 +82,22 @@ void _POSIX_Message_queue_Delete(
POSIX_Message_queue_Control *the_mq
);
-/*
+/*@
* @brief POSIX Message Queue Receive Support
*
- * DESCRIPTION:
- *
* This routine supports the various flavors of receiving a message.
*
- * NOTE: The structure of the routines is identical to that of POSIX
- * Message_queues to leave the option of having unnamed message
- * queues at a future date. They are currently not part of the
- * POSIX standard but unnamed message_queues are. This is also
- * the reason for the apparently unnecessary tracking of
- * the process_shared attribute. [In addition to the fact that
- * it would be trivial to add pshared to the mq_attr structure
- * and have process private message queues.]
+ * @note The structure of the routines is identical to that of POSIX
+ * Message_queues to leave the option of having unnamed message
+ * queues at a future date. They are currently not part of the
+ * POSIX standard but unnamed message_queues are. This is also
+ * the reason for the apparently unnecessary tracking of
+ * the process_shared attribute. [In addition to the fact that
+ * it would be trivial to add pshared to the mq_attr structure
+ * and have process private message queues.]
*
- * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
- * time.
+ * @note This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open time.
*/
-
ssize_t _POSIX_Message_queue_Receive_support(
mqd_t mqdes,
char *msg_ptr,
@@ -118,14 +107,11 @@ ssize_t _POSIX_Message_queue_Receive_support(
Watchdog_Interval timeout
);
-/*
- * _POSIX_Message_queue_Send_support
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Message Queue Send Support
*
* This routine posts a message to a specified message queue.
*/
-
int _POSIX_Message_queue_Send_support(
mqd_t mqdes,
const char *msg_ptr,
@@ -135,34 +121,35 @@ int _POSIX_Message_queue_Send_support(
Watchdog_Interval timeout
);
-/*
- * _POSIX_Message_queue_Allocate
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Message Queue Allocate
*
* This function allocates a message queue control block from
* the inactive chain of free message queue control blocks.
*/
+RTEMS_INLINE_ROUTINE
+ POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
+{
+ return (POSIX_Message_queue_Control *)
+ _Objects_Allocate( &_POSIX_Message_queue_Information );
+}
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
-
-/*
- * _POSIX_Message_queue_Free
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Message Queue Free
*
* This routine frees a message queue control block to the
* inactive chain of free message queue control blocks.
*/
-
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
+RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free(
POSIX_Message_queue_Control *the_mq
-);
+)
+{
+ _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
+}
-/*
- * _POSIX_Message_queue_Get
- *
- * DESCRIPTION:
+
+/**
+ * @brief POSIX Message Queue Get
*
* This function maps message queue IDs to message queue control blocks.
* If ID corresponds to a local message queue, then it returns
@@ -172,75 +159,68 @@ RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
* and the_message queue is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_mq is undefined.
*/
-
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
-);
+)
+{
+ return (POSIX_Message_queue_Control *)
+ _Objects_Get( &_POSIX_Message_queue_Information, id, location );
+}
-/*
- * _POSIX_Message_queue_Is_null
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Message Queue Is NULL
*
* This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
*/
-
-RTEMS_INLINE_ROUTINE bool _POSIX_Message_queue_Is_null (
+RTEMS_INLINE_ROUTINE bool _POSIX_Message_queue_Is_null (
POSIX_Message_queue_Control *the_mq
-);
+)
+{
+ return !the_mq;
+}
+
/*
- * _POSIX_Message_queue_Priority_to_core
- *
- * DESCRIPTION:
+ * @brief POSIX Message Queue Convert Message Priority to Score
*
- * XXX
+ * This method converts a POSIX message priority to the priorities used
+ * by the Score.
*/
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
+RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types
+ _POSIX_Message_queue_Priority_to_core(
unsigned int priority
-);
+)
+{
+ return (CORE_message_queue_Submit_types) priority * -1;
+}
+
/*
- * _POSIX_Message_queue_Priority_from_core
- *
- * DESCRIPTION:
+ * @brief POSIX Message Queue Convert Message Priority from Score
*
- * XXX
+ * This method converts a POSIX message priority from the priorities used
+ * by the Score.
*/
-
RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
CORE_message_queue_Submit_types priority
-);
+)
+{
+ /* absolute value without a library dependency */
+ return (unsigned int) ((priority >= 0) ? priority : -priority);
+}
-/*
- * _POSIX_Message_queue_Translate_core_message_queue_return_code
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Message Queue Translate Score Return Code
*
- * XXX
*/
-
int _POSIX_Message_queue_Translate_core_message_queue_return_code(
uint32_t the_message_queue_status
);
-/*
- * _POSIX_Message_queue_Allocate
- */
-
-RTEMS_INLINE_ROUTINE
- POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
-{
- return (POSIX_Message_queue_Control *)
- _Objects_Allocate( &_POSIX_Message_queue_Information );
-}
-
-/*
- * _POSIX_Message_queue_Allocate_fd
+/**
+ * @brief POSIX Message Queue Allocate File Descriptor
*/
-
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *
_POSIX_Message_queue_Allocate_fd( void )
{
@@ -248,21 +228,9 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *
_Objects_Allocate( &_POSIX_Message_queue_Information_fds );
}
-/*
- * _POSIX_Message_queue_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
- POSIX_Message_queue_Control *the_mq
-)
-{
- _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
-}
-
-/*
- * _POSIX_Message_queue_Free_fd
+/**
+ * @brief POSIX Message Queue Free File Descriptor
*/
-
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd (
POSIX_Message_queue_Control_fd *the_mq_fd
)
@@ -270,10 +238,9 @@ RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd (
_Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object );
}
-/*
- * _POSIX_Message_queue_Namespace_remove
+/**
+ * @brief POSIX Message Queue Remove from Namespace
*/
-
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove (
POSIX_Message_queue_Control *the_mq
)
@@ -283,22 +250,8 @@ RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove (
}
/*
- * _POSIX_Message_queue_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Message_queue_Control *)
- _Objects_Get( &_POSIX_Message_queue_Information, id, location );
-}
-
-/*
- * _POSIX_Message_queue_Get_fd
+ * @brief POSIX Message Queue Get File Descriptor
*/
-
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd (
mqd_t id,
Objects_Locations *location
@@ -311,44 +264,6 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd
);
}
-/*
- * _POSIX_Message_queue_Is_null
- */
-
-RTEMS_INLINE_ROUTINE bool _POSIX_Message_queue_Is_null (
- POSIX_Message_queue_Control *the_mq
-)
-{
- return !the_mq;
-}
-
-/*
- * _POSIX_Message_queue_Priority_to_core
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
- unsigned int priority
-)
-{
- return (CORE_message_queue_Submit_types) priority * -1;
-}
-
-/*
- * _POSIX_Message_queue_Priority_from_core
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
- CORE_message_queue_Submit_types priority
-)
-{
- /* absolute value without a library dependency */
- return (unsigned int) ((priority >= 0) ? priority : -priority);
-}
-
/**
* @see _POSIX_Name_to_id().
*/
diff --git a/cpukit/posix/include/rtems/posix/muteximpl.h b/cpukit/posix/include/rtems/posix/muteximpl.h
index 29e93c2af5..710af7b6c8 100644
--- a/cpukit/posix/include/rtems/posix/muteximpl.h
+++ b/cpukit/posix/include/rtems/posix/muteximpl.h
@@ -7,7 +7,7 @@
* inlined routines for POSIX mutex's.
*/
-/* COPYRIGHT (c) 1989-2011.
+/* COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -27,97 +27,61 @@
extern "C" {
#endif
-/*
+/**
* The following defines the information control block used to manage
* this class of objects.
*/
-
POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
-/*
+/**
* The default mutex attributes structure.
*/
-
POSIX_EXTERN pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
+/**
+ * This array contains a mapping from Score Mutex return codes to
+ * POSIX return codes.
+ */
extern const int _POSIX_Mutex_Return_codes[CORE_MUTEX_STATUS_LAST + 1];
-/*
+/**
* @brief POSIX Mutex Manager Initialization
*
- * DESCRIPTION:
- *
* This routine performs the initialization necessary for this manager.
*/
-
void _POSIX_Mutex_Manager_initialization(void);
-/*
- * _POSIX_Mutex_Allocate
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Mutex Allocate
*
* This function allocates a mutexes control block from
* the inactive chain of free mutexes control blocks.
*/
+RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
+{
+ return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
+}
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
-
-/*
- * _POSIX_Mutex_Free
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Mutex Free
*
* This routine frees a mutexes control block to the
* inactive chain of free mutexes control blocks.
*/
-
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
+RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free(
POSIX_Mutex_Control *the_mutex
-);
-
-#if 0
-/*
- * _POSIX_Mutex_Get
- *
- * DESCRIPTION:
- *
- * This function maps mutexes IDs to mutexes control blocks.
- * If ID corresponds to a local mutexes, then it returns
- * the_mutex control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the mutexes ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_mutex is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_mutex is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
+)
+{
+ _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
+}
-/*
- * _POSIX_Mutex_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_mutex is NULL and FALSE otherwise.
- */
-RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_null (
- POSIX_Mutex_Control *the_mutex
-);
-#endif
-
-/*
- * _POSIX_Mutex_Lock_support
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Mutex Lock Support Method
*
* A support routine which implements guts of the blocking, non-blocking, and
* timed wait version of mutex lock.
*/
-
int _POSIX_Mutex_Lock_support(
pthread_mutex_t *mutex,
bool blocking,
@@ -125,10 +89,7 @@ int _POSIX_Mutex_Lock_support(
);
/**
- * @brief Convert core mutex status codes into the appropriate POSIX status
- * values.
- *
- * DESCRIPTION:
+ * @brief Convert Score mutex status codes into POSIX status values
*
* A support routine which converts core mutex status codes into the
* appropriate POSIX status values.
@@ -137,16 +98,17 @@ int _POSIX_Mutex_Lock_support(
*
* @retval 0 Mutex status code indicates the operation completed successfully.
* @retval EBUSY Mutex status code indicates that the operation unable to
- * complete immediately because the resource was unavailable.
+ * complete immediately because the resource was unavailable.
* @retval EDEADLK Mutex status code indicates that an attempt was made to
- * relock a mutex for which nesting is not configured.
+ * relock a mutex for which nesting is not configured.
* @retval EPERM Mutex status code indicates that an attempt was made to
- * release a mutex by a thread other than the thread which locked it.
+ * release a mutex by a thread other than the thread which locked it.
* @retval EINVAL Mutex status code indicates that the thread was blocked
- * waiting for an operation to complete and the mutex was deleted.
+ * waiting for an operation to complete and the mutex was deleted.
* @retval ETIMEDOUT Mutex status code indicates that the calling task was
- * willing to block but the operation was unable to complete within the time
- * allotted because the resource never became available.
+ * willing to block but the operation was unable to complete
+ * within the time allotted because the resource never became
+ * available.
*/
RTEMS_INLINE_ROUTINE int _POSIX_Mutex_Translate_core_mutex_return_code(
CORE_mutex_Status the_mutex_status
@@ -162,67 +124,41 @@ RTEMS_INLINE_ROUTINE int _POSIX_Mutex_Translate_core_mutex_return_code(
return _POSIX_Mutex_Return_codes[the_mutex_status];
}
-/*
- * _POSIX_Mutex_Get
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Mutex Get (Thread Dispatch Disable)
*
* A support routine which translates the mutex id into a local pointer.
* As a side-effect, it may create the mutex.
*
- * NOTE:
- *
- * This version of the method uses a dispatching critical section.
+ * @note This version of the method uses a dispatching critical section.
*/
-
POSIX_Mutex_Control *_POSIX_Mutex_Get (
pthread_mutex_t *mutex,
Objects_Locations *location
);
-/*
- * _POSIX_Mutex_Get
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Mutex Get (Interrupt Disable)
*
* A support routine which translates the mutex id into a local pointer.
* As a side-effect, it may create the mutex.
*
- * NOTE:
- *
- * This version of the method uses an interrupt critical section.
+ * @note: This version of the method uses an interrupt critical section.
*/
-
POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable (
pthread_mutex_t *mutex,
Objects_Locations *location,
ISR_Level *level
);
-/*
- * _POSIX_Mutex_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
-{
- return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
-}
-
-/*
- * _POSIX_Mutex_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
- POSIX_Mutex_Control *the_mutex
-)
-{
- _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
-}
-
-/*
- * _POSIX_Mutex_Is_null
+/**
+ * @brief POSIX Mutex Is NULL
+ *
+ * This method is used to determine if a pointer to a POSIX mutex is NULL.
+ *
+ * @return This method returns TRUE if @a the_mutex is NULL and FALSE
+ * otherwise.
*/
-
RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_null (
POSIX_Mutex_Control *the_mutex
)
diff --git a/cpukit/posix/include/rtems/posix/psignalimpl.h b/cpukit/posix/include/rtems/posix/psignalimpl.h
index c496fd33bd..9a493fd96c 100644
--- a/cpukit/posix/include/rtems/posix/psignalimpl.h
+++ b/cpukit/posix/include/rtems/posix/psignalimpl.h
@@ -7,7 +7,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2011.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -93,8 +93,6 @@ static inline void _POSIX_signals_Add_post_switch_extension(void)
/**
* @brief Unlock POSIX signals thread.
- *
- * XXX this routine could probably be cleaned up
*/
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
diff --git a/cpukit/posix/include/rtems/posix/ptimer.h b/cpukit/posix/include/rtems/posix/ptimer.h
index e06b1e9449..03e523afd4 100644
--- a/cpukit/posix/include/rtems/posix/ptimer.h
+++ b/cpukit/posix/include/rtems/posix/ptimer.h
@@ -10,13 +10,14 @@
/*
* Initial Implementation:
* COPYRIGHT (c) 1998. Alfonso Escalera PiƱa
- * Largely rewritten by Joel Sherrill.
+ * Largely rewritten by Joel Sherrill (1999).
+ *
+ * COPYRIGHT (c) 1999-2013.
+ * On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
- *
- * ptimer.h,v 1.0 1998/03/31 16:21:16
*/
#ifndef _RTEMS_POSIX_PTIMER_H
@@ -26,7 +27,6 @@
* @defgroup POSIX_PRIV_TIMERS POSIX Timers
*
* @ingroup POSIXAPI
- *
*/
/**@{**/
#ifdef __cplusplus
@@ -35,44 +35,32 @@ extern "C" {
#include <rtems/posix/config.h>
-/*
- * _POSIX_Timers_Manager_initialization
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Timer Manager Initialization
*
* This routine performs the initialization necessary for this manager.
*/
-
void _POSIX_Timer_Manager_initialization(void);
-/*
+/**
* @brief Create a Per-Process Timer
- *
- * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264
- *
- * timer_create
*/
-
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
);
-/*
- * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266
+/**
+ * @brief Delete a Per-Process Timer
*/
-
int timer_delete(
timer_t timerid
);
-/*
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
- *
- * timer_settime
+/**
+ * @brief Set a Per-Process Timer
*/
-
int timer_settime(
timer_t timerid,
int flags,
@@ -80,25 +68,20 @@ int timer_settime(
struct itimerspec *ovalue
);
-/*
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
- *
- * timer_gettime
+/**
+ * @brief Set a Per-Process Timer
*/
-
int timer_gettime(
timer_t timerid,
struct itimerspec *value
);
/**
- * @brief Get overrun count for a POSIX per-process timer.
+ * @brief Get overrun count for a Per-Process Timer
*
* The expiration of a timer must increase by one a counter.
* After the signal handler associated to the timer finishes
* its execution, _POSIX_Timer_TSR will have to set this counter to 0.
- *
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
*/
int timer_getoverrun(
timer_t timerid
diff --git a/cpukit/posix/include/rtems/posix/semaphoreimpl.h b/cpukit/posix/include/rtems/posix/semaphoreimpl.h
index 34ac6f8bab..fd3dc48093 100644
--- a/cpukit/posix/include/rtems/posix/semaphoreimpl.h
+++ b/cpukit/posix/include/rtems/posix/semaphoreimpl.h
@@ -8,7 +8,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2011.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -29,54 +29,54 @@
extern "C" {
#endif
-/*
- * The following defines the information control block used to manage
+/**
+ * This defines the information control block used to manage
* this class of objects.
*/
-
POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information;
+/**
+ * This defines the mapping from Score status codes to POSIX return codes.
+ */
extern const int
_POSIX_Semaphore_Return_codes[CORE_SEMAPHORE_STATUS_LAST + 1];
-/*
- * _POSIX_Semaphore_Manager_initialization
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Semaphore Manager Initialization
*
* This routine performs the initialization necessary for this manager.
*/
-
void _POSIX_Semaphore_Manager_initialization(void);
-/*
- * _POSIX_Semaphore_Allocate
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Semaphore Allocate
*
* This function allocates a semaphore control block from
* the inactive chain of free semaphore control blocks.
*/
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
+RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
+{
+ return (POSIX_Semaphore_Control *)
+ _Objects_Allocate( &_POSIX_Semaphore_Information );
+}
+
-/*
- * _POSIX_Semaphore_Free
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Semaphore Free
*
* This routine frees a semaphore control block to the
* inactive chain of free semaphore control blocks.
*/
-
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
-);
+)
+{
+ _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
+}
-/*
- * _POSIX_Semaphore_Get
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Semaphore Get
*
* This function maps semaphore IDs to semaphore control blocks.
* If ID corresponds to a local semaphore, then it returns
@@ -86,16 +86,18 @@ RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
* and the_semaphore is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_semaphore is undefined.
*/
-
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
- sem_t *id,
+ sem_t *id,
Objects_Locations *location
-);
+)
+{
+ return (POSIX_Semaphore_Control *)
+ _Objects_Get( &_POSIX_Semaphore_Information, (Objects_Id)*id, location );
+}
-/*
- * _POSIX_Semaphore_Create_support
- *
- * DESCRIPTION:
+
+/**
+ * @brief POSIX Semaphore Create Support
*
* This routine supports the sem_init and sem_open routines.
*/
@@ -109,9 +111,7 @@ int _POSIX_Semaphore_Create_support(
);
/**
- * @brief POSIX delete a semaphore.
- *
- * DESCRIPTION:
+ * @brief POSIX Semaphore Delete
*
* This routine supports the sem_close and sem_unlink routines.
*/
@@ -122,8 +122,6 @@ void _POSIX_Semaphore_Delete(
/**
* @brief POSIX semaphore wait support.
*
- * DESCRIPTION:
- *
* This routine supports the sem_wait, sem_trywait, and sem_timedwait
* services.
*/
@@ -133,15 +131,12 @@ int _POSIX_Semaphore_Wait_support(
Watchdog_Interval timeout
);
-/*
- * _POSIX_Semaphore_Translate_core_semaphore_return_code
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Semaphore Translate Score to POSIX Return Codes
*
* A support routine which converts core semaphore status codes into the
* appropriate POSIX status values.
*/
-
RTEMS_INLINE_ROUTINE int
_POSIX_Semaphore_Translate_core_semaphore_return_code(
CORE_semaphore_Status the_semaphore_status
@@ -157,31 +152,9 @@ _POSIX_Semaphore_Translate_core_semaphore_return_code(
return _POSIX_Semaphore_Return_codes[the_semaphore_status];
}
-/*
- * _POSIX_Semaphore_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
-{
- return (POSIX_Semaphore_Control *)
- _Objects_Allocate( &_POSIX_Semaphore_Information );
-}
-
-/*
- * _POSIX_Semaphore_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
-}
-
-/*
- * _POSIX_Semaphore_Namespace_remove
+/**
+ * @brief POSIX Semaphore Namespace Remove
*/
-
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove (
POSIX_Semaphore_Control *the_semaphore
)
@@ -190,20 +163,6 @@ RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove (
&_POSIX_Semaphore_Information, &the_semaphore->Object );
}
-
-
-/*
- * _POSIX_Semaphore_Get
- */
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
- sem_t *id,
- Objects_Locations *location
-)
-{
- return (POSIX_Semaphore_Control *)
- _Objects_Get( &_POSIX_Semaphore_Information, (Objects_Id)*id, location );
-}
-
/**
* @see _POSIX_Name_to_id().
*/
diff --git a/cpukit/posix/include/rtems/posix/timerimpl.h b/cpukit/posix/include/rtems/posix/timerimpl.h
index ca108201a6..1d3c110ebe 100644
--- a/cpukit/posix/include/rtems/posix/timerimpl.h
+++ b/cpukit/posix/include/rtems/posix/timerimpl.h
@@ -8,7 +8,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2011.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -26,19 +26,19 @@
extern "C" {
#endif
-/* Timer is free */
+/** Timer is free */
#define POSIX_TIMER_STATE_FREE 0x01
-/* Created timer but not running */
+/** Created timer but not running */
#define POSIX_TIMER_STATE_CREATE_NEW 0x02
-/* Created timer and running */
+/** Created timer and running */
#define POSIX_TIMER_STATE_CREATE_RUN 0x03
-/* Created, ran and stopped timer */
+/** Created, ran and stopped timer */
#define POSIX_TIMER_STATE_CREATE_STOP 0x04
-/* Indicates that the fire time is relative to the current one */
+/** Indicates that the fire time is relative to the current one */
#define POSIX_TIMER_RELATIVE 0
/*
@@ -50,24 +50,22 @@ extern "C" {
#error "POSIX_TIMER_RELATIVE == TIMER_ABSTIME"
#endif
-/*
- * _POSIX_Timers_Manager_initialization
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Timer Manager Initialization
*
* This routine performs the initialization necessary for this manager.
*/
void _POSIX_Timer_Manager_initialization(void);
-/*
- * @brief Operation that is run when a timer expires
+/**
+ * @brief POSIX Timer Manager Timer Service Routine Helper
*
- * Timer TSR
+ * This is the operation that is run when a timer expires.
*/
void _POSIX_Timer_TSR(Objects_Id timer, void *data);
-/*
- * Watchdog Insert helper
+/**
+ * @brief POSIX Timer Watchdog Insertion Helper
*/
bool _POSIX_Timer_Insert_helper(
Watchdog_Control *timer,
@@ -77,35 +75,29 @@ bool _POSIX_Timer_Insert_helper(
void *arg
);
-/*
+/**
* The following defines the information control block used to manage
* this class of objects.
*/
POSIX_EXTERN Objects_Information _POSIX_Timer_Information;
-/*
- * _POSIX_Timer_Allocate
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Timer Allocate
*
* This function allocates a timer control block from
* the inactive chain of free timer control blocks.
*/
-
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
{
return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information );
}
-/*
- * _POSIX_Timer_Free
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Timer Free
*
* This routine frees a timer control block to the
* inactive chain of free timer control blocks.
*/
-
RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free (
POSIX_Timer_Control *the_timer
)
@@ -113,10 +105,8 @@ RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free (
_Objects_Free( &_POSIX_Timer_Information, &the_timer->Object );
}
-/*
- * _POSIX_Timer_Get
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Timer Get
*
* This function maps timer IDs to timer control blocks.
* If ID corresponds to a local timer, then it returns
@@ -124,7 +114,6 @@ RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free (
* is set to OBJECTS_LOCAL. Otherwise, location is set
* to OBJECTS_ERROR and the returned value is undefined.
*/
-
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get (
timer_t id,
Objects_Locations *location
@@ -134,14 +123,11 @@ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get (
_Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location );
}
-/*
- * _POSIX_Timer_Is_null
- *
- * DESCRIPTION:
+/**
+ * @brief POSIX Timer Is NULL
*
* This function returns TRUE if the_timer is NULL and FALSE otherwise.
*/
-
RTEMS_INLINE_ROUTINE bool _POSIX_Timer_Is_null (
POSIX_Timer_Control *the_timer
)
diff --git a/cpukit/posix/src/alarm.c b/cpukit/posix/src/alarm.c
index d46d571d98..8def4a0836 100644
--- a/cpukit/posix/src/alarm.c
+++ b/cpukit/posix/src/alarm.c
@@ -9,7 +9,7 @@
* 3.4.1 Schedule Alarm, P1003.1b-1993, p. 79
*/
-/* COPYRIGHT (c) 1989-2007.
+/* COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -32,14 +32,27 @@
/*
* _POSIX_signals_Alarm_TSR
*/
-
static void _POSIX_signals_Alarm_TSR(
Objects_Id id __attribute__((unused)),
void *argument __attribute__((unused))
)
{
- kill( getpid(), SIGALRM );
- /* XXX can't print from an ISR, should this be fatal? */
+ #if defined(RTEMS_DEBUG)
+ int status;
+ #define KILL_STATUS status =
+ #else
+ #define KILL_STATUS (void)
+ #endif
+
+ KILL_STATUS kill( getpid(), SIGALRM );
+
+ #if defined(RTEMS_DEBUG)
+ /*
+ * There is no reason to think this might fail but we should be
+ * cautious.
+ */
+ assert(status == 0);
+ #endif
}
static Watchdog_Control _POSIX_signals_Alarm_timer = WATCHDOG_INITIALIZER(
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c
index a13d4f70f4..e5299075bc 100644
--- a/cpukit/posix/src/condwaitsupp.c
+++ b/cpukit/posix/src/condwaitsupp.c
@@ -58,13 +58,17 @@ int _POSIX_Condition_variables_Wait_support(
return EINVAL;
}
- (void) pthread_mutex_unlock( mutex );
-/* XXX ignore this for now since behavior is undefined
+
+ mutex_status = pthread_mutex_unlock( mutex );
+ /*
+ * Historically, we ignored the return code since the behavior
+ * is undefined by POSIX. But GNU/Linux returns EPERM in this
+ * case, so we follow their lead.
+ */
if ( mutex_status ) {
_Objects_Put( &the_cond->Object );
- return EINVAL;
+ return EPERM;
}
-*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
diff --git a/cpukit/posix/src/pbarrier.c b/cpukit/posix/src/pbarrier.c
index ff548bb385..66547c1584 100644
--- a/cpukit/posix/src/pbarrier.c
+++ b/cpukit/posix/src/pbarrier.c
@@ -1,19 +1,11 @@
-/*
- * Barrier Manager
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the Barrier Manager.
- *
- * Directives provided are:
- *
- * + create a barrier
- * + get an ID of a barrier
- * + delete a barrier
- * + acquire a barrier
- * + release a barrier
+/**
+ * @file
*
- * COPYRIGHT (c) 1989-2008.
+ * This file initializes the POSIX Barrier Manager.
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -34,7 +26,6 @@
/**
* @brief _POSIX_Barrier_Manager_initialization
*/
-
void _POSIX_Barrier_Manager_initialization(void)
{
_Objects_Initialize_information(
diff --git a/cpukit/posix/src/pspin.c b/cpukit/posix/src/pspin.c
index a31cb5d24d..b8e03e6be9 100644
--- a/cpukit/posix/src/pspin.c
+++ b/cpukit/posix/src/pspin.c
@@ -1,19 +1,11 @@
-/*
- * Spinlock Manager
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the Spinlock Manager.
- *
- * Directives provided are:
- *
- * + create a spinlock
- * + get an ID of a spinlock
- * + delete a spinlock
- * + acquire a spinlock
- * + release a spinlock
+/**
+ * @file
*
- * COPYRIGHT (c) 1989-2008.
+ * This file contains the initialization of the POSIX Spinlock Manager.
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -34,7 +26,6 @@
/**
* @brief _POSIX_Spinlock_Manager_initialization
*/
-
void _POSIX_Spinlock_Manager_initialization(void)
{
_Objects_Initialize_information(
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 4d8f95f150..5988a5e772 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -6,7 +6,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2010.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -138,7 +138,7 @@ void _POSIX_Threads_Sporadic_budget_callout(
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
- the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
+ the_thread->cpu_time_budget = UINT32_MAX;
new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority);
the_thread->real_priority = new_priority;
@@ -212,9 +212,7 @@ static bool _POSIX_Threads_Create_extension(
*
* The check for class == 1 is debug. Should never really happen.
*/
-
- /* XXX use signal constants */
- api->signals_pending = 0;
+ api->signals_pending = SIGNAL_EMPTY_MASK;
if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API
#if defined(RTEMS_DEBUG)
&& _Objects_Get_class( created->Object.id ) == 1
@@ -223,7 +221,7 @@ static bool _POSIX_Threads_Create_extension(
executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
api->signals_blocked = executing_api->signals_blocked;
} else {
- api->signals_blocked = 0xffffffff;
+ api->signals_blocked = SIGNAL_ALL_MASK;
}
_Thread_queue_Initialize(
diff --git a/cpukit/rtems/src/signalcatch.c b/cpukit/rtems/src/signalcatch.c
index a5e5ef88f4..f7e4afb912 100644
--- a/cpukit/rtems/src/signalcatch.c
+++ b/cpukit/rtems/src/signalcatch.c
@@ -69,7 +69,6 @@ rtems_status_code rtems_signal_catch(
RTEMS_API_Control *api;
ASR_Information *asr;
-/* XXX normalize mode */
executing = _Thread_Get_executing();
api = (RTEMS_API_Control*)executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;