source: rtems/c/src/exec/posix/headers/intr.h @ 5e9b32b

4.104.114.84.95
Last change on this file since 5e9b32b was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/95 at 19:27:15

posix support initially added

  • Property mode set to 100644
File size: 3.5 KB
Line 
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, 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 __RTEMS_POSIX_KEY_h
18#define __RTEMS_POSIX_KEY_h
19 
20#ifdef __cplusplus
21extern "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
31typedef 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 
42typedef 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 
56EXTERN 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
63EXTERN 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 
74void _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 
87STATIC INLINE 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 
99STATIC INLINE 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 
117STATIC INLINE 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 
130STATIC INLINE 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 
142void _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
Note: See TracBrowser for help on using the repository browser.