#3269 closed enhancement (fixed)

Make the IRQ extensions API a standard API

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: rtems Version: 5
Severity: normal Keywords: qualification
Cc: Blocked By:
Blocking:

Description (last modified by Sebastian Huber)

The IRQ extensions API defined by <rtems/irq-extensions.h> is currently only implemented by some BSPs and not covered by test cases. It is not documented in the RTEMS Classic API Guide. Change the BSPs so that every BSP implements this API at least as a stub so that we can write tests for this API. Specify and document the API.

Extend the API to enable/disable specific interrupt vectors. The proposed functions for this are rtems_interrupt_mask() and rtems_interrupt_unmask().

Extend the API to raise/clear specific interrupt vectors. This allows to test specific interrupts. The proposed functions are rtems_interrupt_raise() and rtems_interrupt_clear().

Extend the API to set/get the interrupt vector priority.

Extend the API to get some information about a particular interrupt vector, e.g. if the raise/clear functions work, if it is possible to change the priority, etc.

Change History (73)

comment:1 Changed on 01/04/18 at 06:20:36 by Sebastian Huber <sebastian.huber@…>

In 569fd50/rtems:

sparc: Remove BSP specifics from <pci/irq.h>

Update #3254.
Update #3260.
Update #3269.

comment:2 Changed on 05/13/19 at 13:33:51 by Sebastian Huber

Component: devrtems
Description: modified (diff)
Milestone: Indefinite5.1
Summary: Add functions to enable, disable, and clear interrupts to the IRQ extensions APIMake the IRQ extensions API a standard API
Version: 5

comment:3 Changed on 05/16/19 at 07:59:21 by Sebastian Huber <sebastian.huber@…>

In 45d0659/rtems:

bsps: Always build generic interrupt support

This makes it possible to write tests for the generic interrupt
controller support.

Update #3269.

comment:4 Changed on 07/05/19 at 07:04:53 by Sebastian Huber <sebastian.huber@…>

In e9c83b4/rtems:

bsps: Regenerate headers.am

Update #3269.

comment:5 Changed on 12/19/19 at 08:07:34 by Sebastian Huber

Milestone: 5.16.1

comment:6 Changed on 07/31/20 at 05:01:26 by Sebastian Huber <sebastian.huber@…>

In a3bcc79/rtems:

bsps/lm32: Use shared <bsp/irq.h>

Having a duplicate header with the shared includes is a build system
inconsistency. You may use one header file to build the libraries and
another one is installed (overwriting the other).

Update #3269.

comment:7 Changed on 06/18/21 at 09:24:45 by Sebastian Huber

Keywords: qualification added

comment:8 Changed on 06/24/21 at 10:29:35 by Sebastian Huber <sebastian.huber@…>

In 61d0be7/rtems:

bsps/irq: Remove BSP_INTERRUPT_NO_HEAP_USAGE

Remove the support for BSP_INTERRUPT_NO_HEAP_USAGE. This was only used
by one BSP and provides no real benefit.

Update #3269.

comment:9 Changed on 06/24/21 at 10:29:39 by Sebastian Huber <sebastian.huber@…>

In 4146d39/rtems:

bsp/genmcf548x: Change BSP_INTERRUPT_VECTOR_MIN

This BSP uses a customized implementation of the interrupt extension API. It
was the only BSP which defined BSP_INTERRUPT_VECTOR_MIN to a value other than
zero. Define it to zero and use a custom bsp_interrupt_is_valid_vector()
function instead.

Update #3269.

comment:10 Changed on 06/24/21 at 10:29:42 by Sebastian Huber <sebastian.huber@…>

In 5210c7c/rtems:

bsp/generic_or1k: Remove incomplete IRQ support

Update #3269.

comment:11 Changed on 06/24/21 at 10:29:46 by Sebastian Huber <sebastian.huber@…>

In f3acb8b/rtems:

bsps/irq: Assert BSP_INTERRUPT_VECTOR_MIN == 0

After building all BSPs with this patch, this BSP-specific define can be
removed to simplify the implementation.

Update #3269.

comment:12 Changed on 06/24/21 at 10:29:49 by Sebastian Huber <sebastian.huber@…>

In af73b7b6/rtems:

bsps/irq: Remove BSP_INTERRUPT_VECTOR_MIN

