Skip to content

Commit 1f2fd7f

Browse files
committed
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 <[email protected]>
1 parent 8c762b4 commit 1f2fd7f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/drivers/smp_call/smp_call.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#define __SMP_IPI_H__
1414
#include <rtthread.h>
1515

16+
#ifdef RT_USING_SMP
17+
1618
/* callback of smp call */
1719
typedef void (*rt_smp_call_cb_t)(void *data);
1820
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)
6668
return iter == cpuid ? iter + 1 : iter;
6769
}
6870
#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))
69-
#endif
71+
72+
#endif // RT_USING_SMP
73+
74+
#endif // __SMP_IPI_H__

0 commit comments

Comments
 (0)