OpenSBI: FunctionId in legacy extension, see previous commit
This commit is contained in:
parent
b08ac4817c
commit
dd373fca85
1 changed files with 14 additions and 10 deletions
|
@ -15,18 +15,22 @@ namespace opensbi::legacy {
|
|||
REMOTE_SFENCE_VMA_ASID,
|
||||
SHUTDOWN
|
||||
};
|
||||
|
||||
enum class Functionid {
|
||||
UNUSED
|
||||
};
|
||||
}
|
||||
|
||||
SbiRet set_timer(std::uint64_t stime_value) {
|
||||
#if __riscv_xlen == 64
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::SET_TIMER),
|
||||
0,
|
||||
static_cast<sbiword_t>(Functionid::UNUSED),
|
||||
stime_value);
|
||||
#else
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::SET_TIMER),
|
||||
0,
|
||||
static_cast<sbiword_t>(Functionid::UNUSED),
|
||||
static_cast<uint32_t>(stime_value),
|
||||
static_cast<uint32_t>(stime_value >> 32));
|
||||
#endif
|
||||
|
@ -35,33 +39,33 @@ namespace opensbi::legacy {
|
|||
SbiRet console_putchar(int ch) {
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::CONSOLE_PUTCHAR),
|
||||
0,
|
||||
static_cast<sbiword_t>(Functionid::UNUSED),
|
||||
ch);
|
||||
}
|
||||
|
||||
SbiRet console_getchar() {
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::CONSOLE_GETCHAR),
|
||||
0);
|
||||
static_cast<sbiword_t>(Functionid::UNUSED));
|
||||
}
|
||||
|
||||
SbiRet clear_ipmi() {
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::CLEAR_IPI),
|
||||
0);
|
||||
static_cast<sbiword_t>(Functionid::UNUSED));
|
||||
}
|
||||
|
||||
SbiRet send_ipmi(hart_mask_t hart_mask) {
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::SEND_IPI),
|
||||
0,
|
||||
static_cast<sbiword_t>(Functionid::UNUSED),
|
||||
reinterpret_cast<sbiword_t>(hart_mask));
|
||||
}
|
||||
|
||||
SbiRet remote_fence_i(hart_mask_t hart_mask) {
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::REMOTE_FENCE_I),
|
||||
0,
|
||||
static_cast<sbiword_t>(Functionid::UNUSED),
|
||||
reinterpret_cast<sbiword_t>(hart_mask));
|
||||
}
|
||||
|
||||
|
@ -71,7 +75,7 @@ namespace opensbi::legacy {
|
|||
sbiword_t size) {
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::REMOTE_SFENCE_VMA),
|
||||
0,
|
||||
static_cast<sbiword_t>(Functionid::UNUSED),
|
||||
reinterpret_cast<sbiword_t>(hart_mask),
|
||||
start,
|
||||
size);
|
||||
|
@ -84,7 +88,7 @@ namespace opensbi::legacy {
|
|||
sbiword_t asid) {
|
||||
return ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::REMOTE_SFENCE_VMA_ASID),
|
||||
0,
|
||||
static_cast<sbiword_t>(Functionid::UNUSED),
|
||||
reinterpret_cast<sbiword_t>(hart_mask),
|
||||
start,
|
||||
size,
|
||||
|
@ -94,7 +98,7 @@ namespace opensbi::legacy {
|
|||
void shutdown() {
|
||||
ecall(
|
||||
static_cast<sbiword_t>(ExtensionId::SHUTDOWN),
|
||||
0);
|
||||
static_cast<sbiword_t>(Functionid::UNUSED));
|
||||
|
||||
// This should never be reached, explode if it is
|
||||
__builtin_trap();
|
||||
|
|
Loading…
Reference in a new issue