RTEMS CPU Kit with SuperCore  4.11.3
Files | Macros | Functions | Variables
POSIX Threads Support

Private Support Information for POSIX Threads. More...

Collaboration diagram for POSIX Threads Support:

Files

file  psxtransschedparam.c
 Translate sched_param into SuperCore Terms.
 
file  pthreadinitthreads.c
 POSIX Threads Initialize User Threads Body.
 

Macros

#define PTHREAD_MINIMUM_STACK_SIZE   (_Stack_Minimum() * 2)
 The following sets the minimum stack size for POSIX threads.
 

Functions

void _POSIX_Threads_Initialize_user_threads_body (void)
 POSIX threads initialize user threads body. More...
 
void _POSIX_Threads_Manager_initialization (void)
 POSIX threads manager initialization. More...
 
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Copy_attributes (pthread_attr_t *dst_attr, const pthread_attr_t *src_attr)
 Copy POSIX Thread attribute structure. More...
 
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (Thread_Control *the_pthread)
 Free POSIX control block. More...
 
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Initialize_attributes (pthread_attr_t *attr)
 POSIX threads initialize user threads body. More...
 
void _POSIX_Threads_Sporadic_budget_callout (Thread_Control *the_thread)
 POSIX threads sporadic budget callout. More...
 
void _POSIX_Threads_Sporadic_budget_TSR (Objects_Id id, void *argument)
 This routine supports the sporadic scheduling algorithm. More...
 
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)
 Translate sched_param into SuperCore terms. More...
 
int rtems_pthread_attribute_compare (const pthread_attr_t *attr1, const pthread_attr_t *attr2)
 
RTEMS_INLINE_ROUTINE Thread_Control_POSIX_Threads_Allocate (void)
 
RTEMS_INLINE_ROUTINE bool _POSIX_Threads_Is_null (Thread_Control *the_pthread)
 

Variables

POSIX_EXTERN Objects_Information _POSIX_Threads_Information
 The following defines the information control block used to manage this class of objects.
 
pthread_attr_t _POSIX_Threads_Default_attributes
 This variable contains the default POSIX Thread attributes.
 
void(* _POSIX_Threads_Initialize_user_threads_p )(void)
 When the user configures a set of POSIX API initialization threads, This variable will point to the method used to initialize them. More...
 

Detailed Description

Private Support Information for POSIX Threads.

Function Documentation

◆ _POSIX_Thread_Translate_sched_param()

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 
)

Translate sched_param into SuperCore terms.

This method translates the POSIX API sched_param into the corresponding SuperCore settings.

Parameters
[in]policyis the POSIX scheduling policy
[in]parampoints to the scheduling parameter structure
[in]budget_algorithmpoints to the output CPU Budget algorithm
[in]budget_calloutpoints to the output CPU Callout
Return values
0Indicates success.
error_codePOSIX error code indicating failure.

References _POSIX_Priority_Is_valid().

◆ _POSIX_Threads_Copy_attributes()

RTEMS_INLINE_ROUTINE void _POSIX_Threads_Copy_attributes ( pthread_attr_t *  dst_attr,
const pthread_attr_t *  src_attr 
)

Copy POSIX Thread attribute structure.

This routine copies the attr2 thread attribute structure to the attr1 Thread Attribute structure.

Parameters
[in]dst_attris a pointer to the thread attribute structure to copy into.
[out]src_attris a pointer to the thread attribute structure to copy from.

References _Assert.

Referenced by _POSIX_Threads_Initialize_attributes().

◆ _POSIX_Threads_Free()

RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control the_pthread)

Free POSIX control block.

This routine frees a pthread control block to the inactive chain of free pthread control blocks.

Parameters
[in]the_pthreadis a pointer to the thread to free.

References _Objects_Free(), and Thread_Control::Object.

◆ _POSIX_Threads_Initialize_attributes()

RTEMS_INLINE_ROUTINE void _POSIX_Threads_Initialize_attributes ( pthread_attr_t *  attr)

POSIX threads initialize user threads body.

This routine initializes the thread attributes structure.

References _POSIX_Threads_Copy_attributes(), and RTEMS_INLINE_ROUTINE.

Referenced by pthread_attr_init().

◆ _POSIX_Threads_Initialize_user_threads_body()

void _POSIX_Threads_Initialize_user_threads_body ( void  )

POSIX threads initialize user threads body.

This routine creates and starts all configured user initialization threads.

◆ _POSIX_Threads_Manager_initialization()

void _POSIX_Threads_Manager_initialization ( void  )

POSIX threads manager initialization.

This routine performs the initialization necessary for this manager.

References _Assert, _Objects_Initialize_information(), _POSIX_Threads_Default_attributes, and _POSIX_Threads_Information.

◆ _POSIX_Threads_Sporadic_budget_callout()

void _POSIX_Threads_Sporadic_budget_callout ( Thread_Control the_thread)

POSIX threads sporadic budget callout.

This routine handles the sporadic scheduling algorithm.

Parameters
[in]the_threadis a pointer to the thread whose budget has been exceeded.

References _POSIX_Priority_To_core(), _Thread_Change_priority(), Thread_Control::API_Extensions, Thread_Control::cpu_time_budget, POSIX_API_Control::schedparam, and THREAD_API_POSIX.

◆ _POSIX_Threads_Sporadic_budget_TSR()

void _POSIX_Threads_Sporadic_budget_TSR ( Objects_Id  id,
void *  argument 
)

This routine supports the sporadic scheduling algorithm.

It is scheduled to be executed at the end of each replenishment period. In sporadic scheduling a thread will execute at a high priority for a user specified amount of CPU time. When it exceeds that amount of CPU time, its priority is automatically lowered. This TSR is executed when it is time to replenish the thread's processor budget and raise its priority.

Parameters
[in]idis ignored
[in]argumentis a pointer to the Thread_Control structure for the thread being replenished.

References _POSIX_Priority_To_core(), _Thread_Change_priority(), _Timespec_To_ticks(), Thread_Control::API_Extensions, Thread_Control::cpu_time_budget, POSIX_API_Control::schedparam, and THREAD_API_POSIX.

Variable Documentation

◆ _POSIX_Threads_Initialize_user_threads_p

void(* _POSIX_Threads_Initialize_user_threads_p) (void)

When the user configures a set of POSIX API initialization threads, This variable will point to the method used to initialize them.

NOTE: It is instantiated and initialized by confdefs.h based upon application requirements.