RTEMS  5.1
psignalimpl.h
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2013.
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_PSIGNALIMPL_H
19 #define _RTEMS_POSIX_PSIGNALIMPL_H
20 
31 #include <rtems/posix/psignal.h>
32 #include <rtems/posix/pthread.h>
33 #include <rtems/posix/sigset.h>
34 #include <rtems/score/isrlock.h>
35 #include <rtems/score/percpu.h>
37 
38 #define POSIX_SIGNALS_TQ_OPERATIONS &_Thread_queue_Operations_FIFO
39 
40 #define _States_Is_interruptible_signal( _states ) \
41  ( ((_states) & \
42  (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \
43  (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL))
44 
45 #define SIGACTION_TERMINATE \
46  { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abnormal_termination_handler} }
47 #define SIGACTION_IGNORE \
48  { 0, SIGNAL_ALL_MASK, {SIG_IGN} }
49 #define SIGACTION_STOP \
50  { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Stop_handler} }
51 #define SIGACTION_CONTINUE \
52  { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Continue_handler} }
53 
54 #define SIG_ARRAY_MAX (SIGRTMAX + 1)
55 
56 /*
57  * Variables
58  */
59 
60 extern sigset_t _POSIX_signals_Pending;
61 
62 extern const struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ];
63 
64 extern struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ];
65 
66 extern Thread_queue_Control _POSIX_signals_Wait_queue;
67 
68 extern Chain_Control _POSIX_signals_Inactive_siginfo;
69 
70 extern Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ];
71 
72 /*
73  * Internal routines
74  */
75 
76 RTEMS_INLINE_ROUTINE void _POSIX_signals_Acquire(
77  Thread_queue_Context *queue_context
78 )
79 {
80  _Thread_queue_Acquire( &_POSIX_signals_Wait_queue, queue_context );
81 }
82 
83 RTEMS_INLINE_ROUTINE void _POSIX_signals_Release(
84  Thread_queue_Context *queue_context
85 )
86 {
87  _Thread_queue_Release( &_POSIX_signals_Wait_queue, queue_context );
88 }
89 
94  Thread_Control *the_thread,
95  int signo,
96  siginfo_t *info
97 );
98 
103  POSIX_API_Control *api,
104  int signo,
105  siginfo_t *info,
106  bool is_global,
107  bool check_blocked,
108  bool do_signals_acquire_release
109 );
110 
111 int _POSIX_signals_Send(
112  pid_t pid,
113  int sig,
114  const union sigval *value
115 );
116 
121  sigset_t mask
122 );
123 
124 void _POSIX_signals_Clear_process_signals(
125  int signo
126 );
127 
128 /*
129  * Default signal handlers
130  */
131 
132 #define _POSIX_signals_Stop_handler NULL
133 #define _POSIX_signals_Continue_handler NULL
134 
135 void _POSIX_signals_Abnormal_termination_handler( int signo );
136 
139 #endif
140 /* end of file */
bool _POSIX_signals_Unblock_thread(Thread_Control *the_thread, int signo, siginfo_t *info)
Unlock POSIX signals thread.
Definition: psignalunblockthread.c:183
Thread queue context for the thread queue methods.
Definition: threadq.h:198
Definition: chain.h:86
POSIX Threads Private Support.
Definition: threadq.h:552
Internal Information about POSIX Signals.
Definition: thread.h:732
Constants and Structures Associated with the Manipulation of Objects.
POSIX Signal Sets Management Helper.
bool _POSIX_signals_Clear_signals(POSIX_API_Control *api, int signo, siginfo_t *info, bool is_global, bool check_blocked, bool do_signals_acquire_release)
Clear POSIX signals.
Definition: psignalclearsignals.c:39
RTEMS_INLINE_ROUTINE void _Thread_queue_Release(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Releases the thread queue control and enables interrupts.
Definition: threadqimpl.h:787
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
void _POSIX_signals_Set_process_signals(sigset_t mask)
Set POSIX process signals.
Definition: psignalsetprocesssignals.c:34
ISR Locks.
RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Acquires the thread queue control in a critical section.
Definition: threadqimpl.h:704