Remove BSP_INTERRUPT_VECTOR_MIN and unconditionally let interrupt vector
numbers start with zero.

The BSP_INTERRUPT_VECTOR_MIN == 0 invariant was tested by the previous commit
and building all BSPs.

Update #3269.

comment:13 Changed on 06/24/21 at 10:29:53 by Sebastian Huber <sebastian.huber@…>

In 900a84c5/rtems:

smpcapture02: Fix use of BSP_INTERRUPT_VECTOR_MAX

This define represents the last valid interrupt vector number.

Update #3269.

comment:14 Changed on 06/24/21 at 10:29:56 by Sebastian Huber <sebastian.huber@…>

In cd5573c/rtems:

bsps/irq: Add BSP_INTERRUPT_VECTOR_COUNT

Assert BSP_INTERRUPT_VECTOR_MAX + 1 == BSP_INTERRUPT_VECTOR_COUNT.

After building all BSPs with this patch, BSP_INTERRUPT_VECTOR_MAX can be
removed and replaced by BSP_INTERRUPT_VECTOR_COUNT. The
BSP_INTERRUPT_VECTOR_COUNT allows a default implementation which supports no
interrupt vector at all. Using COUNT instead of MAX may avoid some
interpretation issues, for example is the maximum value a valid vector number
or not.

Update #3269.

comment:15 Changed on 06/24/21 at 10:30:00 by Sebastian Huber <sebastian.huber@…>

In 049e2b6/rtems:

bsps/irq: Remove BSP_INTERRUPT_VECTOR_NUMBER

Replace it with BSP_INTERRUPT_VECTOR_COUNT.

Update #3269.

comment:16 Changed on 06/24/21 at 10:30:03 by Sebastian Huber <sebastian.huber@…>

In 3fee6620/rtems:

bsps/irq: Use BSP_INTERRUPT_VECTOR_COUNT

Use BSP_INTERRUPT_VECTOR_COUNT instead of BSP_INTERRUPT_VECTOR_MAX.

Update #3269.

comment:17 Changed on 06/24/21 at 10:30:07 by Sebastian Huber <sebastian.huber@…>

In 94cf67c/rtems:

bsps/irq: Remove BSP_INTERRUPT_VECTOR_MAX

This define is no longer used.

Update #3269.

comment:18 Changed on 06/24/21 at 10:30:10 by Sebastian Huber <sebastian.huber@…>

In fdf2ee7/rtems:

bsps/irq: Default BSP_INTERRUPT_VECTOR_COUNT == 0

Change the default value of BSP_INTERRUPT_VECTOR_COUNT so that no interrupt
vectors are supported and all related directives return RTEMS_INVALID_ID.

Update #3269.

comment:19 Changed on 06/24/21 at 10:30:14 by Sebastian Huber <sebastian.huber@…>

In 6b7a3858/rtems:

bsp/atsam: Fix BSP_INTERRUPT_VECTOR_COUNT

Fix an off by one error.

Update #3269.

comment:20 Changed on 07/12/21 at 12:27:57 by Sebastian Huber <sebastian.huber@…>

In c7b3df3f/rtems:

bsps/sparc: Improve interrupt affinity support

Fully support the interrupt extension API to set/get the interrupt affinity.
Remove LEON3_irq_to_cpu which defined the interrupt to processor mapping in a
BSP-specific way.

Update #3269.

comment:21 Changed on 07/27/21 at 05:42:57 by Sebastian Huber <sebastian.huber@…>

In efb3fc2/rtems:

bsps/irq: Move get/set affinity to separate file

Update #3269.

comment:22 Changed on 07/27/21 at 05:43:00 by Sebastian Huber <sebastian.huber@…>

In 1b3b5b84/rtems:

bsps/irq: Canonicalize get/set affinity errors

Bring the error conditions and status in line with
rtems_task_get_affinity() and rtems_task_set_affinity().

Update #3269.

comment:23 Changed on 07/27/21 at 05:43:04 by Sebastian Huber <sebastian.huber@…>

In 04c2c08/rtems:

bsps/irq: Move handler iterate to separate file

Update #3269.

comment:24 Changed on 07/27/21 at 05:43:07 by Sebastian Huber <sebastian.huber@…>

In ba937459/rtems:

rtems: Add rtems_interrupt_raise()

