source: rtems/cpukit/include/rtems/irq-extension.h @ 8777d4c

5
Last change on this file since 8777d4c was 8777d4c, checked in by Sebastian Huber <sebastian.huber@…>, on 10/04/18 at 09:29:03

Add rtems_interrupt_server_request_set_vector()

By default, the interrupt vector of an interrupt server request is set
to a special value which is outside the range of vectors supported by
the interrupt controller hardware.

Add rtems_interrupt_server_request_set_vector() to set the interrupt
vector in an interrupt server request.

Calls to rtems_interrupt_server_request_submit() will disable the interrupt
vector of the request. After processing of the request by the interrupt
server the interrupt vector will be enabled again.

  • Property mode set to 100644
File size: 23.7 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup rtems_interrupt_extension
5 *
6 * @brief Header file for the Interrupt Manager Extension.
7 */
8
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
32extern "C" {
33#endif /* __cplusplus */
34
35/**
36 * @defgroup rtems_interrupt_extension Interrupt Manager Extension
37 *
38 * @ingroup ClassicINTR
39 *
40 * In addition to the Classic API interrupt handler with a handle are
41 * supported.  You can also install multiple shared handler for one interrupt
42 * vector.
43 */
44/**@{**/
45
46/**
47 * @brief Makes the interrupt handler unique.  Prevents other handler from
48 * using the same interrupt vector.
49 */
50#define RTEMS_INTERRUPT_UNIQUE ((rtems_option) 0x00000001)
51
52/**
53 * @brief Allows that this interrupt handler may share a common interrupt
54 * vector with other handler.
55 */
56#define RTEMS_INTERRUPT_SHARED ((rtems_option) 0x00000000)
57
58/**
59 * @brief Forces that this interrupt handler replaces the first handler with
60 * the same argument.
61 */
62#define RTEMS_INTERRUPT_REPLACE ((rtems_option) 0x00000002)
63
64/**
65 * @brief Returns true if the interrupt handler unique option is set.
66 */
67#define RTEMS_INTERRUPT_IS_UNIQUE( options) \
68  ((options) & RTEMS_INTERRUPT_UNIQUE)
69
70/**
71 * @brief Returns true if the interrupt handler shared option is set.
72 */
73#define RTEMS_INTERRUPT_IS_SHARED( options) \
74  (!RTEMS_INTERRUPT_IS_UNIQUE( options))
75
76/**
77 * @brief Returns true if the interrupt handler replace option is set.
78 */
79#define RTEMS_INTERRUPT_IS_REPLACE( options) \
80  ((options) & RTEMS_INTERRUPT_REPLACE)
81
82/**
83 * @brief Interrupt handler routine type.
84 */
85typedef void (*rtems_interrupt_handler)(void *);
86
87/**
88 * @brief Installs the interrupt handler routine @a handler for the interrupt
89 * vector with number @a vector.
90 *
91 * You can set one of the mutually exclusive options
92 *
93 * - @ref RTEMS_INTERRUPT_UNIQUE
94 * - @ref RTEMS_INTERRUPT_SHARED
95 * - @ref RTEMS_INTERRUPT_REPLACE
96 *
97 * with the @a options parameter for the interrupt handler.
98 *
99 * The handler routine shall be called with argument @a arg when dispatched.
100 * The order in which the shared interrupt handlers are dispatched for one
101 * vector is BSP dependent.
102 *
103 * If the option @ref RTEMS_INTERRUPT_UNIQUE is set then it shall be ensured
104 * that this handler will be the only one for this vector.
105 *
106 * If the option @ref RTEMS_INTERRUPT_REPLACE is set then it shall be ensured
107 * that this handler will replace the first handler with the same argument for
108 * this vector if it exists, otherwise an error status shall be returned.  A
109 * second handler with the same argument for this vector shall remain
110 * unchanged.  The new handler will inherit the unique or shared option from
111 * the replaced handler.
112 *
113 * You can provide an informative description @a info.  This may be used for
114 * system debugging and status tools.  The string has to be persistent during
115 * the handler life time.
116 *
117 * This function may block.
118 *
119 * @retval RTEMS_SUCCESSFUL Successful operation.
120 * @retval RTEMS_CALLED_FROM_ISR If this function is called from interrupt
121 * context this shall be returned.
122 * @retval RTEMS_INVALID_ADDRESS If the handler address is NULL this shall be
123 * returned.
124 * @retval RTEMS_INVALID_ID If the vector number is out of range this shall be
125 * returned.
126 * @retval RTEMS_INVALID_NUMBER If an option is not applicable this shall be
127 * returned.
128 * @retval RTEMS_RESOURCE_IN_USE If the vector is already occupied with a
129 * unique handler this shall be returned.  If a unique handler should be
130 * installed and there is already a handler installed this shall be returned.
131 * @retval RTEMS_TOO_MANY If a handler with this argument is already installed
132 * for the vector this shall be returned.
133 * @retval RTEMS_UNSATISFIED If no handler exists to replace with the specified
134 * argument and vector this shall be returned.
135 * @retval RTEMS_IO_ERROR Reserved for board support package specific error
136 * conditions.
137 */
138rtems_status_code rtems_interrupt_handler_install(
139  rtems_vector_number vector,
140  const char *info,
141  rtems_option options,
142  rtems_interrupt_handler handler,
143  void *arg
144);
145
146/**
147 * @brief Removes the interrupt handler routine @a handler with argument @a arg
148 * for the interrupt vector with number @a vector.
149 *
150 * This function may block.
151 *
152 * @retval RTEMS_SUCCESSFUL Successful operation.
153 * @retval RTEMS_CALLED_FROM_ISR If this function is called from interrupt
154 * context this shall be returned.
155 * @retval RTEMS_INVALID_ADDRESS If the handler address is NULL this shall be
156 * returned.
157 * @retval RTEMS_INVALID_ID If the vector number is out of range this shall be
158 * returned.
159 * @retval RTEMS_UNSATISFIED If the handler with its argument is not installed
160 * for the vector this shall be returned.
161 * @retval RTEMS_IO_ERROR Reserved for board support package specific error
162 * conditions.
163 */
164rtems_status_code rtems_interrupt_handler_remove(
165  rtems_vector_number vector,
166  rtems_interrupt_handler handler,
167  void *arg
168);
169
170/**
171 * @brief Interrupt handler iteration routine type.
172 *
173 * @see rtems_interrupt_handler_iterate()
174 */
175typedef void (*rtems_interrupt_per_handler_routine)(
176  void *, const char *, rtems_option, rtems_interrupt_handler, void *
177);
178
179/**
180 * @brief Iterates over all installed interrupt handler of the interrupt vector
181 * with number @a vector.
182 *
183 * For each installed handler of the vector the function @a routine will be
184 * called with the supplied argument @a arg and the handler information,
185 * options, routine and argument.
186 *
187 * This function is intended for system information and diagnostics.
188 *
189 * This function may block.  Never install or remove an interrupt handler
190 * within the iteration routine.  This may result in a deadlock.
191 *
192 * @retval RTEMS_SUCCESSFUL Successful operation.
193 * @retval RTEMS_CALLED_FROM_ISR If this function is called from interrupt
194 * context this shall be returned.
195 * @retval RTEMS_INVALID_ID If the vector number is out of range this shall be
196 * returned.
197 * @retval RTEMS_IO_ERROR Reserved for board support package specific error
198 * conditions.
199 */
200rtems_status_code rtems_interrupt_handler_iterate(
201  rtems_vector_number vector,
202  rtems_interrupt_per_handler_routine routine,
203  void *arg
204);
205
206/**
207 * @brief Sets the processor affinity set of an interrupt vector.
208 *
209 * @param[in] vector The interrupt vector number.
210 * @param[in] affinity_size The storage size of the affinity set.
211 * @param[in] affinity_set The new processor affinity set for the interrupt
212 *   vector.  This pointer must not be @c NULL.
213 *
214 * @retval RTEMS_SUCCESSFUL Successful operation.
215 * @retval RTEMS_INVALID_ID The vector number is invalid.
216 * @retval RTEMS_INVALID_SIZE Invalid affinity set size.
217 * @retval RTEMS_INVALID_NUMBER Invalid processor affinity set.
218 */
219rtems_status_code rtems_interrupt_set_affinity(
220  rtems_vector_number  vector,
221  size_t               affinity_size,
222  const cpu_set_t     *affinity
223);
224
225/**
226 * @brief Gets the processor affinity set of an interrupt vector.
227 *
228 * @param[in] vector The interrupt vector number.
229 * @param[in] affinity_size The storage size of the affinity set.
230 * @param[out] affinity_set The current processor affinity set for the
231 *   interrupt vector.  This pointer must not be @c NULL.
232 *
233 * @retval RTEMS_SUCCESSFUL Successful operation.
234 * @retval RTEMS_INVALID_ID The vector number is invalid.
235 * @retval RTEMS_INVALID_SIZE Invalid affinity set size.
236 */
237rtems_status_code rtems_interrupt_get_affinity(
238  rtems_vector_number  vector,
239  size_t               affinity_size,
240  cpu_set_t           *affinity
241);
242
243/**
244 * @brief An interrupt server action.
245 *
246 * This structure must be treated as an opaque data type.  Members must not be
247 * accessed directly.
248 *
249 * @see rtems_interrupt_server_action_prepend().
250 */
251typedef struct rtems_interrupt_server_action {
252  struct rtems_interrupt_server_action *next;
253  rtems_interrupt_handler               handler;
254  void                                 *arg;
255} rtems_interrupt_server_action;
256
257/**
258 * @brief The interrupt server index of the default interrupt server.
259 */
260#define RTEMS_INTERRUPT_SERVER_DEFAULT 0
261
262/**
263 * @brief An interrupt server entry.
264 *
265 * This structure must be treated as an opaque data type.  Members must not be
266 * accessed directly.
267 *
268 * @see rtems_interrupt_server_entry_initialize(),
269 *   rtems_interrupt_server_action_prepend(),
270 *   rtems_interrupt_server_entry_submit(), and
271 *   rtems_interrupt_server_entry_destroy().
272 */
273typedef struct {
274  rtems_chain_node               node;
275  void                          *server;
276  rtems_vector_number            vector;
277  rtems_interrupt_server_action *actions;
278} rtems_interrupt_server_entry;
279
280/**
281 * @brief An interrupt server request.
282 *
283 * This structure must be treated as an opaque data type.  Members must not be
284 * accessed directly.
285 *
286 * @see rtems_interrupt_server_request_initialize(),
287 *   rtems_interrupt_server_request_set_vector(),
288 *   rtems_interrupt_server_request_submit(), and
289 *   rtems_interrupt_server_request_destroy().
290 */
291typedef struct {
292  rtems_interrupt_server_entry  entry;
293  rtems_interrupt_server_action action;
294} rtems_interrupt_server_request;
295
296/**
297 * @brief Initializes the interrupt server tasks.
298 *
299 * This function tries to create an interrupt server task for each processor in
300 * the system.  The tasks will have the priority @a priority, the stack size @a
301 * stack_size, the modes @a modes and the attributes @a attributes.  The count
302 * of server tasks will be returned in @a server_count.  Interrupt handlers can
303 * be installed on an interrupt server with
304 * rtems_interrupt_server_handler_install() and removed with
305 * rtems_interrupt_server_handler_remove() using a server index.  In case of an
306 * interrupt, the request will be forwarded to the interrupt server.  The
307 * handlers are executed within the interrupt server context.  If one handler
308 * blocks on something this may delay the processing of other handlers.
309 *
310 * The server count pointer @a server_count may be @a NULL.
311 *
312 * This function may block.
313 *
314 * @see rtems_task_create().
315 *
316 * @retval RTEMS_SUCCESSFUL Successful operation.
317 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
318 * @retval RTEMS_NO_MEMORY Not enough memory.
319 * @retval RTEMS_TOO_MANY No free task available to create at least one server task.
320 * @retval RTEMS_UNSATISFIED Task stack size too large.
321 * @retval RTEMS_INVALID_PRIORITY Invalid task priority.
322 */
323rtems_status_code rtems_interrupt_server_initialize(
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
331/**
332 * @brief Installs the interrupt handler routine @a handler for the interrupt
333 * vector with number @a vector on the server @a server.
334 *
335 * The handler routine will be executed on the corresponding interrupt server
336 * task.  A server index @a server_index of @c RTEMS_INTERRUPT_SERVER_DEFAULT
337 * may be used to install the handler on the default server.
338 *
339 * This function may block.
340 *
341 * @see rtems_interrupt_handler_install().
342 *
343 * @retval RTEMS_SUCCESSFUL Successful operation.
344 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
345 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
346 * @retval * For other errors see rtems_interrupt_handler_install().
347 */
348rtems_status_code rtems_interrupt_server_handler_install(
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
357/**
358 * @brief Removes the interrupt handler routine @a handler with argument @a arg
359 * for the interrupt vector with number @a vector from the server @a server.
360 *
361 * A server index @a server_index of @c RTEMS_INTERRUPT_SERVER_DEFAULT may be
362 * used to remove the handler from the default server.
363 *
364 * This function may block.
365 *
366 * @see rtems_interrupt_handler_remove().
367 *
368 * @retval RTEMS_SUCCESSFUL Successful operation.
369 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
370 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
371 * @retval * For other errors see rtems_interrupt_handler_remove().
372 */
373rtems_status_code rtems_interrupt_server_handler_remove(
374  uint32_t server_index,
375  rtems_vector_number vector,
376  rtems_interrupt_handler handler,
377  void *arg
378);
379
380/**
381 * @brief Iterates over all interrupt handler of the interrupt vector with
382 * number @a vector which are installed on the interrupt server specified by
383 * @a server.
384 *
385 * A server index @a server_index of @c RTEMS_INTERRUPT_SERVER_DEFAULT may be
386 * used to specify the default server.
387 *
388 * @see rtems_interrupt_handler_iterate()
389 *
390 * @retval RTEMS_SUCCESSFUL Successful operation.
391 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
392 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
393 * @retval * For other errors see rtems_interrupt_handler_iterate().
394 */
395rtems_status_code rtems_interrupt_server_handler_iterate(
396  uint32_t server_index,
397  rtems_vector_number vector,
398  rtems_interrupt_per_handler_routine routine,
399  void *arg
400);
401
402/**
403 * @brief Moves the interrupt handlers installed on the specified source
404 * interrupt server to the destination interrupt server.
405 *
406 * This function must be called from thread context.  It may block.  Calling
407 * this function within the context of an interrupt server is undefined
408 * behaviour.
409 *
410 * @param[in] source_server_index The source interrupt server index.  Use
411 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
412 * @param[in] vector The interrupt vector number.
413 * @param[in] destination_server_index The destination interrupt server index.
414 *   Use @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
415 *
416 * @retval RTEMS_SUCCESSFUL Successful operation
417 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
418 * @retval RTEMS_INVALID_ID The destination interrupt server index is invalid.
419 * @retval RTEMS_INVALID_ID The vector number is invalid.
420 * @retval RTEMS_INVALID_ID The destination interrupt server index is invalid.
421 */
422rtems_status_code rtems_interrupt_server_move(
423  uint32_t            source_server_index,
424  rtems_vector_number vector,
425  uint32_t            destination_server_index
426);
427
428/**
429 * @brief Suspends the specified interrupt server.
430 *
431 * A suspend request is sent to the specified interrupt server.  This function
432 * waits for an acknowledgment from the specified interrupt server.
433 *
434 * This function must be called from thread context.  It may block.  Calling
435 * this function within the context of an interrupt server is undefined
436 * behaviour.
437 *
438 * @param[in] server_index The interrupt server index.  Use
439 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
440 *
441 * @see rtems_interrupt_server_resume().
442 *
443 * @retval RTEMS_SUCCESSFUL Successful operation
444 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
445 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
446 */
447rtems_status_code rtems_interrupt_server_suspend( uint32_t server_index );
448
449/**
450 * @brief Resumes the specified interrupt server.
451 *
452 * This function must be called from thread context.  It may block.  Calling
453 * this function within the context of an interrupt server is undefined
454 * behaviour.
455 *
456 * @param[in] server_index The interrupt server index.  Use
457 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
458 *
459 * @see rtems_interrupt_server_suspend().
460 *
461 * @retval RTEMS_SUCCESSFUL Successful operation
462 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
463 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
464 */
465rtems_status_code rtems_interrupt_server_resume( uint32_t server_index );
466
467/**
468 * @brief Sets the processor affinity of the specified interrupt server.
469 *
470 * The scheduler is set determined by the highest numbered processor in the
471 * specified affinity set.
472 *
473 * This operation is only reliable in case the specified interrupt was
474 * suspended via rtems_interrupt_server_suspend().
475 *
476 * @param[in] server_index The interrupt server index.  Use
477 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
478 * @param[in] affinity_size The storage size of the affinity set.
479 * @param[in] affinity The desired processor affinity set for the specified
480 *   interrupt server.
481 * @param[in] priority The task priority with respect to the corresponding
482 *   scheduler instance.
483 *
484 * @retval RTEMS_SUCCESSFUL Successful operation
485 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
486 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
487 * @retval RTEMS_INVALID_SIZE Invalid affinity set size.
488 * @retval RTEMS_INVALID_NAME The affinity set contains no online processor.
489 * @retval RTEMS_INCORRECT_STATE The highest numbered online processor in the
490 *   specified affinity set is not owned by a scheduler.
491 * @retval RTEMS_INVALID_PRIORITY Invalid priority.
492 * @retval RTEMS_RESOURCE_IN_USE The interrupt server owns resources which deny
493 *   a scheduler change.
494 * @retval RTEMS_INVALID_NUMBER Invalid processor affinity set.
495 */
496rtems_status_code rtems_interrupt_server_set_affinity(
497  uint32_t            server_index,
498  size_t              affinity_size,
499  const cpu_set_t    *affinity,
500  rtems_task_priority priority
501);
502
503/**
504 * @brief Initializes the specified interrupt server entry.
505 *
506 * @param[in] server_index The interrupt server index.  Use
507 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
508 * @param[in] entry The interrupt server entry to initialize.
509 *
510 * @see rtems_interrupt_server_action_prepend().
511 *
512 * @retval RTEMS_SUCCESSFUL Successful operation.
513 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
514 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
515 */
516rtems_status_code rtems_interrupt_server_entry_initialize(
517  uint32_t                      server_index,
518  rtems_interrupt_server_entry *entry
519);
520
521/**
522 * @brief Prepends the specified interrupt server action to the list of actions
523 * of the specified interrupt server entry.
524 *
525 * No error checking is performed.
526 *
527 * @param[in] entry The interrupt server entry to prepend the interrupt server
528 *   action.  It must have been initialized via
529 *   rtems_interrupt_server_entry_initialize().
530 * @param[in] action The interrupt server action to prepend the list of actions
531 *   of the entry.
532 * @param[in] handler The interrupt handler for the action.
533 * @param[in] arg The interrupt handler argument for the action.
534 */
535void rtems_interrupt_server_action_prepend(
536  rtems_interrupt_server_entry  *entry,
537  rtems_interrupt_server_action *action,
538  rtems_interrupt_handler        handler,
539  void                          *arg
540);
541
542/**
543 * @brief Submits the specified interrupt server entry so that its interrupt
544 * server actions can be invoked by the specified interrupt server.
545 *
546 * This function may be used to do a two-step interrupt processing.  The first
547 * step is done in interrupt context which calls this function.  The second
548 * step is then done in the context of the interrupt server.
549 *
550 * This function may be called from thread or interrupt context.  It does not
551 * block.  No error checking is performed.
552 *
553 * @param[in] entry The interrupt server entry must be initialized before the
554 *   first call to this function via rtems_interrupt_server_entry_initialize()
555 *   and rtems_interrupt_server_action_prepend().  The entry and its actions
556 *   must not be modified between calls to this function.  Use
557 *   rtems_interrupt_server_entry_destroy() to destroy an entry in use.
558 */
559void rtems_interrupt_server_entry_submit(
560  rtems_interrupt_server_entry *entry
561);
562
563/**
564 * @brief Destroys the specified interrupt server entry.
565 *
566 * This function must be called from thread context.  It may block.  Calling
567 * this function within the context of an interrupt server is undefined
568 * behaviour.  No error checking is performed.
569 *
570 * @param[in] server_index The interrupt server index.  Use
571 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
572 * @param[in] entry The interrupt server entry to destroy.  It must have been
573 *   initialized via rtems_interrupt_server_entry_initialize().
574 */
575void rtems_interrupt_server_entry_destroy(
576  rtems_interrupt_server_entry *entry
577);
578
579/**
580 * @brief Initializes the specified interrupt server request.
581 *
582 * @param[in] server_index The interrupt server index.  Use
583 *   @c RTEMS_INTERRUPT_SERVER_DEFAULT to specify the default server.
584 * @param[in] request The interrupt server request to initialize.
585 * @param[in] handler The interrupt handler for the request action.
586 * @param[in] arg The interrupt handler argument for the request action.
587 *
588 * @retval RTEMS_SUCCESSFUL Successful operation.
589 * @retval RTEMS_INCORRECT_STATE The interrupt servers are not initialized.
590 * @retval RTEMS_INVALID_ID If the interrupt server index is invalid.
591 *
592 * @see rtems_interrupt_server_request_set_vector().
593 */
594rtems_status_code rtems_interrupt_server_request_initialize(
595  uint32_t                        server_index,
596  rtems_interrupt_server_request *request,
597  rtems_interrupt_handler         handler,
598  void                           *arg
599);
600
601/**
602 * @brief Sets the interrupt vector in the specified interrupt server request.
603 *
604 * By default, the interrupt vector of an interrupt server request is set to a
605 * special value which is outside the range of vectors supported by the
606 * interrupt controller hardware.
607 *
608 * Calls to rtems_interrupt_server_request_submit() will disable the interrupt
609 * vector of the request.  After processing of the request by the interrupt
610 * server the interrupt vector will be enabled again.
611 *
612 * @param[in] request The initialized interrupt server request.
613 * @param[in] vector The interrupt vector number.
614 *
615 * @see rtems_interrupt_server_request_initialize().
616 */
617RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_set_vector(
618  rtems_interrupt_server_request *request,
619  rtems_vector_number             vector
620)
621{
622  request->entry.vector = vector;
623}
624
625/**
626 * @brief Submits the specified interrupt server request so that its interrupt
627 * server action can be invoked by the specified interrupt server.
628 *
629 * This function may be used to do a two-step interrupt processing.  The first
630 * step is done in interrupt context which calls this function.  The second
631 * step is then done in the context of the interrupt server.
632 *
633 * This function may be called from thread or interrupt context.  It does not
634 * block.  No error checking is performed.
635 *
636 * @param[in] request The interrupt server request must be initialized before the
637 *   first call to this function via
638 *   rtems_interrupt_server_request_initialize().  The request must not be
639 *   modified between calls to this function.  Use
640 *   rtems_interrupt_server_request_destroy() to destroy a request in use.
641 */
642RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_submit(
643  rtems_interrupt_server_request *request
644)
645{
646  rtems_interrupt_server_entry_submit( &request->entry );
647}
648
649/**
650 * @brief Destroys the specified interrupt server request.
651 *
652 * This function must be called from thread context.  It may block.  Calling
653 * this function within the context of an interrupt server is undefined
654 * behaviour.  No error checking is performed.
655 *
656 * @param[in] request The interrupt server request to destroy.  It must have
657 *   been initialized via rtems_interrupt_server_request_initialize().
658 */
659RTEMS_INLINE_ROUTINE void rtems_interrupt_server_request_destroy(
660  rtems_interrupt_server_request *request
661)
662{
663  rtems_interrupt_server_entry_destroy( &request->entry );
664}
665
666/** @} */
667
668#ifdef __cplusplus
669}
670#endif /* __cplusplus */
671
672#endif /* RTEMS_IRQ_EXTENSION_H */
Note: See TracBrowser for help on using the repository browser.