[ac7d5ef0] | 1 | /* inline/asr.inl |
---|
| 2 | * |
---|
| 3 | * This include file contains the implemenation of all routines |
---|
| 4 | * associated with the asynchronous signal handler which are inlined. |
---|
| 5 | * |
---|
| 6 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 7 | * On-Line Applications Research Corporation (OAR). |
---|
| 8 | * All rights assigned to U.S. Government, 1994. |
---|
| 9 | * |
---|
| 10 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 11 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 12 | * notice must appear in all copies of this file and its derivatives. |
---|
| 13 | * |
---|
| 14 | * $Id$ |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | #ifndef __INLINE_ASR_inl |
---|
| 18 | #define __INLINE_ASR_inl |
---|
| 19 | |
---|
| 20 | #include <rtems/isr.h> |
---|
| 21 | |
---|
| 22 | /*PAGE |
---|
| 23 | * |
---|
| 24 | * _ASR_Initialize |
---|
| 25 | * |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | STATIC INLINE void _ASR_Initialize ( |
---|
| 29 | ASR_Information *information |
---|
| 30 | ) |
---|
| 31 | { |
---|
| 32 | information->handler = NULL; |
---|
| 33 | information->mode_set = RTEMS_DEFAULT_MODES; |
---|
| 34 | information->signals_posted = 0; |
---|
| 35 | information->signals_pending = 0; |
---|
| 36 | information->nest_level = 0; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | /*PAGE |
---|
| 40 | * |
---|
| 41 | * _ASR_Swap_signals |
---|
| 42 | * |
---|
| 43 | */ |
---|
| 44 | |
---|
| 45 | STATIC INLINE void _ASR_Swap_signals ( |
---|
| 46 | ASR_Information *information |
---|
| 47 | ) |
---|
| 48 | { |
---|
| 49 | rtems_signal_set _signals; |
---|
| 50 | ISR_Level _level; |
---|
| 51 | |
---|
| 52 | _ISR_Disable( _level ); |
---|
| 53 | _signals = information->signals_pending; |
---|
| 54 | information->signals_pending = information->signals_posted; |
---|
| 55 | information->signals_posted = _signals; |
---|
| 56 | _ISR_Enable( _level ); |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | /*PAGE |
---|
| 60 | * |
---|
| 61 | * _ASR_Is_null_handler |
---|
| 62 | * |
---|
| 63 | */ |
---|
| 64 | |
---|
| 65 | STATIC INLINE boolean _ASR_Is_null_handler ( |
---|
| 66 | rtems_asr_entry asr_handler |
---|
| 67 | ) |
---|
| 68 | { |
---|
| 69 | return asr_handler == NULL; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | /*PAGE |
---|
| 73 | * |
---|
| 74 | * _ASR_Are_signals_pending |
---|
| 75 | * |
---|
| 76 | */ |
---|
| 77 | |
---|
| 78 | STATIC INLINE boolean _ASR_Are_signals_pending ( |
---|
| 79 | ASR_Information *information |
---|
| 80 | ) |
---|
| 81 | { |
---|
| 82 | return information->signals_posted != 0; |
---|
| 83 | } |
---|
| 84 | |
---|
| 85 | /*PAGE |
---|
| 86 | * |
---|
| 87 | * _ASR_Post_signals |
---|
| 88 | * |
---|
| 89 | */ |
---|
| 90 | |
---|
| 91 | STATIC INLINE void _ASR_Post_signals( |
---|
| 92 | rtems_signal_set signals, |
---|
| 93 | rtems_signal_set *signal_set |
---|
| 94 | ) |
---|
| 95 | { |
---|
| 96 | ISR_Level _level; |
---|
| 97 | |
---|
| 98 | _ISR_Disable( _level ); |
---|
| 99 | *signal_set |= signals; |
---|
| 100 | _ISR_Enable( _level ); |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | #endif |
---|
| 105 | /* end of include file */ |
---|