Add rtems_interrupt_raise_on(). Document the currently not implemented
rtems_interrupt_clear(). Remove the not implemented and badly named
rtems_interrupt_cause() directive.

Update #3269.

comment:25 Changed on 07/27/21 at 05:43:11 by Sebastian Huber <sebastian.huber@…>

In c4eafae2/rtems:

rtems: Generate <rtems/irq-extension.h>

Use <rtems/score/chain.h> which just provides the data types and avoid a
dependency on <rtems/chain.h> which contains the full chain
implementation.

Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3269.
Update #3899.
Update #3993.

comment:26 Changed on 07/27/21 at 05:43:14 by Sebastian Huber <sebastian.huber@…>

In 5e33aec/rtems:

rtems: Add rtems_interrupt_get_attributes()

Add a directive to query the attributes of an interrupt vector. This
can be used for generic tests and system diagnostics.

Update #3269.

comment:27 Changed on 07/27/21 at 05:43:18 by Sebastian Huber <sebastian.huber@…>

In 96265c8/rtems:

rtems: Add rtems_interrupt_vector_enable()

Add rtems_interrupt_vector_disable().

Update #3269.

comment:28 Changed on 07/27/21 at 05:43:21 by Sebastian Huber <sebastian.huber@…>

In 01e7c36/rtems:

rtems: Add rtems_interrupt_vector_is_enabled()

Update #3269.

comment:29 Changed on 07/27/21 at 05:43:25 by Sebastian Huber <sebastian.huber@…>

In faa4b636/rtems:

rtems: Add rtems_interrupt_is_pending()

Update #3269.

comment:30 Changed on 07/27/21 at 05:43:28 by Sebastian Huber <sebastian.huber@…>

In 4969af4/rtems:

rtems: Add RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT

Add RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT as the fatal source for
spurious interrupts. Use the interrupt vector number of the spurious
interrupt for the fatal code.

Update #3269.

comment:31 Changed on 07/27/21 at 05:43:32 by Sebastian Huber <sebastian.huber@…>

In 781213f9/rtems:

bsps/irq: Add rtems_interrupt_vector_is_enabled()

Add a default implementation which just returns RTEMS_UNSATISFIED for
valid parameters.

Update #3269.

comment:32 Changed on 07/27/21 at 05:43:35 by Sebastian Huber <sebastian.huber@…>

In 9832652c/rtems:

bsps/irq: Add rtems_interrupt_raise()

Add rtems_interrupt_raise_on() and rtems_interrupt_clear().

Add a default implementation which just returns RTEMS_UNSATISFIED for
valid parameters.

Update #3269.

comment:33 Changed on 07/27/21 at 05:43:38 by Sebastian Huber <sebastian.huber@…>

In eebecd0/rtems:

bsps/irq: Add rtems_interrupt_get_attributes()

Add a default implementation which clears the attributes to zero and
just returns RTEMS_SUCCESSFUL for valid parameters.

Update #3269.

comment:34 Changed on 07/27/21 at 05:43:42 by Sebastian Huber <sebastian.huber@…>

In deb5afb/rtems:

bsps/irq: Add rtems_interrupt_is_pending()

Add a default implementation which just returns RTEMS_UNSATISFIED.

Update #3269.

comment:35 Changed on 07/27/21 at 05:43:45 by Sebastian Huber <sebastian.huber@…>

In bc86a5fa/rtems:

bsps/irq: bsp_interrupt_vector_enable()

Return a status code for bsp_interrupt_vector_enable().

Update #3269.

comment:36 Changed on 07/27/21 at 05:43:48 by Sebastian Huber <sebastian.huber@…>

In 32f5a195/rtems:

bsps/irq: bsp_interrupt_vector_disable()

Return a status code for bsp_interrupt_vector_disable().

Update #3269.

comment:37 Changed on 07/27/21 at 05:43:52 by Sebastian Huber <sebastian.huber@…>

In 23ec04c/rtems:

bsps/irq: bsp_interrupt_get_affinity()

Return a status code for bsp_interrupt_get_affinity().

Update #3269.

comment:38 Changed on 07/27/21 at 05:43:56 by Sebastian Huber <sebastian.huber@…>

In 85a3785/rtems:

bsps/irq: bsp_interrupt_set_affinity()

Return a status code for bsp_interrupt_set_affinity().

Update #3269.

