1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include <mos/types.h>
6#include <mos/types.hpp>
7
8/**
9 * @brief The type of IPI to send
10 *
11 */
12typedef enum
13{
14 IPI_TYPE_HALT = 0, // halt the CPU
15 IPI_TYPE_INVALIDATE_TLB, // TLB shootdown
16 IPI_TYPE_RESCHEDULE, // Reschedule
17 IPI_TYPE_MAX,
18} ipi_type_t;
19
20MOS_STATIC_ASSERT(IPI_TYPE_MAX <= (u8) 0xFF, "IPI_TYPE_MAX must fit in a u8");
21
22#define TARGET_CPU_ALL 0xFF
23
24void ipi_send(u8 target, ipi_type_t type);
25void ipi_send_all(ipi_type_t type);
26void ipi_do_handle(ipi_type_t type);
27