1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief POSIX Thread API Support |
---|
5 | * |
---|
6 | * This defines the POSIX thread API extension. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2014. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef _RTEMS_POSIX_THREADSUP_H |
---|
19 | #define _RTEMS_POSIX_THREADSUP_H |
---|
20 | |
---|
21 | #include <rtems/score/thread.h> |
---|
22 | #include <rtems/score/watchdog.h> |
---|
23 | |
---|
24 | #include <pthread.h> |
---|
25 | #include <signal.h> |
---|
26 | |
---|
27 | /** |
---|
28 | * @defgroup POSIX_THREAD POSIX Thread API Extension |
---|
29 | * |
---|
30 | * @ingroup POSIXAPI |
---|
31 | * |
---|
32 | */ |
---|
33 | /**@{**/ |
---|
34 | #ifdef __cplusplus |
---|
35 | extern "C" { |
---|
36 | #endif |
---|
37 | |
---|
38 | /** |
---|
39 | * This defines the POSIX API support structure associated with |
---|
40 | * each thread in a system with POSIX configured. |
---|
41 | */ |
---|
42 | typedef struct { |
---|
43 | /** Back pointer to thread of this POSIX API control. */ |
---|
44 | Thread_Control *thread; |
---|
45 | |
---|
46 | /** Created with explicit or inherited scheduler. */ |
---|
47 | bool created_with_explicit_scheduler; |
---|
48 | |
---|
49 | /** The scheduler policy. */ |
---|
50 | int schedpolicy; |
---|
51 | |
---|
52 | /** The scheduler parameters */ |
---|
53 | struct sched_param schedparam; |
---|
54 | |
---|
55 | /** |
---|
56 | * @brief Control block for the sporadic server scheduling policy. |
---|
57 | */ |
---|
58 | struct { |
---|
59 | /** |
---|
60 | * @brief This is the timer which controls when the thread executes at high |
---|
61 | * and low priority when using the sporadic server scheduling policy. |
---|
62 | */ |
---|
63 | Watchdog_Control Timer; |
---|
64 | |
---|
65 | /** |
---|
66 | * @brief The low priority when using the sporadic server scheduling |
---|
67 | * policy. |
---|
68 | */ |
---|
69 | Priority_Node Low_priority; |
---|
70 | } Sporadic; |
---|
71 | |
---|
72 | /** This is the set of signals which are currently unblocked. */ |
---|
73 | sigset_t signals_unblocked; |
---|
74 | /** This is the set of signals which are currently pending. */ |
---|
75 | sigset_t signals_pending; |
---|
76 | |
---|
77 | /** |
---|
78 | * @brief Signal post-switch action in case signals are pending. |
---|
79 | */ |
---|
80 | Thread_Action Signal_action; |
---|
81 | } POSIX_API_Control; |
---|
82 | |
---|
83 | /** @} */ |
---|
84 | |
---|
85 | #ifdef __cplusplus |
---|
86 | } |
---|
87 | #endif |
---|
88 | |
---|
89 | #endif |
---|
90 | /* end of include file */ |
---|