comment:39 Changed on 07/27/21 at 05:43:59 by Sebastian Huber <sebastian.huber@…>

In fe6ce5ac/rtems:

bsps/irq: Implement new directives for GICv2/3

Update #3269.

comment:40 Changed on 07/27/21 at 05:44:02 by Sebastian Huber <sebastian.huber@…>

In 09be98d/rtems:

sparc/irq: Implement new interrupt directives

Update #3269.

comment:41 Changed on 07/27/21 at 05:44:06 by Sebastian Huber <sebastian.huber@…>

In 81358d7/rtems:

rtems: Add rtems_interrupt_entry_install()

Add RTEMS_INTERRUPT_ENTRY_INITIALIZER(),
rtems_interrupt_entry_initialize(), and
rtems_interrupt_entry_remove(). This allows to install interrupt
handlers using user-provided storage as an alternative to
rtems_interrupt_handler_install() which has to allocate memory.

Update #3269.

comment:42 Changed on 07/27/21 at 05:44:09 by Sebastian Huber <sebastian.huber@…>

In 73fcbf4/rtems:

bsps/irq: Use rtems_interrupt_entry

Update #3269.

comment:43 Changed on 07/27/21 at 05:44:13 by Sebastian Huber <sebastian.huber@…>

In 63d9e84/rtems:

bsps/irq: Add bsp_interrupt_check_and_lock()

Return RTEMS_INCORRECT_STATE instead of RTEMS_INTERNAL_ERROR in case the
interrupt support is not initialized. This is similar to
rtems_timer_server_fire_after() for example.

Update #3269.

comment:44 Changed on 07/27/21 at 05:44:16 by Sebastian Huber <sebastian.huber@…>

In 70357f1/rtems:

bsps/irq: Move bsp_interrupt_handler_is_empty()

This function is only used by one BSP.

Update #3269.

comment:45 Changed on 07/27/21 at 05:44:20 by Sebastian Huber <sebastian.huber@…>

In e518323/rtems:

bsps/irq: Add rtems_interrupt_entry_install()

Add rtems_interrupt_entry_remove(). Split up irq-generic.c into several files.
In particular, place all functions which use dynamic memory into their own
file.

Add optional macros to let the BSP customize the vector installation after
installing the first entry and the vector removal before removing the last
entry:

  • bsp_interrupt_vector_install()
  • bsp_interrupt_vector_remove()

Use these new customization options in the m68k/genmcf548x BSP so re-use the
generic interrupt controller support.

Update #3269.

comment:46 Changed on 07/27/21 at 05:44:23 by Sebastian Huber <sebastian.huber@…>

In b910e60/rtems:

bsp/raspberrypi: Add interrupt get/set affinity

Add default implementations for bsp_interrupt_get_affinity() and
bsp_interrupt_set_affinity() which are required to link all tests in SMP
configurations.

Update #3269.

comment:47 Changed on 07/27/21 at 05:44:26 by Sebastian Huber <sebastian.huber@…>

In f89cf8e8/rtems:

validation: Add CallWithinISR()

Update #3269.

comment:48 Changed on 07/27/21 at 05:44:30 by Sebastian Huber <sebastian.huber@…>

comment:49 Changed on 07/27/21 at 05:44:33 by Sebastian Huber <sebastian.huber@…>

comment:50 Changed on 07/27/21 at 05:44:37 by Sebastian Huber <sebastian.huber@…>

In 9e1fc36/rtems:

validation: GetTestableInterruptVector?()

Update #3269.

comment:51 Changed on 07/27/21 at 05:44:40 by Sebastian Huber <sebastian.huber@…>

In e2894df/rtems:

validation: Test rtems_interrupt_get_attributes()

Update #3269.

comment:52 Changed on 07/27/21 at 05:44:44 by Sebastian Huber <sebastian.huber@…>

In d8be2b97/rtems:

validation: rtems_interrupt_vector_is_enabled()

Update #3269.

comment:53 Changed on 07/27/21 at 05:44:47 by Sebastian Huber <sebastian.huber@…>

In 7a3e6c7/rtems:

validation: Test rtems_interrupt_vector_enable()

Update #3269.

comment:54 Changed on 07/27/21 at 05:44:50 by Sebastian Huber <sebastian.huber@…>

In aa6c962/rtems:

validation: Test rtems_interrupt_vector_disable()

