diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-12-03 11:35:43 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-12-05 18:07:05 +0100 |
commit | f9340ed7f43b81e172ebefebbb9fbd558080d1a3 (patch) | |
tree | a5ccd69f10430edd1a8bb4361594c509fdbfb08c /cpukit/posix/include | |
parent | rtems: Add signal post switch extension on the fly (diff) | |
download | rtems-f9340ed7f43b81e172ebefebbb9fbd558080d1a3.tar.bz2 |
posix: Add and use <rtems/posix/psignalimpl.h>
This file contains the parts of <rtems/posix/psignal.h> that are only
necessary for the POSIX API implementation.
Diffstat (limited to 'cpukit/posix/include')
-rw-r--r-- | cpukit/posix/include/rtems/posix/psignal.h | 92 | ||||
-rw-r--r-- | cpukit/posix/include/rtems/posix/psignalimpl.h | 113 |
2 files changed, 115 insertions, 90 deletions
diff --git a/cpukit/posix/include/rtems/posix/psignal.h b/cpukit/posix/include/rtems/posix/psignal.h index c630c1fd5f..604b98982c 100644 --- a/cpukit/posix/include/rtems/posix/psignal.h +++ b/cpukit/posix/include/rtems/posix/psignal.h @@ -16,44 +16,9 @@ #ifndef _RTEMS_POSIX_PSIGNAL_H #define _RTEMS_POSIX_PSIGNAL_H -#include <rtems/posix/pthread.h> -#include <rtems/posix/sigset.h> +#include <sys/signal.h> -#define _States_Is_interruptible_signal( _states ) \ - ( ((_states) & \ - (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \ - (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) - -#define SIGACTION_TERMINATE \ - { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abnormal_termination_handler} } -#define SIGACTION_IGNORE \ - { 0, SIGNAL_ALL_MASK, {SIG_IGN} } -#define SIGACTION_STOP \ - { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Stop_handler} } -#define SIGACTION_CONTINUE \ - { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Continue_handler} } - -#define SIG_ARRAY_MAX (SIGRTMAX + 1) - -/* - * Variables - */ - -extern sigset_t _POSIX_signals_Pending; - -extern const struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ]; - -extern struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ]; - -extern Watchdog_Control _POSIX_signals_Alarm_timer; - -extern Watchdog_Control _POSIX_signals_Ualarm_timer; - -extern Thread_queue_Control _POSIX_signals_Wait_queue; - -extern Chain_Control _POSIX_signals_Inactive_siginfo; - -extern Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ]; +#include <rtems/score/chain.h> /* * POSIX internal siginfo structure @@ -64,58 +29,5 @@ typedef struct { siginfo_t Info; } POSIX_signals_Siginfo_node; -/* - * Internal routines - */ - -void _POSIX_signals_Manager_Initialization(void); - -void _POSIX_signals_Post_switch_extension( - Thread_Control *the_thread -); - -bool _POSIX_signals_Unblock_thread( - Thread_Control *the_thread, - int signo, - siginfo_t *info -); - -bool _POSIX_signals_Check_signal( - POSIX_API_Control *api, - int signo, - bool is_global -); - -bool _POSIX_signals_Clear_signals( - POSIX_API_Control *api, - int signo, - siginfo_t *info, - bool is_global, - bool check_blocked -); - -int killinfo( - pid_t pid, - int sig, - const union sigval *value -); - -void _POSIX_signals_Set_process_signals( - sigset_t mask -); - -void _POSIX_signals_Clear_process_signals( - int signo -); - -/* - * Default signal handlers - */ - -#define _POSIX_signals_Stop_handler NULL -#define _POSIX_signals_Continue_handler NULL - -void _POSIX_signals_Abnormal_termination_handler( int signo ); - #endif /* end of file */ diff --git a/cpukit/posix/include/rtems/posix/psignalimpl.h b/cpukit/posix/include/rtems/posix/psignalimpl.h new file mode 100644 index 0000000000..e61fe3f74b --- /dev/null +++ b/cpukit/posix/include/rtems/posix/psignalimpl.h @@ -0,0 +1,113 @@ +/** + * @file rtems/posix/psignal.h + * + * This include file defines internal information about POSIX signals. + */ + +/* + * COPYRIGHT (c) 1989-2011. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#ifndef _RTEMS_POSIX_PSIGNALIMPL_H +#define _RTEMS_POSIX_PSIGNALIMPL_H + +#include <rtems/posix/psignal.h> +#include <rtems/posix/pthread.h> +#include <rtems/posix/sigset.h> + +#define _States_Is_interruptible_signal( _states ) \ + ( ((_states) & \ + (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \ + (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) + +#define SIGACTION_TERMINATE \ + { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abnormal_termination_handler} } +#define SIGACTION_IGNORE \ + { 0, SIGNAL_ALL_MASK, {SIG_IGN} } +#define SIGACTION_STOP \ + { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Stop_handler} } +#define SIGACTION_CONTINUE \ + { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Continue_handler} } + +#define SIG_ARRAY_MAX (SIGRTMAX + 1) + +/* + * Variables + */ + +extern sigset_t _POSIX_signals_Pending; + +extern const struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ]; + +extern struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ]; + +extern Watchdog_Control _POSIX_signals_Alarm_timer; + +extern Watchdog_Control _POSIX_signals_Ualarm_timer; + +extern Thread_queue_Control _POSIX_signals_Wait_queue; + +extern Chain_Control _POSIX_signals_Inactive_siginfo; + +extern Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ]; + +/* + * Internal routines + */ + +void _POSIX_signals_Manager_Initialization(void); + +void _POSIX_signals_Post_switch_extension( + Thread_Control *the_thread +); + +bool _POSIX_signals_Unblock_thread( + Thread_Control *the_thread, + int signo, + siginfo_t *info +); + +bool _POSIX_signals_Check_signal( + POSIX_API_Control *api, + int signo, + bool is_global +); + +bool _POSIX_signals_Clear_signals( + POSIX_API_Control *api, + int signo, + siginfo_t *info, + bool is_global, + bool check_blocked +); + +int killinfo( + pid_t pid, + int sig, + const union sigval *value +); + +void _POSIX_signals_Set_process_signals( + sigset_t mask +); + +void _POSIX_signals_Clear_process_signals( + int signo +); + +/* + * Default signal handlers + */ + +#define _POSIX_signals_Stop_handler NULL +#define _POSIX_signals_Continue_handler NULL + +void _POSIX_signals_Abnormal_termination_handler( int signo ); + +#endif +/* end of file */ |