RTEMS  5.0.0
pthreadimpl.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 1989-2011.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef _RTEMS_POSIX_PTHREADIMPL_H
20 #define _RTEMS_POSIX_PTHREADIMPL_H
21 
22 #include <rtems/posix/pthread.h>
23 #include <rtems/posix/config.h>
24 #include <rtems/posix/threadsup.h>
25 #include <rtems/score/assert.h>
26 #include <rtems/score/objectimpl.h>
27 #include <rtems/score/timespec.h>
28 #include <rtems/score/threadimpl.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
43 #define PTHREAD_MINIMUM_STACK_SIZE _Configuration_POSIX_Minimum_stack_size
44 
45 #if defined(RTEMS_POSIX_API)
46 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert(
47  Thread_Control *the_thread,
48  POSIX_API_Control *api
49 )
50 {
51  the_thread->cpu_time_budget =
52  _Timespec_To_ticks( &api->Sporadic.sched_ss_init_budget );
53 
54  _Watchdog_Per_CPU_insert_ticks(
55  &api->Sporadic.Timer,
56  _Per_CPU_Get(),
57  _Timespec_To_ticks( &api->Sporadic.sched_ss_repl_period )
58  );
59 }
60 #endif
61 
62 void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog );
63 
73  Thread_Control *the_thread
74 );
75 
76 int _POSIX_Thread_Translate_to_sched_policy(
77  Thread_CPU_budget_algorithms budget_algorithm
78 );
79 
95  int policy,
96  const struct sched_param *param,
97  Thread_CPU_budget_algorithms *budget_algorithm,
99 );
100 
101 RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate(void)
102 {
104 
106 
107  return (Thread_Control *)
109 }
110 
111 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
112  Thread_Control *the_pthread
113 )
114 {
116 }
117 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif
125 /* end of include file */
void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Definition: objectfree.c:25
uint32_t _Timespec_To_ticks(const struct timespec *time)
Convert timespec to number of ticks.
Definition: timespectoticks.c:27
Objects_Control * _Objects_Allocate_unprotected(Objects_Information *information)
Allocates an object without locking the allocator mutex.
Definition: objectallocate.c:33
Inlined Routines in the Watchdog Handler.
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
The control block used to manage each watchdog timer.
Definition: watchdog.h:87
POSIX Threads Private Support.
POSIX Thread API Support.
Objects_Information Objects
The object information.
Definition: thread.h:979
User Defined Configuration Parameters Specific For The POSIX API.
void(* Thread_CPU_budget_algorithm_callout)(Thread_Control *)
Definition: thread.h:173
Definition: thread.h:728
Objects_Control Object
Definition: thread.h:730
void _POSIX_Threads_Sporadic_budget_callout(Thread_Control *the_thread)
POSIX threads sporadic budget callout.
void _Thread_Kill_zombies(void)
Kills all zombie threads in the system.
Definition: threadrestart.c:218
Thread_Information _POSIX_Threads_Information
int _POSIX_Thread_Translate_sched_param(int policy, const struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout)
Translate sched_param into SuperCore terms.
Definition: psxtransschedparam.c:43
RTEMS_INLINE_ROUTINE void _Objects_Allocator_lock(void)
Locks the object allocator mutex.
Definition: objectimpl.h:850
Inlined Routines from the Thread Handler.
Inlined Routines in the Object Handler.
uint32_t cpu_time_budget
Definition: thread.h:812
Thread_CPU_budget_algorithms
Definition: thread.h:159