summaryrefslogtreecommitdiffstats
path: root/bsps
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-03-15 17:34:34 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-03-16 07:29:27 +0100
commitf311caf984a46b8629f891de5904af385486fa9e (patch)
treeda22a529af12b49f6f941593690e93242261b252 /bsps
parentbsps/irq: Fix formatting (diff)
downloadrtems-f311caf984a46b8629f891de5904af385486fa9e.tar.bz2
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.
Diffstat (limited to 'bsps')
-rw-r--r--bsps/shared/irq/irq-affinity.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bsps/shared/irq/irq-affinity.c b/bsps/shared/irq/irq-affinity.c
index cce10984dd..c21468077b 100644
--- a/bsps/shared/irq/irq-affinity.c
+++ b/bsps/shared/irq/irq-affinity.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright (C) 2017 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2017, 2022 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,6 +37,7 @@
#include <bsp/irq-generic.h>
#include <rtems/score/processormask.h>
+#include <rtems/score/smpimpl.h>
rtems_status_code rtems_interrupt_set_affinity(
rtems_vector_number vector,
@@ -60,6 +61,11 @@ rtems_status_code rtems_interrupt_set_affinity(
return RTEMS_INVALID_NUMBER;
}
+ _Processor_mask_And( &set, _SMP_Get_online_processors(), &set );
+ if ( _Processor_mask_Is_zero( &set ) ) {
+ return RTEMS_INVALID_NUMBER;
+ }
+
#if defined(RTEMS_SMP)
return bsp_interrupt_set_affinity( vector, &set );
#else