bsps: Add gicv3_get_attributes()

This commit is contained in:
Sebastian Huber
2022-03-14 16:53:18 +01:00
parent d8b23fa488
commit 0725b200e7
2 changed files with 33 additions and 26 deletions

View File

@@ -327,6 +327,38 @@ static void gicv3_init_cpu_interface(uint32_t cpu_index)
WRITE_SR(ICC_CTLR, 0x0); WRITE_SR(ICC_CTLR, 0x0);
} }
static inline void gicv3_get_attributes(
rtems_vector_number vector,
rtems_interrupt_attributes *attributes
)
{
attributes->is_maskable = true;
attributes->maybe_enable = true;
attributes->maybe_disable = true;
attributes->can_raise = true;
if ( vector <= ARM_GIC_IRQ_SGI_LAST ) {
/*
* It is implementation-defined whether implemented SGIs are permanently
* enabled, or can be enabled and disabled by writes to GICD_ISENABLER0 and
* GICD_ICENABLER0.
*/
attributes->can_raise_on = true;
attributes->cleared_by_acknowledge = true;
attributes->trigger_signal = RTEMS_INTERRUPT_NO_SIGNAL;
} else {
attributes->can_disable = true;
attributes->can_clear = true;
attributes->trigger_signal = RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL;
if ( vector > ARM_GIC_IRQ_PPI_LAST ) {
/* SPI */
attributes->can_get_affinity = true;
attributes->can_set_affinity = true;
}
}
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -49,32 +49,7 @@ rtems_status_code bsp_interrupt_get_attributes(
rtems_interrupt_attributes *attributes rtems_interrupt_attributes *attributes
) )
{ {
attributes->is_maskable = true; gicv3_get_attributes(vector, attributes);
attributes->maybe_enable = true;
attributes->maybe_disable = true;
attributes->can_raise = true;
if ( vector <= ARM_GIC_IRQ_SGI_LAST ) {
/*
* It is implementation-defined whether implemented SGIs are permanently
* enabled, or can be enabled and disabled by writes to GICD_ISENABLER0 and
* GICD_ICENABLER0.
*/
attributes->can_raise_on = true;
attributes->cleared_by_acknowledge = true;
attributes->trigger_signal = RTEMS_INTERRUPT_NO_SIGNAL;
} else {
attributes->can_disable = true;
attributes->can_clear = true;
attributes->trigger_signal = RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL;
if ( vector > ARM_GIC_IRQ_PPI_LAST ) {
/* SPI */
attributes->can_get_affinity = true;
attributes->can_set_affinity = true;
}
}
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }