This commit is contained in:
zhujiale 2024-09-12 13:12:35 +08:00 committed by Rbb666
parent 5f83c51347
commit 244cf61af6
4 changed files with 10 additions and 8 deletions

View File

@ -107,7 +107,7 @@ void rt_smp_call_func_cond(int cpu_mask, smp_call_func_back func, void *data,rt_
tmp_id++;
tmp_mask = tmp_mask >> 1;
}
rt_hw_ipi_send(RT_IPI_FUNC, cpu_mask);
rt_hw_ipi_send(RT_FUNC_IPI, cpu_mask);
}
if(need_wait)
@ -143,4 +143,3 @@ void smp_init(void)
rt_spin_lock_init(&global_work[i].lock);
}
}

View File

@ -26,10 +26,9 @@ void test1()
cpu_mask = rand() % 0xf;
if (cpu_mask == 0)
pass--;
rt_call_each_cpu(test_call, &cpu_mask, SMP_CALL_NO_WAIT);
rt_call_any_cpu(cpu_mask,test_call, &cpu_mask, SMP_CALL_WAIT_ALL);
if (i % 20 == 0)
rt_kprintf("#");
rt_thread_mdelay(1);
}
rt_kprintf("\n");
uassert_true(pass_count == pass);
@ -57,6 +56,8 @@ void test2(void)
static rt_err_t utest_tc_init(void)
{
pass_count = 0;
pass = 1000;
rt_spin_lock_init(&lock);
return RT_EOK;
}

View File

@ -672,10 +672,12 @@ typedef struct rt_cpu_usage_stats *rt_cpu_usage_stats_t;
#define RT_STOP_IPI 1
#endif /* RT_STOP_IPI */
#ifndef RT_IPI_FUNC
#define RT_IPI_FUNC 2
#ifndef RT_FUNC_IPI
#define RT_FUNC_IPI 2
#endif
#define RT_MAX_IPI 3
#define _SCHEDULER_CONTEXT(fileds) fileds
/**

View File

@ -306,10 +306,10 @@ void rt_hw_common_setup(void)
/* Install the IPI handle */
rt_hw_ipi_handler_install(RT_SCHEDULE_IPI, rt_scheduler_ipi_handler);
rt_hw_ipi_handler_install(RT_STOP_IPI, rt_scheduler_ipi_handler);
rt_hw_ipi_handler_install(RT_IPI_FUNC, rt_smp_call_ipi_handler);
rt_hw_ipi_handler_install(RT_FUNC_IPI, rt_smp_call_ipi_handler);
rt_hw_interrupt_umask(RT_SCHEDULE_IPI);
rt_hw_interrupt_umask(RT_STOP_IPI);
rt_hw_interrupt_umask(RT_IPI_FUNC);
rt_hw_interrupt_umask(RT_FUNC_IPI);
#endif
}