summaryrefslogtreecommitdiffstats
path: root/bsps
diff options
context:
space:
mode:
Diffstat (limited to 'bsps')
-rw-r--r--bsps/powerpc/qoriq/start/bsprestart.c2
-rw-r--r--bsps/riscv/riscv/irq/irq.c18
-rw-r--r--bsps/shared/dev/clock/clockimpl.h6
3 files changed, 14 insertions, 12 deletions
diff --git a/bsps/powerpc/qoriq/start/bsprestart.c b/bsps/powerpc/qoriq/start/bsprestart.c
index 3118afd46b..3dc9d6ffce 100644
--- a/bsps/powerpc/qoriq/start/bsprestart.c
+++ b/bsps/powerpc/qoriq/start/bsprestart.c
@@ -67,7 +67,7 @@ static void restart_interrupt(void *arg)
(void) level;
_SMP_barrier_State_initialize(&bs);
- _SMP_barrier_Wait(&restart_barrier, &bs, _SMP_Get_processor_count());
+ _SMP_barrier_Wait(&restart_barrier, &bs, _SMP_Get_processor_maximum());
cpu_self_index = rtems_scheduler_get_processor();
thread_index = cpu_self_index % QORIQ_THREAD_COUNT;
diff --git a/bsps/riscv/riscv/irq/irq.c b/bsps/riscv/riscv/irq/irq.c
index 3c35a379a4..ffd9bbe61f 100644
--- a/bsps/riscv/riscv/irq/irq.c
+++ b/bsps/riscv/riscv/irq/irq.c
@@ -247,12 +247,12 @@ void bsp_interrupt_vector_enable(rtems_vector_number vector)
if (enable != NULL) {
enable[group] |= bit;
} else {
+ uint32_t cpu_max;
uint32_t cpu_index;
- uint32_t cpu_count;
- cpu_count = _SMP_Get_processor_count();
+ cpu_max = _SMP_Get_processor_maximum();
- for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {
+ for (cpu_index = 0; cpu_index < cpu_max; ++cpu_index) {
Per_CPU_Control *cpu;
cpu = _Per_CPU_Get_by_index(cpu_index);
@@ -289,12 +289,12 @@ void bsp_interrupt_vector_disable(rtems_vector_number vector)
if (enable != NULL) {
enable[group] &= ~bit;
} else {
+ uint32_t cpu_max;
uint32_t cpu_index;
- uint32_t cpu_count;
- cpu_count = _SMP_Get_processor_count();
+ cpu_max = _SMP_Get_processor_maximum();
- for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {
+ for (cpu_index = 0; cpu_index < cpu_max; ++cpu_index) {
Per_CPU_Control *cpu;
cpu = _Per_CPU_Get_by_index(cpu_index);
@@ -357,12 +357,12 @@ void bsp_interrupt_get_affinity(
enable = riscv_plic_irq_to_cpu[interrupt_index - 1];
if (enable != NULL) {
+ uint32_t cpu_max;
uint32_t cpu_index;
- uint32_t cpu_count;
- cpu_count = _SMP_Get_processor_count();
+ cpu_max = _SMP_Get_processor_maximum();
- for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {
+ for (cpu_index = 0; cpu_index < cpu_max; ++cpu_index) {
Per_CPU_Control *cpu;
cpu = _Per_CPU_Get_by_index(cpu_index);
diff --git a/bsps/shared/dev/clock/clockimpl.h b/bsps/shared/dev/clock/clockimpl.h
index 7913cde28c..f5eb4dcd1d 100644
--- a/bsps/shared/dev/clock/clockimpl.h
+++ b/bsps/shared/dev/clock/clockimpl.h
@@ -79,10 +79,12 @@ static void Clock_driver_timecounter_tick( void )
#if defined(CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER)
rtems_clock_tick();
#elif defined(RTEMS_SMP) && defined(CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR)
- uint32_t cpu_count = _SMP_Get_processor_count();
+ uint32_t cpu_max;
uint32_t cpu_index;
- for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
+ cpu_max = _SMP_Get_processor_maximum();
+
+ for ( cpu_index = 0 ; cpu_index < cpu_max ; ++cpu_index ) {
Per_CPU_Control *cpu;
cpu = _Per_CPU_Get_by_index( cpu_index );