summaryrefslogtreecommitdiffstats
path: root/bsps/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2024-03-20 15:54:33 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2024-03-27 20:20:38 +0100
commit5b0e355ed75de33e9fe0d9dacd1fde4353537d42 (patch)
treef19d59e5bd7e0efe764a460d5839ffd049cc0a15 /bsps/include
parentrtems: Avoid -Wundef warnings in API header (diff)
downloadrtems-5b0e355ed75de33e9fe0d9dacd1fde4353537d42.tar.bz2
bsps: Move declarations to <bsp/irq-generic.h>
Move declarations of bsp_interrupt_get_affinity() and bsp_interrupt_set_affinity() to <bsp/irq-generic.h>. Canonicalize the <bsp/irq.h> includes. Implement bsp_interrupt_get_affinity() and bsp_interrupt_set_affinity() only if needed (usually RTEMS_SMP). Provide stub implementations for i386 to fix build errors.
Diffstat (limited to 'bsps/include')
-rw-r--r--bsps/include/bsp/irq-generic.h52
-rw-r--r--bsps/include/dev/irq/arm-gic-irq.h11
2 files changed, 51 insertions, 12 deletions
diff --git a/bsps/include/bsp/irq-generic.h b/bsps/include/bsp/irq-generic.h
index 5ed9cac688..bd557df9dc 100644
--- a/bsps/include/bsp/irq-generic.h
+++ b/bsps/include/bsp/irq-generic.h
@@ -12,7 +12,7 @@
/*
* Copyright (C) 2016 Chris Johns <chrisj@rtems.org>
*
- * Copyright (C) 2008, 2021 embedded brains GmbH & Co. KG
+ * Copyright (C) 2008, 2024 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -47,6 +47,7 @@
#include <rtems/irq-extension.h>
#include <rtems/score/assert.h>
+#include <rtems/score/processormask.h>
#ifdef RTEMS_SMP
#include <rtems/score/atomic.h>
@@ -372,6 +373,55 @@ rtems_status_code bsp_interrupt_raise_on(
*/
rtems_status_code bsp_interrupt_clear( rtems_vector_number vector );
+/**
+ * @brief Gets the processor affinity set of the interrupt vector.
+ *
+ * The function may have no implementation in uniprocessor configurations.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param[out] affinity is the pointer to a Processor_mask object. When the
+ * directive call is successful, the processor affinity set of the interrupt
+ * vector will be stored in this object. A set bit in the processor set
+ * means that the corresponding processor is in the processor affinity set of
+ * the interrupt vector, otherwise the bit is cleared.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_UNSATISFIED The request to get the processor affinity of the
+ * interrupt vector has not been satisfied.
+ */
+rtems_status_code bsp_interrupt_get_affinity(
+ rtems_vector_number vector,
+ Processor_mask *affinity
+);
+
+/**
+ * @brief Sets the processor affinity set of the interrupt vector.
+ *
+ * The function may have no implementation in uniprocessor configurations.
+ *
+ * @param vector is the interrupt vector number. It shall be valid.
+ *
+ * @param affinity is the pointer to a Processor_mask object. The processor set
+ * defines the new processor affinity set of the interrupt vector. A set bit
+ * in the processor set means that the corresponding processor shall be in
+ * the processor affinity set of the interrupt vector, otherwise the bit
+ * shall be cleared.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_NUMBER The referenced processor set was not a valid
+ * new processor affinity set for the interrupt vector.
+ *
+ * @retval ::RTEMS_UNSATISFIED The request to set the processor affinity of the
+ * interrupt vector has not been satisfied.
+ */
+rtems_status_code bsp_interrupt_set_affinity(
+ rtems_vector_number vector,
+ const Processor_mask *affinity
+);
+
#if defined(RTEMS_SMP)
/**
* @brief Handles a spurious interrupt.
diff --git a/bsps/include/dev/irq/arm-gic-irq.h b/bsps/include/dev/irq/arm-gic-irq.h
index b3487176f6..1fcf594360 100644
--- a/bsps/include/dev/irq/arm-gic-irq.h
+++ b/bsps/include/dev/irq/arm-gic-irq.h
@@ -38,7 +38,6 @@
#include <bsp.h>
#include <dev/irq/arm-gic.h>
-#include <rtems/score/processormask.h>
#ifdef __cplusplus
extern "C" {
@@ -85,16 +84,6 @@ rtems_status_code arm_gic_irq_get_group(
gic_group *group
);
-rtems_status_code bsp_interrupt_set_affinity(
- rtems_vector_number vector,
- const Processor_mask *affinity
-);
-
-rtems_status_code bsp_interrupt_get_affinity(
- rtems_vector_number vector,
- Processor_mask *affinity
-);
-
void arm_gic_trigger_sgi(rtems_vector_number vector, uint32_t targets);
static inline rtems_status_code arm_gic_irq_generate_software_irq(