1 | /* rtems/posix/intr.h |
---|
2 | * |
---|
3 | * This include file contains all the private support information for |
---|
4 | * POSIX Interrupt Manager. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-1997. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * Copyright assigned to U.S. Government, 1994. |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may in |
---|
11 | * the file LICENSE in this distribution or at |
---|
12 | * http://www.OARcorp.com/rtems/license.html. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef __RTEMS_POSIX_KEY_h |
---|
18 | #define __RTEMS_POSIX_KEY_h |
---|
19 | |
---|
20 | #ifdef __cplusplus |
---|
21 | extern "C" { |
---|
22 | #endif |
---|
23 | |
---|
24 | #include <rtems/score/isr.h> |
---|
25 | #include <rtems/score/object.h> |
---|
26 | |
---|
27 | /* |
---|
28 | * Data Structure used to manage each POSIX Interrupt Vector |
---|
29 | */ |
---|
30 | |
---|
31 | typedef struct { |
---|
32 | int number_installed; |
---|
33 | int lock_count; |
---|
34 | int deferred_count; |
---|
35 | Chain_Control Handlers; |
---|
36 | } POSIX_Interrupt_Control; |
---|
37 | |
---|
38 | /* |
---|
39 | * Data Structure used to manage a POSIX Interrupt Handler |
---|
40 | */ |
---|
41 | |
---|
42 | typedef struct { |
---|
43 | Objects_Control Object; |
---|
44 | int is_active; |
---|
45 | intr_t vector; |
---|
46 | Thread_Control *server; |
---|
47 | int (*handler)( void *area ); |
---|
48 | volatile void *user_data_area; |
---|
49 | } POSIX_Interrupt_Handler_control; |
---|
50 | |
---|
51 | /* |
---|
52 | * The following defines the information control block used to manage |
---|
53 | * this class of objects. |
---|
54 | */ |
---|
55 | |
---|
56 | POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information; |
---|
57 | |
---|
58 | /* |
---|
59 | * The following is an array which is used to manage the set of |
---|
60 | * interrupt handlers installed on each vector. |
---|
61 | */ |
---|
62 | |
---|
63 | POSIX_EXTERN POSIX_Interrupt_Control |
---|
64 | _POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ]; |
---|
65 | |
---|
66 | /* |
---|
67 | * _POSIX_Interrupt_Manager_initialization |
---|
68 | * |
---|
69 | * DESCRIPTION: |
---|
70 | * |
---|
71 | * This routine performs the initialization necessary for this manager. |
---|
72 | */ |
---|
73 | |
---|
74 | void _POSIX_Interrupt_Manager_initialization( |
---|
75 | unsigned32 maximum_interrupt_handlers |
---|
76 | ); |
---|
77 | |
---|
78 | /* |
---|
79 | * _POSIX_Interrupt_Allocate |
---|
80 | * |
---|
81 | * DESCRIPTION: |
---|
82 | * |
---|
83 | * This function allocates a interrupt handler control block from |
---|
84 | * the inactive chain of free interrupt handler control blocks. |
---|
85 | */ |
---|
86 | |
---|
87 | RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control * |
---|
88 | _POSIX_Interrupt_Allocate( void ); |
---|
89 | |
---|
90 | /* |
---|
91 | * _POSIX_Interrupt_Free |
---|
92 | * |
---|
93 | * DESCRIPTION: |
---|
94 | * |
---|
95 | * This routine frees a interrupt handler control block to the |
---|
96 | * inactive chain of free interrupt handler control blocks. |
---|
97 | */ |
---|
98 | |
---|
99 | RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free ( |
---|
100 | POSIX_Interrupt_Handler_control *the_intr |
---|
101 | ); |
---|
102 | |
---|
103 | /* |
---|
104 | * _POSIX_Interrupt_Get |
---|
105 | * |
---|
106 | * DESCRIPTION: |
---|
107 | * |
---|
108 | * This function maps interrupt handler IDs to interrupt handler control |
---|
109 | * blocks. If ID corresponds to a local interrupt handler, then it returns |
---|
110 | * the_intr control pointer which maps to ID and location |
---|
111 | * is set to OBJECTS_LOCAL. if the interrupt handler ID is global and |
---|
112 | * resides on a remote node, then location is set to OBJECTS_REMOTE, |
---|
113 | * and the_intr is undefined. Otherwise, location is set |
---|
114 | * to OBJECTS_ERROR and the_intr is undefined. |
---|
115 | */ |
---|
116 | |
---|
117 | RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get ( |
---|
118 | Objects_Id id, |
---|
119 | Objects_Locations *location |
---|
120 | ); |
---|
121 | |
---|
122 | /* |
---|
123 | * _POSIX_Interrupt_Is_null |
---|
124 | * |
---|
125 | * DESCRIPTION: |
---|
126 | * |
---|
127 | * This function returns TRUE if the_intr is NULL and FALSE otherwise. |
---|
128 | */ |
---|
129 | |
---|
130 | RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null ( |
---|
131 | POSIX_Interrupt_Handler_control *the_intr |
---|
132 | ); |
---|
133 | |
---|
134 | /* |
---|
135 | * _POSIX_Interrupt_Handler |
---|
136 | * |
---|
137 | * DESCRIPTION: |
---|
138 | * |
---|
139 | * This function XXX. |
---|
140 | */ |
---|
141 | |
---|
142 | void _POSIX_Interrupt_Handler( |
---|
143 | ISR_Vector_number vector |
---|
144 | ); |
---|
145 | |
---|
146 | #include <rtems/posix/intr.inl> |
---|
147 | |
---|
148 | #ifdef __cplusplus |
---|
149 | } |
---|
150 | #endif |
---|
151 | |
---|
152 | #endif |
---|
153 | /* end of include file */ |
---|
154 | |
---|