1 /*
2  * Copyright (c) 2024 Intel Corporation
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 
7 #ifndef ZEPHYR_KERNEL_INCLUDE_IPI_H_
8 #define ZEPHYR_KERNEL_INCLUDE_IPI_H_
9 
10 #include <zephyr/kernel.h>
11 #include <stdint.h>
12 #include <zephyr/sys/atomic.h>
13 
14 #define IPI_ALL_CPUS_MASK  ((1 << CONFIG_MP_MAX_NUM_CPUS) - 1)
15 
16 #define IPI_CPU_MASK(cpu_id)   \
17 	(IS_ENABLED(CONFIG_IPI_OPTIMIZE) ? BIT(cpu_id) : IPI_ALL_CPUS_MASK)
18 
19 
20 /* defined in ipi.c when CONFIG_SMP=y */
21 #ifdef CONFIG_SMP
22 void flag_ipi(uint32_t ipi_mask);
23 void signal_pending_ipi(void);
24 atomic_val_t ipi_mask_create(struct k_thread *thread);
25 #else
26 #define flag_ipi(ipi_mask) do { } while (false)
27 #define signal_pending_ipi() do { } while (false)
28 #endif /* CONFIG_SMP */
29 
30 
31 #endif /* ZEPHYR_KERNEL_INCLUDE_IPI_H_ */
32