SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID,
};
+#ifdef CONFIG_SBI_V01
+#define SBI_EXT_SET_TIMER SBI_EXT_0_1_SET_TIMER
+#define SBI_FID_SET_TIMER 0
+#define SBI_EXT_SEND_IPI SBI_EXT_0_1_SEND_IPI
+#define SBI_FID_SEND_IPI 0
+#define SBI_EXT_REMOTE_FENCE_I SBI_EXT_0_1_REMOTE_FENCE_I
+#define SBI_FID_REMOTE_FENCE_I 0
+#define SBI_EXT_REMOTE_SFENCE_VMA SBI_EXT_0_1_REMOTE_SFENCE_VMA
+#define SBI_FID_REMOTE_SFENCE_VMA 0
+#define SBI_EXT_REMOTE_SFENCE_VMA_ASID SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID
+#define SBI_FID_REMOTE_SFENCE_VMA_ASID 0
+#else
+#define SBI_EXT_SET_TIMER SBI_EXT_TIME
+#define SBI_FID_SET_TIMER SBI_EXT_TIME_SET_TIMER
+#define SBI_EXT_SEND_IPI SBI_EXT_IPI
+#define SBI_FID_SEND_IPI SBI_EXT_IPI_SEND_IPI
+#define SBI_EXT_REMOTE_FENCE_I SBI_EXT_RFENCE
+#define SBI_FID_REMOTE_FENCE_I SBI_EXT_RFENCE_REMOTE_FENCE_I
+#define SBI_EXT_REMOTE_SFENCE_VMA SBI_EXT_RFENCE
+#define SBI_FID_REMOTE_SFENCE_VMA SBI_EXT_RFENCE_REMOTE_SFENCE_VMA
+#define SBI_EXT_REMOTE_SFENCE_VMA_ASID SBI_EXT_RFENCE
+#define SBI_FID_REMOTE_SFENCE_VMA_ASID SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID
+#endif
+
#define SBI_SPEC_VERSION_DEFAULT 0x1
#define SBI_SPEC_VERSION_MAJOR_SHIFT 24
#define SBI_SPEC_VERSION_MAJOR_MASK 0x7f
void sbi_set_timer(uint64_t stime_value)
{
#if __riscv_xlen == 32
- sbi_ecall(SBI_EXT_0_1_SET_TIMER, 0, stime_value,
+ sbi_ecall(SBI_EXT_SET_TIMER, SBI_FID_SET_TIMER, stime_value,
stime_value >> 32, 0, 0, 0, 0);
#else
- sbi_ecall(SBI_EXT_0_1_SET_TIMER, 0, stime_value, 0, 0, 0, 0, 0);
+ sbi_ecall(SBI_EXT_SET_TIMER, SBI_FID_SET_TIMER, stime_value,
+ 0, 0, 0, 0, 0);
#endif
}
*/
void sbi_send_ipi(const unsigned long *hart_mask)
{
- sbi_ecall(SBI_EXT_0_1_SEND_IPI, 0, (unsigned long)hart_mask,
+ sbi_ecall(SBI_EXT_SEND_IPI, SBI_FID_SEND_IPI, (unsigned long)hart_mask,
0, 0, 0, 0, 0);
}
*/
void sbi_remote_fence_i(const unsigned long *hart_mask)
{
- sbi_ecall(SBI_EXT_0_1_REMOTE_FENCE_I, 0, (unsigned long)hart_mask,
- 0, 0, 0, 0, 0);
+ sbi_ecall(SBI_EXT_REMOTE_FENCE_I, SBI_FID_REMOTE_FENCE_I,
+ (unsigned long)hart_mask, 0, 0, 0, 0, 0);
}
/**
unsigned long start,
unsigned long size)
{
- sbi_ecall(SBI_EXT_0_1_REMOTE_SFENCE_VMA, 0,
+ sbi_ecall(SBI_EXT_REMOTE_SFENCE_VMA, SBI_FID_REMOTE_SFENCE_VMA,
(unsigned long)hart_mask, start, size, 0, 0, 0);
}
unsigned long size,
unsigned long asid)
{
- sbi_ecall(SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID, 0,
+ sbi_ecall(SBI_EXT_REMOTE_SFENCE_VMA_ASID,
+ SBI_FID_REMOTE_SFENCE_VMA_ASID,
(unsigned long)hart_mask, start, size, asid, 0, 0);
}