RTEMS
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, 2020 embedded brains GmbH (http://www.embedded-brains.de)
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef RTEMS_IRQ_EXTENSION_H
20 #define RTEMS_IRQ_EXTENSION_H
21 
22 #include <rtems.h>
23 #include <rtems/chain.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28 
44 #define RTEMS_INTERRUPT_UNIQUE ((rtems_option) 0x00000001)
45 
50 #define RTEMS_INTERRUPT_SHARED ((rtems_option) 0x00000000)
51 
56 #define RTEMS_INTERRUPT_REPLACE ((rtems_option) 0x00000002)
57 
61 #define RTEMS_INTERRUPT_IS_UNIQUE( options) \
62  ((options) & RTEMS_INTERRUPT_UNIQUE)
63 
67 #define RTEMS_INTERRUPT_IS_SHARED( options) \
68  (!RTEMS_INTERRUPT_IS_UNIQUE( options))
69 
73 #define RTEMS_INTERRUPT_IS_REPLACE( options) \
74  ((options) & RTEMS_INTERRUPT_REPLACE)
75 
79 typedef void (*rtems_interrupt_handler)(void *);
80 
133  rtems_vector_number vector,
134  const char *info,
135  rtems_option options,
136  rtems_interrupt_handler handler,
137  void *arg
138 );
139 
159  rtems_vector_number vector,
160  rtems_interrupt_handler handler,
161  void *arg
162 );
163 
170  void *, const char *, rtems_option, rtems_interrupt_handler, void *
171 );
172 
195  rtems_vector_number vector,
197  void *arg
198 );
199 
214  rtems_vector_number vector,
215  size_t affinity_size,
216  const cpu_set_t *affinity
217 );
218 
232  rtems_vector_number vector,
233  size_t affinity_size,
234  cpu_set_t *affinity
235 );
236 
246  struct rtems_interrupt_server_action *next;
247  rtems_interrupt_handler handler;
248  void *arg;
250 
254 #define RTEMS_INTERRUPT_SERVER_DEFAULT 0
255 
266  rtems_chain_control entries;
267  rtems_id server;
268  unsigned long errors;
269  uint32_t index;
270  rtems_chain_node node;
271  void ( *destroy )( struct rtems_interrupt_server_control * );
273 
279 typedef struct {
284 
289 
297 
304  size_t storage_size;
305 
310 
315 
323  void ( *destroy )( rtems_interrupt_server_control * );
325 
337 typedef struct {
338  rtems_chain_node node;
339  void *server;
340  rtems_vector_number vector;
343 
355 typedef struct {
359 
391  rtems_task_priority priority,
392  size_t stack_size,
393  rtems_mode modes,
394  rtems_attribute attributes,
395  uint32_t *server_count
396 );
397 
423  const rtems_interrupt_server_config *config,
424  uint32_t *server_index
425 );
426 
444 rtems_status_code rtems_interrupt_server_delete( uint32_t server_index );
445 
464  uint32_t server_index,
465  rtems_vector_number vector,
466  const char *info,
467  rtems_option options,
468  rtems_interrupt_handler handler,
469  void *arg
470 );
471 
489  uint32_t server_index,
490  rtems_vector_number vector,
491  rtems_interrupt_handler handler,
492  void *arg
493 );
494 
511  uint32_t server_index,
512  rtems_vector_number vector,
514  void *arg
515 );
516 
538  uint32_t source_server_index,
539  rtems_vector_number vector,
540  uint32_t destination_server_index
541 );
542 
562 rtems_status_code rtems_interrupt_server_suspend( uint32_t server_index );
563 
580 rtems_status_code rtems_interrupt_server_resume( uint32_t server_index );
581 
612  uint32_t server_index,
613  size_t affinity_size,
614  const cpu_set_t *affinity,
615  rtems_task_priority priority
616 );
617 
632  uint32_t server_index,
634 );
635 
653  rtems_interrupt_handler handler,
654  void *arg
655 );
656 
676 );
677 
697  uint32_t destination_server_index
698 );
699 
712 );
713 
730  uint32_t server_index,
732  rtems_interrupt_handler handler,
733  void *arg
734 );
735 
754  rtems_vector_number vector
755 )
756 {
757  request->entry.vector = vector;
758 }
759 
779 )
780 {
781  rtems_interrupt_server_entry_submit( &request->entry );
782 }
783 
796 )
797 {
798  rtems_interrupt_server_entry_destroy( &request->entry );
799 }
800 
803 #ifdef __cplusplus
804 }
805 #endif /* __cplusplus */
806 
807 #endif /* RTEMS_IRQ_EXTENSION_H */
void rtems_interrupt_server_entry_destroy(rtems_interrupt_server_entry *entry)
Destroys the specified interrupt server entry.
rtems_status_code rtems_interrupt_server_resume(uint32_t server_index)
Resumes the specified interrupt server.
#define RTEMS_INTERRUPT_LOCK_MEMBER(_designator)
%
Definition: intr.h:378
static __inline__ 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 ...
An interrupt server entry.
uint32_t rtems_name
This type is used to represent a Classic API object name.
Definition: types.h:227
uint32_t rtems_option
This type is used to represent an option set.
Definition: options.h:121
rtems_status_code rtems_interrupt_server_entry_initialize(uint32_t server_index, rtems_interrupt_server_entry *entry)
Initializes the specified interrupt server entry.
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-generic.c:531
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-generic.c:520
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.
rtems_mode modes
The initial task modes of the interrupt server.
struct rtems_interrupt_server_action rtems_interrupt_server_action
An interrupt server action.
An interrupt server control.
static __inline__ void rtems_interrupt_server_request_destroy(rtems_interrupt_server_request *request)
Destroys the specified interrupt server request.
uint32_t rtems_task_priority
%
Definition: tasks.h:94
An interrupt server configuration.
size_t storage_size
The task storage size of the interrupt server.
rtems_attribute attributes
The task attributes of the interrupt server.
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...
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...
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
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 ...
void * storage_area
The task storage area of the interrupt server.
rtems_status_code rtems_interrupt_server_delete(uint32_t server_index)
Destroys the interrupt server.
struct rtems_interrupt_server_control rtems_interrupt_server_control
An interrupt server control.
rtems_status_code rtems_interrupt_server_entry_move(rtems_interrupt_server_entry *entry, uint32_t destination_server_index)
Moves the interrupt server entry to the specified destination interrupt server.
rtems_status_code rtems_interrupt_server_suspend(uint32_t server_index)
Suspends the specified interrupt server.
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.
rtems_status_code rtems_interrupt_server_create(rtems_interrupt_server_control *control, const rtems_interrupt_server_config *config, uint32_t *server_index)
Creates an interrupt server.
Chain API.
This header file defines the RTEMS Classic API.
uint32_t rtems_attribute
This type is used to represent Classic API attributes.
Definition: attr.h:91
uint32_t rtems_mode
This type is used to represent a task mode set.
Definition: modes.h:90
rtems_task_priority priority
The initial task priority of the interrupt server.
void(* rtems_interrupt_per_handler_routine)(void *, const char *, rtems_option, rtems_interrupt_handler, void *)
Interrupt handler iteration routine type.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
void(* rtems_interrupt_handler)(void *)
Interrupt handler routine type.
Definition: irq-extension.h:79
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...
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...
An interrupt server action.
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
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
Definition: basedefs.h:683
ISR_Vector_number rtems_vector_number
%
Definition: intr.h:90
An interrupt server request.
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-generic.c:540
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.
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...
static __inline__ 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.
rtems_name name
The task name of the interrupt server.