Update #3269.

comment:55 Changed on 07/27/21 at 05:44:54 by Sebastian Huber <sebastian.huber@…>

In 09960369/rtems:

validation: Test rtems_interrupt_entry_install()

Update #3269.

comment:56 Changed on 07/27/21 at 05:44:57 by Sebastian Huber <sebastian.huber@…>

In 7dbab6af/rtems:

validation: Test rtems_interrupt_entry_remove()

Update #3269.

comment:57 Changed on 07/27/21 at 05:45:01 by Sebastian Huber <sebastian.huber@…>

In 4341058/rtems:

validation: Test rtems_interrupt_raise()

Update #3269.

comment:58 Changed on 07/27/21 at 05:45:04 by Sebastian Huber <sebastian.huber@…>

In 1bf8139a/rtems:

validation: Test rtems_interrupt_clear()

Update #3269.

comment:59 Changed on 07/27/21 at 05:45:07 by Sebastian Huber <sebastian.huber@…>

In 163c1fd/rtems:

validation: Test rtems_interrupt_is_pending()

Update #3269.

comment:60 Changed on 07/27/21 at 05:45:11 by Sebastian Huber <sebastian.huber@…>

In 32c0cd8/rtems:

validation: Test rtems_interrupt_raise_on()

Update #3269.

comment:61 Changed on 07/27/21 at 05:45:14 by Sebastian Huber <sebastian.huber@…>

In aab3713/rtems:

validation: Test rtems_interrupt_get_affinity()

Update #3269.

comment:62 Changed on 07/27/21 at 05:45:18 by Sebastian Huber <sebastian.huber@…>

In 17fb5239/rtems:

validation: Test rtems_interrupt_set_affinity()

Update #3269.

comment:63 Changed on 07/27/21 at 05:45:21 by Sebastian Huber <sebastian.huber@…>

In 67c033d3/rtems:

validation: Test rtems_interrupt_handler_iterate()

Update #3269.

comment:64 Changed on 07/27/21 at 05:50:33 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In 056886f/rtems-docs:

c-user: Document interrupt manager extensions

Close #3269.

comment:65 Changed on 08/12/21 at 19:07:44 by Sebastian Huber <sebastian.huber@…>

In 75af5be/rtems:

bsp/leon3: Fix rtems_interrupt_is_pending()

Take the interrupt force register into account in all configurations.

Update #3269.

comment:66 Changed on 01/11/22 at 15:41:33 by Sebastian Huber <sebastian.huber@…>

In cbc9232/rtems:

bsp/qoriq: Implement Interrupt Manager directives

Update #3269.

comment:67 Changed on 03/16/22 at 06:17:15 by Sebastian Huber <sebastian.huber@…>

In 49f84b7/rtems-docs:

c-user: Improve interrupt set affinity handling

Update #3269.

comment:68 Changed on 03/16/22 at 06:24:29 by Sebastian Huber <sebastian.huber@…>

In ca4fa22e/rtems:

bsps/irq: Fix formatting

Update #3269.

comment:69 Changed on 03/16/22 at 06:24:33 by Sebastian Huber <sebastian.huber@…>

In f311caf/rtems:

bsps/irq: Improve affinity set handling

Restrict the affinity set to the set of online processors. Make sure
the affinity set for an interrupt vector contains at least one online
processor.

Update #3269.

comment:70 Changed on 06/08/22 at 08:20:07 by Sebastian Huber <sebastian.huber@…>

In 9a69e430/rtems:

validation: Fix CallWithinISR()

Some BSPs require that Clear_tm27_intr() is called in the interrupt
service routine.

Update #3269.

comment:71 Changed on 06/16/23 at 05:30:14 by Sebastian Huber <sebastian.huber@…>

In 83305f5/rtems:

pci: Do not use BSP-specific interrupt API

Update #3269.

comment:72 Changed on 06/16/23 at 05:30:16 by Sebastian Huber <sebastian.huber@…>

In 4e3e9df/rtems:

bsps: Remove uses of BSP-specific interrupt API

Update #3269.

comment:73 Changed on 06/16/23 at 05:30:18 by Sebastian Huber <sebastian.huber@…>

In 65b0ba4/rtems:

bsps/sparc: Deprecate BSP-specific interrupt API

Update #3269.

Note: See TracTickets for help on using tickets.