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

4.104.114.84.95
Last change on this file since 9700578 was 9700578, checked in by Joel Sherrill <joel.sherrill@…>, on 10/30/95 at 21:54:45

SPARC port passes all tests

  • 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 _POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ];
64 
65/*
66 *  _POSIX_Interrupt_Manager_initialization
67 *
68 *  DESCRIPTION:
69 *
70 *  This routine performs the initialization necessary for this manager.
71 */
72 
73void _POSIX_Interrupt_Manager_initialization(
74  unsigned32  maximum_interrupt_handlers
75);
76 
77/*
78 *  _POSIX_Interrupt_Allocate
79 *
80 *  DESCRIPTION:
81 *
82 *  This function allocates a interrupt handler control block from
83 *  the inactive chain of free interrupt handler control blocks.
84 */
85 
86STATIC INLINE POSIX_Interrupt_Handler_control *
87  _POSIX_Interrupt_Allocate( void );
88 
89/*
90 *  _POSIX_Interrupt_Free
91 *
92 *  DESCRIPTION:
93 *
94 *  This routine frees a interrupt handler control block to the
95 *  inactive chain of free interrupt handler control blocks.
96 */
97 
98STATIC INLINE void _POSIX_Interrupt_Free (
99  POSIX_Interrupt_Handler_control *the_intr
100);
101 
102/*
103 *  _POSIX_Interrupt_Get
104 *
105 *  DESCRIPTION:
106 *
107 *  This function maps interrupt handler IDs to interrupt handler control
108 *  blocks.  If ID corresponds to a local interrupt handler, then it returns
109 *  the_intr control pointer which maps to ID and location
110 *  is set to OBJECTS_LOCAL.  if the interrupt handler ID is global and
111 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
112 *  and the_intr is undefined.  Otherwise, location is set
113 *  to OBJECTS_ERROR and the_intr is undefined.
114 */
115 
116STATIC INLINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
117  Objects_Id         id,
118  Objects_Locations *location
119);
120 
121/*
122 *  _POSIX_Interrupt_Is_null
123 *
124 *  DESCRIPTION:
125 *
126 *  This function returns TRUE if the_intr is NULL and FALSE otherwise.
127 */
128 
129STATIC INLINE boolean _POSIX_Interrupt_Is_null (
130  POSIX_Interrupt_Handler_control *the_intr
131);
132 
133/*
134 *  _POSIX_Interrupt_Handler
135 *
136 *  DESCRIPTION:
137 *
138 *  This function XXX.
139 */
140 
141void _POSIX_Interrupt_Handler(
142  ISR_Vector_number   vector
143);
144
145#include <rtems/posix/intr.inl>
146
147#ifdef __cplusplus
148}
149#endif
150 
151#endif
152/*  end of include file */
153
Note: See TracBrowser for help on using the repository browser.