components: drivers: add RT_USING_SMP judgement inside smp_call.h
smp_call.h defines SMP-related structures and declares SMP-related functions. These codes are only valid when RT_USING_SMP is defined in the bsp, which means we have to use RT_USING_SMP for judgment in every place where this file is included, such as following: ```c ``` Now move the judgment of RT_USING_SMP directly into smp_call.h, so that it's simpler to include the header file as: ```c ``` Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
This commit is contained in:
parent
24cf724899
commit
724b2f1297
@ -13,6 +13,8 @@
|
||||
#define __SMP_IPI_H__
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef RT_USING_SMP
|
||||
|
||||
/* callback of smp call */
|
||||
typedef void (*rt_smp_call_cb_t)(void *data);
|
||||
typedef rt_bool_t (*rt_smp_cond_t)(int cpu, void *info);
|
||||
@ -66,4 +68,7 @@ rt_inline size_t rt_smp_get_next_remote(size_t iter, size_t cpuid)
|
||||
return iter == cpuid ? iter + 1 : iter;
|
||||
}
|
||||
#define rt_smp_for_each_remote_cpu(_iter, _cpuid) for (_iter = rt_smp_get_next_remote(-1, _cpuid); (_iter) < RT_CPUS_NR; _iter=rt_smp_get_next_remote(_iter, _cpuid))
|
||||
#endif
|
||||
|
||||
#endif // RT_USING_SMP
|
||||
|
||||
#endif // __SMP_IPI_H__
|
||||
|
Loading…
x
Reference in New Issue
Block a user