File indexing completed on 2025-05-11 08:24:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 #ifndef _RTEMS_POSIX_PTHREADATTRIMPL_H
0039 #define _RTEMS_POSIX_PTHREADATTRIMPL_H
0040
0041 #include <errno.h>
0042 #include <pthread.h>
0043
0044 #include <rtems/score/basedefs.h>
0045 #include <rtems/score/assert.h>
0046 #include <rtems/posix/priorityimpl.h>
0047 #include <rtems/posix/threadsup.h>
0048
0049 #ifdef __cplusplus
0050 extern "C" {
0051 #endif
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 extern const pthread_attr_t _POSIX_Threads_Default_attributes;
0062
0063 static inline void _POSIX_Threads_Copy_attributes(
0064 pthread_attr_t *dst_attr,
0065 const pthread_attr_t *src_attr
0066 )
0067 {
0068 *dst_attr = *src_attr;
0069 _Assert(
0070 dst_attr->affinitysetsize == sizeof(dst_attr->affinitysetpreallocated)
0071 );
0072 dst_attr->affinityset = &dst_attr->affinitysetpreallocated;
0073 }
0074
0075 static inline void _POSIX_Threads_Initialize_attributes(
0076 pthread_attr_t *attr
0077 )
0078 {
0079 _POSIX_Threads_Copy_attributes(
0080 attr,
0081 &_POSIX_Threads_Default_attributes
0082 );
0083 }
0084
0085 static inline void _POSIX_Threads_Get_sched_param_sporadic(
0086 const Thread_Control *the_thread,
0087 const Scheduler_Control *scheduler,
0088 struct sched_param *param
0089 )
0090 {
0091 #if defined(RTEMS_POSIX_API)
0092 const POSIX_API_Control *api;
0093
0094 api = (const POSIX_API_Control*) the_thread->API_Extensions[ THREAD_API_POSIX ];
0095 param->sched_ss_low_priority = _POSIX_Priority_From_core(
0096 scheduler,
0097 api->Sporadic.Low_priority.priority
0098 );
0099 param->sched_ss_repl_period = api->Sporadic.sched_ss_repl_period;
0100 param->sched_ss_init_budget = api->Sporadic.sched_ss_init_budget;
0101 param->sched_ss_max_repl = api->Sporadic.sched_ss_max_repl;
0102 #else
0103 (void) the_thread;
0104 (void) scheduler;
0105 (void) param;
0106 #endif
0107 }
0108
0109
0110
0111 #ifdef __cplusplus
0112 }
0113 #endif
0114
0115 #endif
0116