diff options
| author | Chen Wang <[email protected]> | 2024-12-25 13:24:56 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2024-12-30 11:32:10 +0800 |
| commit | 724b2f129726ee9f832d29dfb35ad09f12248aae (patch) | |
| tree | 3ba0dd2146db4968e307e5eb802cae0c646c2f52 /components | |
| parent | 24cf724899b6f84c872060a3fcd934ab7127008a (diff) | |
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]>
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/smp_call/smp_call.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/drivers/smp_call/smp_call.h b/components/drivers/smp_call/smp_call.h index 18198b39f7..0ff9dd3c76 100644 --- a/components/drivers/smp_call/smp_call.h +++ b/components/drivers/smp_call/smp_call.h @@ -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__ |
