summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems/posix/pthread.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-24 06:38:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-24 06:38:52 +0000
commit2212a2adf9f760bd01ebaed18664569a302adc9b (patch)
tree22e0bc1c0f38ded2fc2093369d7b90dc9fafa6ff /cpukit/posix/include/rtems/posix/pthread.h
parent2009-06-24 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-2212a2adf9f760bd01ebaed18664569a302adc9b.tar.bz2
2009-06-24 Joel Sherrill <joel.sherrill@oarcorp.com>
* posix/Makefile.am, posix/include/rtems/posix/priority.h, posix/include/rtems/posix/pthread.h, posix/inline/rtems/posix/priority.inl, posix/src/killinfo.c, posix/src/pthread.c, posix/src/pthreadcreate.c, posix/src/pthreadsetschedparam.c: Various modifications to improve binary code coverage analysis. Some of these are to mark code as debug only. Some are to break conditional expressions into multiple lines. Some are to move inline methods that are not time critical into subroutines to make them easier to test. Inlining them multiple times means that their logic paths are spread across multiple methods. This explodes the test cases required. * posix/src/psxpriorityisvalid.c, posix/src/psxtransschedparam.c: New files.
Diffstat (limited to '')
-rw-r--r--cpukit/posix/include/rtems/posix/pthread.h88
1 files changed, 53 insertions, 35 deletions
diff --git a/cpukit/posix/include/rtems/posix/pthread.h b/cpukit/posix/include/rtems/posix/pthread.h
index 27156dd886..66f3ab9f6d 100644
--- a/cpukit/posix/include/rtems/posix/pthread.h
+++ b/cpukit/posix/include/rtems/posix/pthread.h
@@ -36,9 +36,11 @@ extern "C" {
* The following defines the information control block used to manage
* this class of objects.
*/
-
POSIX_EXTERN Objects_Information _POSIX_Threads_Information;
+/**
+ * This variable contains the default POSIX Thread attributes.
+ */
extern const pthread_attr_t _POSIX_Threads_Default_attributes;
/**
@@ -50,44 +52,37 @@ extern const pthread_attr_t _POSIX_Threads_Default_attributes;
*/
extern void (*_POSIX_Threads_Initialize_user_threads_p)(void);
-/*
- * _POSIX_Threads_Manager_initialization
- *
- * DESCRIPTION:
+/**
+ * @brief _POSIX_Threads_Manager_initialization
*
* This routine performs the initialization necessary for this manager.
*/
-
void _POSIX_Threads_Manager_initialization(void);
-/*
- * _POSIX_Threads_Allocate
- *
- * DESCRIPTION:
+/**
+ * @brief _POSIX_Threads_Allocate
*
* This function allocates a pthread control block from
* the inactive chain of free pthread control blocks.
+ *
+ * @return This method returns a newly allocated thread.
*/
-
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
-/*
- * _POSIX_Threads_Free
- *
- * DESCRIPTION:
+/**
+ * @brief _POSIX_Threads_Free
*
* This routine frees a pthread control block to the
* inactive chain of free pthread control blocks.
+ *
+ * @param[in] the_pthread is the thread to free
*/
-
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
Thread_Control *the_pthread
);
-/*
- * _POSIX_Threads_Get
- *
- * DESCRIPTION:
+/**
+ * @brief _POSIX_Threads_Get
*
* This function maps pthread IDs to pthread control blocks.
* If ID corresponds to a local pthread, then it returns
@@ -96,50 +91,73 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
* resides on a remote node, then location is set to OBJECTS_REMOTE,
* and the_pthread is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_pthread is undefined.
+ *
+ * @param[in] id is the id to lookup
+ * @param[in] location points to the returned location value
+ *
+ * @return This methods returns a pointer to the corresponding Thread_Control.
*/
-
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
pthread_t id,
Objects_Locations *location
);
-/*
- * _POSIX_Threads_Is_null
- *
- * DESCRIPTION:
+/**
+ * @brief _POSIX_Threads_Is_null
*
* This function returns TRUE if the_pthread is NULL and FALSE otherwise.
+ *
+ * @param[in] the_pthread is the thread pointer to check.
+ *
+ * @return This method returns true if the thread pointer is null.
*/
-
RTEMS_INLINE_ROUTINE bool _POSIX_Threads_Is_null(
Thread_Control *the_pthread
);
-/*
- * _POSIX_Threads_Sporadic_budget_callout
- *
- * DESCRIPTION:
+/**
+ * @brief _POSIX_Threads_Sporadic_budget_callout
*
* This routine handles the sporadic scheduling algorithm.
+ *
+ * @param[in] the_thread is the thread whose budget has been exceeded.
*/
-
void _POSIX_Threads_Sporadic_budget_callout(
Thread_Control *the_thread
);
-/*
+/**
* _POSIX_Threads_Sporadic_budget_TSR
*
- * DESCRIPTION:
- *
* This routine supports the sporadic scheduling algorithm.
+ *
+ * @param[in] the_thread is the thread whose budget has been exceeded.
*/
-
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id,
void *argument
);
+/**
+ * @brief Translate sched_param into SuperCore Terms
+ *
+ * This method translates the POSIX API sched_param into the corresponding
+ * SuperCore settings.
+ *
+ * @param[in] policy is the POSIX scheduling policy
+ * @param[in] param points to the scheduling parameter structure
+ * @param[in] budget_algorithm points to the output CPU Budget algorithm
+ * @param[in] budget_callout points to the output CPU Callout
+ *
+ * @return This method returns 0 on success or a POSIX error code.
+ */
+int _POSIX_Thread_Translate_sched_param(
+ int policy,
+ struct sched_param *param,
+ Thread_CPU_budget_algorithms *budget_algorithm,
+ Thread_CPU_budget_algorithm_callout *budget_callout
+);
+
#include <rtems/posix/pthread.inl>
#ifdef __cplusplus