RTEMS  5.1
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 
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 */
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:777
void rtems_interrupt_server_entry_destroy(rtems_interrupt_server_entry *entry)
Destroys the specified interrupt server entry.
Definition: irq-server.c:799
rtems_status_code rtems_interrupt_server_resume(uint32_t server_index)
Resumes the specified interrupt server.
Definition: irq-server.c:964
Definition: chain.h:68
uint32_t rtems_attribute
Definition: attr.h:41
Definition: deflate.c:115
#define RTEMS_INTERRUPT_LOCK_MEMBER(_designator)
Defines an interrupt lock member.
Definition: intr.h:209
An interrupt server entry.
Definition: irq-extension.h:337
uint32_t rtems_name
Classic API object name type.
Definition: types.h:77
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:741
Definition: chain.h:86
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:554
ISR_Vector_number rtems_vector_number
Control block type used to manage the vectors.
Definition: intr.h:47
rtems_mode modes
The initial task modes of the interrupt server.
Definition: irq-extension.h:309
struct rtems_interrupt_server_action rtems_interrupt_server_action
An interrupt server action.
An interrupt server control.
Definition: irq-extension.h:264
RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_destroy(rtems_interrupt_server_request *request)
Destroys the specified interrupt server request.
Definition: irq-extension.h:794
An interrupt server configuration.
Definition: irq-extension.h:279
size_t storage_size
The task storage size of the interrupt server.
Definition: irq-extension.h:304
rtems_attribute attributes
The task attributes of the interrupt server.
Definition: irq-extension.h:314
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:752
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:758
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:442
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:381
void * storage_area
The task storage area of the interrupt server.
Definition: irq-extension.h:296
uint32_t rtems_option
Definition: options.h:42
rtems_status_code rtems_interrupt_server_delete(uint32_t server_index)
Destroys the interrupt server.
Definition: irq-server.c:696
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.
Definition: irq-server.c:775
rtems_status_code rtems_interrupt_server_suspend(uint32_t server_index)
Suspends the specified interrupt server.
Definition: irq-server.c:943
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:826
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.
Definition: irq-server.c:633
Definition: intercom.c:74
Chain API.
rtems_task_priority priority
The initial task priority of the interrupt server.
Definition: irq-extension.h:288
void(* rtems_interrupt_per_handler_routine)(void *, const char *, rtems_option, rtems_interrupt_handler, void *)
Interrupt handler iteration routine type.
Definition: irq-extension.h:169
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...
Definition: irq-server.c:892
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:768
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
An interrupt server action.
Definition: irq-extension.h:245
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:40
An interrupt server request.
Definition: irq-extension.h:355
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:986
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:354
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
rtems_name name
The task name of the interrupt server.
Definition: irq-extension.h:283
uint32_t rtems_task_priority
Definition: tasks.h:55