2024-03-08 20:51:01 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024 Intel Corporation
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_KERNEL_INCLUDE_IPI_H_
|
|
|
|
#define ZEPHYR_KERNEL_INCLUDE_IPI_H_
|
|
|
|
|
2024-02-17 02:54:47 +08:00
|
|
|
#include <zephyr/kernel.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <zephyr/sys/atomic.h>
|
|
|
|
|
|
|
|
#define IPI_ALL_CPUS_MASK ((1 << CONFIG_MP_MAX_NUM_CPUS) - 1)
|
|
|
|
|
|
|
|
#define IPI_CPU_MASK(cpu_id) \
|
|
|
|
(IS_ENABLED(CONFIG_IPI_OPTIMIZE) ? BIT(cpu_id) : IPI_ALL_CPUS_MASK)
|
|
|
|
|
|
|
|
|
2024-03-08 20:51:01 +08:00
|
|
|
/* defined in ipi.c when CONFIG_SMP=y */
|
|
|
|
#ifdef CONFIG_SMP
|
2024-02-17 02:54:47 +08:00
|
|
|
void flag_ipi(uint32_t ipi_mask);
|
2024-03-08 20:51:01 +08:00
|
|
|
void signal_pending_ipi(void);
|
2024-02-17 02:54:47 +08:00
|
|
|
atomic_val_t ipi_mask_create(struct k_thread *thread);
|
2024-03-08 20:51:01 +08:00
|
|
|
#else
|
2024-02-17 02:54:47 +08:00
|
|
|
#define flag_ipi(ipi_mask) do { } while (false)
|
2024-03-08 20:51:01 +08:00
|
|
|
#define signal_pending_ipi() do { } while (false)
|
|
|
|
#endif /* CONFIG_SMP */
|
|
|
|
|
2024-02-17 02:54:47 +08:00
|
|
|
|
2024-03-08 20:51:01 +08:00
|
|
|
#endif /* ZEPHYR_KERNEL_INCLUDE_IPI_H_ */
|