1 | /* macros/asr.h |
---|
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_h |
---|
18 | #define __INLINE_ASR_h |
---|
19 | |
---|
20 | #include <rtems/isr.h> |
---|
21 | |
---|
22 | /*PAGE |
---|
23 | * |
---|
24 | * _ASR_Initialize |
---|
25 | * |
---|
26 | */ |
---|
27 | |
---|
28 | #define _ASR_Initialize( _information ) \ |
---|
29 | { \ |
---|
30 | (_information)->handler = NULL; \ |
---|
31 | (_information)->mode_set = RTEMS_DEFAULT_MODES; \ |
---|
32 | (_information)->signals_posted = 0; \ |
---|
33 | (_information)->signals_pending = 0; \ |
---|
34 | (_information)->nest_level = 0; \ |
---|
35 | } |
---|
36 | |
---|
37 | /*PAGE |
---|
38 | * |
---|
39 | * _ASR_Swap_signals |
---|
40 | * |
---|
41 | */ |
---|
42 | |
---|
43 | #define _ASR_Swap_signals( _information ) \ |
---|
44 | { \ |
---|
45 | rtems_signal_set _signals; \ |
---|
46 | ISR_Level _level; \ |
---|
47 | \ |
---|
48 | _ISR_Disable( _level ); \ |
---|
49 | _signals = (_information)->signals_pending; \ |
---|
50 | (_information)->signals_pending = (_information)->signals_posted; \ |
---|
51 | (_information)->signals_posted = _signals; \ |
---|
52 | _ISR_Enable( _level ); \ |
---|
53 | } |
---|
54 | |
---|
55 | /*PAGE |
---|
56 | * |
---|
57 | * _ASR_Is_null_handler |
---|
58 | * |
---|
59 | */ |
---|
60 | |
---|
61 | #define _ASR_Is_null_handler( _asr_handler ) \ |
---|
62 | ( (_asr_handler) == NULL ) |
---|
63 | |
---|
64 | /*PAGE |
---|
65 | * |
---|
66 | * _ASR_Are_signals_pending |
---|
67 | * |
---|
68 | */ |
---|
69 | |
---|
70 | #define _ASR_Are_signals_pending( _information ) \ |
---|
71 | ( (_information)->signals_posted != 0 ) |
---|
72 | |
---|
73 | /*PAGE |
---|
74 | * |
---|
75 | * _ASR_Post_signals |
---|
76 | * |
---|
77 | */ |
---|
78 | |
---|
79 | #define _ASR_Post_signals( _signals, _signal_set ) \ |
---|
80 | do { \ |
---|
81 | ISR_Level _level; \ |
---|
82 | \ |
---|
83 | _ISR_Disable( _level ); \ |
---|
84 | *(_signal_set) |= (_signals); \ |
---|
85 | _ISR_Enable( _level ); \ |
---|
86 | } while ( 0 ) |
---|
87 | |
---|
88 | #endif |
---|
89 | /* end of include file */ |
---|