diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-11-09 16:27:23 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-11-09 17:27:11 +0200 |
| commit | a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b (patch) | |
| tree | ae319c8f389e7ca39bbdd4b114655f8604563305 /arch/riscv64/kernel/sbi.h | |
| parent | 2b5533aefef026fe7bada314ebdb2651b809979a (diff) | |
| download | kmi-a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b.tar.gz kmi-a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b.zip | |
add basic IPI structure
Diffstat (limited to 'arch/riscv64/kernel/sbi.h')
| -rw-r--r-- | arch/riscv64/kernel/sbi.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/sbi.h b/arch/riscv64/kernel/sbi.h index 2add35f..19cc595 100644 --- a/arch/riscv64/kernel/sbi.h +++ b/arch/riscv64/kernel/sbi.h @@ -106,4 +106,24 @@ static inline struct sbiret sbi_system_reset(uint32_t reset_type, 0); } +/** Supervisor IPI extension ID. */ +#define EID_sPI 0x735049 + +/** Supervisor IPI function ID. */ +#define FID_IPI 0 + +/** + * Send IPI. + * + * @param hart_mask Bitmap of harts to send IPI to. + * @param hart_mask_base Base of \p hart_mask. + * @return SBI call return. \see sbiret. + */ +static inline struct sbiret sbi_send_ipi(unsigned long hart_mask, + unsigned long hart_mask_base) +{ + return sbi_ecall(EID_sPI, FID_IPI, hart_mask, hart_mask_base, 0, 0, 0, + 0); +} + #endif /* APOS_RISCV_SBI_H */ |
