RTEMS  5.0.0
irq-extension.h
Go to the documentation of this file.
1 
9 /*
10  * Based on concepts of Pavel Pisa, Till Straumann and Eric Valette.
11  *
12  * Copyright (c) 2008, 2017 embedded brains GmbH.
13  *
14  * embedded brains GmbH
15  * Dornierstr. 4
16  * 82178 Puchheim
17  * Germany
18  * <rtems@embedded-brains.de>
19  *
20  * The license and distribution terms for this file may be
21  * found in the file LICENSE in this distribution or at
22  * http://www.rtems.org/license/LICENSE.
23  */
24 
25 #ifndef RTEMS_IRQ_EXTENSION_H
26 #define RTEMS_IRQ_EXTENSION_H
27 
28 #include <rtems.h>
29 #include <rtems/chain.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34 
50 #define RTEMS_INTERRUPT_UNIQUE ((rtems_option) 0x00000001)
51 
56 #define RTEMS_INTERRUPT_SHARED ((rtems_option) 0x00000000)
57 
62 #define RTEMS_INTERRUPT_REPLACE ((rtems_option) 0x00000002)
63 
67 #define RTEMS_INTERRUPT_IS_UNIQUE( options) \
68  ((options) & RTEMS_INTERRUPT_UNIQUE)
69 
73 #define RTEMS_INTERRUPT_IS_SHARED( options) \
74  (!RTEMS_INTERRUPT_IS_UNIQUE( options))
75 
79 #define RTEMS_INTERRUPT_IS_REPLACE( options) \
80  ((options) & RTEMS_INTERRUPT_REPLACE)
81 
85 typedef void (*rtems_interrupt_handler)(void *);
86 
139  rtems_vector_number vector,
140  const char *info,
141  rtems_option options,
142  rtems_interrupt_handler handler,
143  void *arg
144 );
145 
165  rtems_vector_number vector,
166  rtems_interrupt_handler handler,
167  void *arg
168 );
169 
176  void *, const char *, rtems_option, rtems_interrupt_handler, void *
177 );
178 
201  rtems_vector_number vector,
203  void *arg
204 );
205 
220  rtems_vector_number vector,
221  size_t affinity_size,
222  const cpu_set_t *affinity
223 );
224 
238  rtems_vector_number vector,
239  size_t affinity_size,
240  cpu_set_t *affinity
241 );
242 
252  struct rtems_interrupt_server_action *next;
253  rtems_interrupt_handler handler;
254  void *arg;
256 
260 #define RTEMS_INTERRUPT_SERVER_DEFAULT 0
261 
273 typedef struct {
274  rtems_chain_node node;
275  void *server;
276  rtems_vector_number vector;
279 
291 typedef struct {
295 
324  rtems_task_priority priority,
325  size_t stack_size,
326  rtems_mode modes,
327  rtems_attribute attributes,
328  uint32_t *server_count
329 );
330 
349  uint32_t server_index,
350  rtems_vector_number vector,
351  const char *info,
352  rtems_option options,
353  rtems_interrupt_handler handler,
354  void *arg
355 );
356 
374  uint32_t server_index,
375  rtems_vector_number vector,
376  rtems_interrupt_handler handler,
377  void *arg
378 );
379 
396  uint32_t server_index,
397  rtems_vector_number vector,
399  void *arg
400 );
401 
423  uint32_t source_server_index,
424  rtems_vector_number vector,
425  uint32_t destination_server_index
426 );
427 
447 rtems_status_code rtems_interrupt_server_suspend( uint32_t server_index );
448 
465 rtems_status_code rtems_interrupt_server_resume( uint32_t server_index );
466 
497  uint32_t server_index,
498  size_t affinity_size,
499  const cpu_set_t *affinity,
500  rtems_task_priority priority
501 );
502 
517  uint32_t server_index,
519 );
520 
538  rtems_interrupt_handler handler,
539  void *arg
540 );
541 
561 );
562 
577 );
578 
595  uint32_t server_index,
597  rtems_interrupt_handler handler,
598  void *arg
599 );
600 
619  rtems_vector_number vector
620 )
621 {
622  request->entry.vector = vector;
623 }
624 
644 )
645 {
646  rtems_interrupt_server_entry_submit( &request->entry );
647 }
648 
661 )
662 {
663  rtems_interrupt_server_entry_destroy( &request->entry );
664 }
665 
668 #ifdef __cplusplus
669 }
670 #endif /* __cplusplus */
671 
672 #endif /* RTEMS_IRQ_EXTENSION_H */
RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_submit(rtems_interrupt_server_request *request)
Submits the specified interrupt server request so that its interrupt server action can be invoked by ...
Definition: irq-extension.h:642
void rtems_interrupt_server_entry_destroy(rtems_interrupt_server_entry *entry)
Destroys the specified interrupt server entry.
Definition: irq-server.c:648
rtems_status_code rtems_interrupt_server_resume(uint32_t server_index)
Resumes the specified interrupt server.
Definition: irq-server.c:813
Definition: chain.h:65
uint32_t rtems_attribute
Definition: attr.h:41
An interrupt server entry.
Definition: irq-extension.h:273
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
rtems_status_code rtems_interrupt_server_entry_initialize(uint32_t server_index, rtems_interrupt_server_entry *entry)
Initializes the specified interrupt server entry.
Definition: irq-server.c:607
rtems_status_code rtems_interrupt_handler_remove(rtems_vector_number vector, rtems_interrupt_handler handler, void *arg)
Removes the interrupt handler routine handler with argument arg for the interrupt vector with number ...
Definition: irq.c:175
rtems_status_code rtems_interrupt_handler_install(rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler handler, void *arg)
Installs the interrupt handler routine handler for the interrupt vector with number vector...
Definition: irq.c:127
rtems_status_code rtems_interrupt_server_initialize(rtems_task_priority priority, size_t stack_size, rtems_mode modes, rtems_attribute attributes, uint32_t *server_count)
Initializes the interrupt server tasks.
Definition: irq-server.c:490
ISR_Vector_number rtems_vector_number
Control block type used to manage the vectors.
Definition: intr.h:47
struct rtems_interrupt_server_action rtems_interrupt_server_action
An interrupt server action.
RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_destroy(rtems_interrupt_server_request *request)
Destroys the specified interrupt server request.
Definition: irq-extension.h:659
RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_set_vector(rtems_interrupt_server_request *request, rtems_vector_number vector)
Sets the interrupt vector in the specified interrupt server request.
Definition: irq-extension.h:617
void rtems_interrupt_server_action_prepend(rtems_interrupt_server_entry *entry, rtems_interrupt_server_action *action, rtems_interrupt_handler handler, void *arg)
Prepends the specified interrupt server action to the list of actions of the specified interrupt serv...
Definition: irq-server.c:624
rtems_status_code
Classic API Status.
Definition: status.h:43
rtems_status_code rtems_interrupt_get_affinity(rtems_vector_number vector, size_t affinity_size, cpu_set_t *affinity)
Gets the processor affinity set of an interrupt vector.
Definition: irq-generic.c:592
rtems_status_code rtems_interrupt_server_handler_iterate(uint32_t server_index, rtems_vector_number vector, rtems_interrupt_per_handler_routine routine, void *arg)
Iterates over all interrupt handler of the interrupt vector with number vector which are installed on...
Definition: irq-server.c:458
rtems_status_code rtems_interrupt_server_handler_remove(uint32_t server_index, rtems_vector_number vector, rtems_interrupt_handler handler, void *arg)
Removes the interrupt handler routine handler with argument arg for the interrupt vector with number ...
Definition: irq-server.c:397
uint32_t rtems_option
Definition: options.h:42
rtems_status_code rtems_interrupt_server_suspend(uint32_t server_index)
Suspends the specified interrupt server.
Definition: irq-server.c:792
rtems_status_code rtems_interrupt_server_request_initialize(uint32_t server_index, rtems_interrupt_server_request *request, rtems_interrupt_handler handler, void *arg)
Initializes the specified interrupt server request.
Definition: irq-server.c:675
Chain API.
void(* rtems_interrupt_per_handler_routine)(void *, const char *, rtems_option, rtems_interrupt_handler, void *)
Interrupt handler iteration routine type.
Definition: irq-extension.h:175
void(* rtems_interrupt_handler)(void *)
Interrupt handler routine type.
Definition: irq-extension.h:85
rtems_status_code rtems_interrupt_server_move(uint32_t source_server_index, rtems_vector_number vector, uint32_t destination_server_index)
Moves the interrupt handlers installed on the specified source interrupt server to the destination in...
Definition: irq-server.c:741
void rtems_interrupt_server_entry_submit(rtems_interrupt_server_entry *entry)
Submits the specified interrupt server entry so that its interrupt server actions can be invoked by t...
Definition: irq-server.c:634
An interrupt server action.
Definition: irq-extension.h:251
rtems_status_code rtems_interrupt_set_affinity(rtems_vector_number vector, size_t affinity_size, const cpu_set_t *affinity)
Sets the processor affinity set of an interrupt vector.
Definition: irq-generic.c:568
Definition: mmu-config.c:39
An interrupt server request.
Definition: irq-extension.h:291
rtems_status_code rtems_interrupt_handler_iterate(rtems_vector_number vector, rtems_interrupt_per_handler_routine routine, void *arg)
Iterates over all installed interrupt handler of the interrupt vector with number vector...
Definition: irq.c:210
rtems_status_code rtems_interrupt_server_set_affinity(uint32_t server_index, size_t affinity_size, const cpu_set_t *affinity, rtems_task_priority priority)
Sets the processor affinity of the specified interrupt server.
Definition: irq-server.c:835
uint32_t rtems_mode
Definition: modes.h:41
rtems_status_code rtems_interrupt_server_handler_install(uint32_t server_index, rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler handler, void *arg)
Installs the interrupt handler routine handler for the interrupt vector with number vector on the ser...
Definition: irq-server.c:370
uint32_t rtems_task_priority
Definition: tasks.h:54