OpenSBI: Added IPI extension
This commit is contained in:
parent
b26479e625
commit
854f65a4b3
3 changed files with 43 additions and 1 deletions
28
kernel/drivers/opensbi/extensions/ipi.cpp
Normal file
28
kernel/drivers/opensbi/extensions/ipi.cpp
Normal 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
|
||||
|
13
kernel/drivers/opensbi/include/opensbi/extensions/ipi.h
Normal file
13
kernel/drivers/opensbi/include/opensbi/extensions/ipi.h
Normal 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
|
|
@ -3,7 +3,8 @@ kernel_sources += [
|
|||
'opensbi.cpp',
|
||||
'extensions/legacy.cpp',
|
||||
'extensions/base.cpp',
|
||||
'extensions/timer.cpp'
|
||||
'extensions/timer.cpp',
|
||||
'extensions/ipi.cpp'
|
||||
),
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue