summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorGUI <[email protected]>2024-05-28 09:55:24 +0800
committerGitHub <[email protected]>2024-05-28 09:55:24 +0800
commitde352aee62e55ec2bc0b142355c14f7895e4bd78 (patch)
tree2add9edbb709773639ffcc56bb1073c4d3eb9bf1 /components/drivers/include
parentf0351880943c392b8e439c196721060e66d4945a (diff)
[PIC] Make affinity helper interface (#8995)
* [PIC] Make affinity helper interface Signed-off-by: GuEe-GUI <[email protected]> * [PIC/GIC] Fixup GIC affinity init GICv2 is not support if current CPU is not startup, but RT-Thread SMP is startup after the devices init in the `main` thread. This patch fixup the cpumask to init once and check the init status in affinity interface. Signed-off-by: GuEe-GUI <[email protected]> --------- Signed-off-by: GuEe-GUI <[email protected]>
Diffstat (limited to 'components/drivers/include')
-rwxr-xr-xcomponents/drivers/include/drivers/pic.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/drivers/include/drivers/pic.h b/components/drivers/include/drivers/pic.h
index 5ab1434047..c2ca0e0079 100755
--- a/components/drivers/include/drivers/pic.h
+++ b/components/drivers/include/drivers/pic.h
@@ -40,7 +40,7 @@ struct rt_pic
rt_list_t list;
- struct rt_pic_ops *ops;
+ const struct rt_pic_ops *ops;
void *priv_data;
void *user_data;
@@ -91,6 +91,10 @@ struct rt_pic_isr
struct rt_irq_desc action;
};
+#define RT_IRQ_AFFINITY_DECLARE(name) RT_BITMAP_DECLARE(name, RT_CPUS_NR)
+#define RT_IRQ_AFFINITY_SET(affinity, cpuid) rt_bitmap_set_bit(affinity, cpuid)
+#define RT_IRQ_AFFINITY_CLEAR(affinity, cpuid) rt_bitmap_clear_bit(affinity, cpuid)
+
#ifdef RT_USING_PIC_STATISTICS
struct rt_pic_irq_statistics
{
@@ -117,7 +121,7 @@ struct rt_pic_irq
rt_uint32_t mode;
rt_uint32_t priority;
- RT_BITMAP_DECLARE(affinity, RT_CPUS_NR);
+ RT_IRQ_AFFINITY_DECLARE(affinity);
rt_list_t list;
rt_list_t children_nodes;