OpenSBI: Added IPI extension

This commit is contained in:
Thomas Muller 2022-01-24 21:36:53 -05:00
parent b26479e625
commit 854f65a4b3
Signed by: thomas
GPG key ID: AF006EB730564952
3 changed files with 43 additions and 1 deletions

View file

@ -0,0 +1,28 @@
#include "opensbi/extensions/ipi.h"
namespace drivers {
namespace opensbi::ipi {
namespace {
enum class ExtensionId {
IPI = 0x735049
};
enum class FunctionId {
SEND_IPI
};
}
SbiRet send_ipi(
unsigned long hart_mask,
unsigned long hart_mask_base) {
return ecall(
static_cast<sbiword_t>(ExtensionId::IPI),
static_cast<sbiword_t>(FunctionId::SEND_IPI),
hart_mask,
hart_mask_base);
}
} // End namespace opensbi::ipi
} // End namespace drivers

View file

@ -0,0 +1,13 @@
#pragma once
#include "opensbi/opensbi.h"
namespace drivers {
namespace opensbi::ipi {
SbiRet send_ipi(
unsigned long hart_mask,
unsigned long hart_mask_base);
} // End namespace opensbi::ipi
} // End namespace drivers

View file

@ -3,7 +3,8 @@ kernel_sources += [
'opensbi.cpp',
'extensions/legacy.cpp',
'extensions/base.cpp',
'extensions/timer.cpp'
'extensions/timer.cpp',
'extensions/ipi.cpp'
),
]