RTEMS
intr.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 
11 /*
12  * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
13  * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions
17  * are met:
18  * 1. Redistributions of source code must retain the above copyright
19  * notice, this list of conditions and the following disclaimer.
20  * 2. Redistributions in binary form must reproduce the above copyright
21  * notice, this list of conditions and the following disclaimer in the
22  * documentation and/or other materials provided with the distribution.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  */
36 
37 /*
38  * Do not manually edit this file. It is part of the RTEMS quality process
39  * and was automatically generated.
40  *
41  * If you find something that needs to be fixed or worded better please
42  * post a report to an RTEMS mailing list or raise a bug report:
43  *
44  * https://docs.rtems.org/branches/master/user/support/bugs.html
45  *
46  * For information on updating and regenerating please refer to:
47  *
48  * https://docs.rtems.org/branches/master/eng/req/howto.html
49  */
50 
51 /* Generated from spec:/rtems/intr/if/header */
52 
53 #ifndef _RTEMS_RTEMS_INTR_H
54 #define _RTEMS_RTEMS_INTR_H
55 
56 #include <rtems/rtems/status.h>
57 #include <rtems/score/basedefs.h>
58 #include <rtems/score/cpu.h>
59 #include <rtems/score/isr.h>
60 #include <rtems/score/isrlevel.h>
61 #include <rtems/score/isrlock.h>
62 #include <rtems/score/smplock.h>
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
68 /* Generated from spec:/rtems/intr/if/group */
69 
83 /* Generated from spec:/rtems/intr/if/vector-number */
84 
91 
92 /* Generated from spec:/rtems/intr/if/isr-entry */
93 
100 #if CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE
101  typedef ISR_Handler_entry rtems_isr_entry;
102 #else
103  typedef void ( *rtems_isr_entry )( void * );
104 #endif
105 
106 /* Generated from spec:/rtems/intr/if/catch */
107 
120  rtems_isr_entry new_isr_handler,
121  rtems_vector_number vector,
122  rtems_isr_entry *old_isr_handler
123 );
124 
125 /* Generated from spec:/rtems/intr/if/cause */
126 
134 #define rtems_interrupt_cause( _interrupt_to_cause ) %
135 
136 /* Generated from spec:/rtems/intr/if/clear */
137 
145 #define rtems_interrupt_clear( _interrupt_to_clear ) %
146 
147 #if !defined(RTEMS_SMP)
148  /* Generated from spec:/rtems/intr/if/disable */
149 
157  #define rtems_interrupt_disable( _isr_cookie ) _ISR_Local_disable( _isr_cookie )
158 #endif
159 
160 #if !defined(RTEMS_SMP)
161  /* Generated from spec:/rtems/intr/if/enable */
162 
170  #define rtems_interrupt_enable( _isr_cookie ) _ISR_Local_enable( _isr_cookie )
171 #endif
172 
173 #if !defined(RTEMS_SMP)
174  /* Generated from spec:/rtems/intr/if/flash */
175 
183  #define rtems_interrupt_flash( _isr_cookie ) _ISR_Local_flash( _isr_cookie )
184 #endif
185 
186 /* Generated from spec:/rtems/intr/if/is-in-progress */
187 
193 #define rtems_interrupt_is_in_progress() _ISR_Is_in_progress()
194 
195 /* Generated from spec:/rtems/intr/if/isr */
196 
203 
204 /* Generated from spec:/rtems/intr/if/level */
205 
212 
213 /* Generated from spec:/rtems/intr/if/local-disable */
214 
222 #define rtems_interrupt_local_disable( _isr_cookie ) \
223  _ISR_Local_disable( _isr_cookie )
224 
225 /* Generated from spec:/rtems/intr/if/local-enable */
226 
234 #define rtems_interrupt_local_enable( _isr_cookie ) \
235  _ISR_Local_enable( _isr_cookie )
236 
237 /* Generated from spec:/rtems/intr/if/lock */
238 
245 
246 /* Generated from spec:/rtems/intr/if/lock-acquire */
247 
257 #define rtems_interrupt_lock_acquire( _lock, _lock_context ) \
258  _ISR_lock_ISR_disable_and_acquire( _lock, _lock_context )
259 
260 /* Generated from spec:/rtems/intr/if/lock-acquire-isr */
261 
271 #if defined(RTEMS_SMP)
272  #define rtems_interrupt_lock_acquire_isr( _lock, _lock_context ) \
273  _SMP_lock_Acquire( \
274  &( _lock )->Lock, \
275  &( _lock_context )->Lock_context \
276  )
277 #else
278  #define rtems_interrupt_lock_acquire_isr( _lock, _lock_context ) \
279  do { (void) _lock_context; } while ( 0 )
280 #endif
281 
282 /* Generated from spec:/rtems/intr/if/lock-context */
283 
290 
291 /* Generated from spec:/rtems/intr/if/lock-declare */
292 
302 #define RTEMS_INTERRUPT_LOCK_DECLARE( _qualifier, _designator ) \
303  ISR_LOCK_DECLARE( _qualifier, _designator )
304 
305 /* Generated from spec:/rtems/intr/if/lock-define */
306 
318 #define RTEMS_INTERRUPT_LOCK_DEFINE( _qualifier, _designator, _name ) \
319  ISR_LOCK_DEFINE( _qualifier, _designator, _name )
320 
321 /* Generated from spec:/rtems/intr/if/lock-destroy */
322 
330 #define rtems_interrupt_lock_destroy( _lock ) _ISR_lock_Destroy( _lock )
331 
332 /* Generated from spec:/rtems/intr/if/lock-initialize */
333 
343 #define rtems_interrupt_lock_initialize( _lock, _name ) \
344  _ISR_lock_Initialize( _lock, _name )
345 
346 /* Generated from spec:/rtems/intr/if/lock-initializer */
347 
355 #define RTEMS_INTERRUPT_LOCK_INITIALIZER( _name ) ISR_LOCK_INITIALIZER( _name )
356 
357 /* Generated from spec:/rtems/intr/if/lock-isr-disable */
358 
366 #define rtems_interrupt_lock_interrupt_disable( _lock_context ) \
367  _ISR_lock_ISR_disable( _lock_context )
368 
369 /* Generated from spec:/rtems/intr/if/lock-member */
370 
378 #define RTEMS_INTERRUPT_LOCK_MEMBER( _designator ) \
379  ISR_LOCK_MEMBER( _designator )
380 
381 /* Generated from spec:/rtems/intr/if/lock-reference */
382 
392 #define RTEMS_INTERRUPT_LOCK_REFERENCE( _designator, _target ) \
393  ISR_LOCK_REFERENCE( _designator, _target )
394 
395 /* Generated from spec:/rtems/intr/if/lock-release */
396 
406 #define rtems_interrupt_lock_release( _lock, _lock_context ) \
407  _ISR_lock_Release_and_ISR_enable( _lock, _lock_context )
408 
409 /* Generated from spec:/rtems/intr/if/lock-release-isr */
410 
420 #if defined(RTEMS_SMP)
421  #define rtems_interrupt_lock_release_isr( _lock, _lock_context ) \
422  _SMP_lock_Release( \
423  &( _lock )->Lock, \
424  &( _lock_context )->Lock_context \
425  )
426 #else
427  #define rtems_interrupt_lock_release_isr( _lock, _lock_context ) \
428  do { (void) _lock_context; } while ( 0 )
429 #endif
430 
431 #ifdef __cplusplus
432 }
433 #endif
434 
435 #endif /* _RTEMS_RTEMS_INTR_H */
Data Related to the Management of Processor Interrupt Levels.
ISR Level Type.
This header file defines the status codes and support functions of the Classic API.
ISR lock control.
Definition: isrlock.h:56
ISR_lock_Control rtems_interrupt_lock
%
Definition: intr.h:244
ISR_Level rtems_interrupt_level
%
Definition: intr.h:211
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
uint32_t ISR_Level
Definition: isrlevel.h:41
ISR_lock_Context rtems_interrupt_lock_context
%
Definition: intr.h:289
rtems_status_code rtems_interrupt_catch(rtems_isr_entry new_isr_handler, rtems_vector_number vector, rtems_isr_entry *old_isr_handler)
%
SPARC CPU Department Source.
SMP Lock API.
uint32_t ISR_Vector_number
Definition: isr.h:51
This header file provides basic definitions used by the API and the implementation.
void(* rtems_isr_entry)(void *)
Interrupt service routines installed by rtems_interrupt_catch() shall have this function pointer type...
Definition: intr.h:103
ISR_Handler rtems_isr
%
Definition: intr.h:202
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
ISR_Vector_number rtems_vector_number
%
Definition: intr.h:90
ISR Locks.
void ISR_Handler
Definition: isr.h:56