RTEMS 6.1-rc1
psignalimpl.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * COPYRIGHT (c) 1989-2013.
13 * On-Line Applications Research Corporation (OAR).
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _RTEMS_POSIX_PSIGNALIMPL_H
38#define _RTEMS_POSIX_PSIGNALIMPL_H
39
50#include <rtems/posix/psignal.h>
51#include <rtems/posix/pthread.h>
52#include <rtems/posix/sigset.h>
53#include <rtems/score/isrlock.h>
54#include <rtems/score/percpu.h>
56
57#define POSIX_SIGNALS_TQ_OPERATIONS &_Thread_queue_Operations_FIFO
58
59#define _States_Is_interruptible_signal( _states ) \
60 ( ((_states) & \
61 (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \
62 (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL))
63
64#define SIGACTION_TERMINATE \
65 { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abnormal_termination_handler} }
66#define SIGACTION_IGNORE \
67 { 0, SIGNAL_ALL_MASK, {SIG_IGN} }
68#define SIGACTION_STOP \
69 { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Stop_handler} }
70#define SIGACTION_CONTINUE \
71 { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Continue_handler} }
72
73#define SIG_ARRAY_MAX (SIGRTMAX + 1)
74
75/*
76 * Variables
77 */
78
79extern sigset_t _POSIX_signals_Pending;
80
81extern const struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ];
82
83extern struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ];
84
85extern Thread_queue_Control _POSIX_signals_Wait_queue;
86
87extern Chain_Control _POSIX_signals_Inactive_siginfo;
88
89extern Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ];
90
91/*
92 * Internal routines
93 */
94
95static inline void _POSIX_signals_Acquire(
96 Thread_queue_Context *queue_context
97)
98{
99 _Thread_queue_Acquire( &_POSIX_signals_Wait_queue, queue_context );
100}
101
102static inline void _POSIX_signals_Release(
103 Thread_queue_Context *queue_context
104)
105{
106 _Thread_queue_Release( &_POSIX_signals_Wait_queue, queue_context );
107}
108
113 Thread_Control *the_thread,
114 int signo,
115 siginfo_t *info
116);
117
122 POSIX_API_Control *api,
123 int signo,
124 siginfo_t *info,
125 bool is_global,
126 bool check_blocked,
127 bool do_signals_acquire_release
128);
129
130int _POSIX_signals_Send(
131 pid_t pid,
132 int sig,
133 const union sigval *value
134);
135
140 sigset_t mask
141);
142
143void _POSIX_signals_Clear_process_signals(
144 int signo
145);
146
147/*
148 * Default signal handlers
149 */
150
151#define _POSIX_signals_Stop_handler NULL
152#define _POSIX_signals_Continue_handler NULL
153
154void _POSIX_signals_Abnormal_termination_handler( int signo );
155
158#endif
159/* end of file */
bool _POSIX_signals_Unblock_thread(Thread_Control *the_thread, int signo, siginfo_t *info)
Unlock POSIX signals thread.
Definition: psignalunblockthread.c:196
void _POSIX_signals_Set_process_signals(sigset_t mask)
Set POSIX process signals.
Definition: psignalsetprocesssignals.c:51
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:56
This header file provides the interfaces of the ISR Locks.
Internal Information about POSIX Signals.
POSIX Threads Private Support.
This header file provides the interfaces of the Per-CPU Information.
POSIX Signal Sets Management Helper.
Thread queue context for the thread queue methods.
Definition: threadq.h:216
Definition: threadq.h:609
Definition: thread.h:812
This header file provides interfaces of the Thread Queue Handler which are only used by the implement...
This union represents a chain control block.
Definition: chain.h:96