#include "opensbi/extensions/hsm.h" namespace drivers { namespace opensbi::hsm { namespace { enum class ExtensionId { HSM = 0x48534D }; enum class FunctionId { HART_START, HART_STOP, HART_GET_STATUS, HART_SUSPEND }; } SbiRet set_hsm( unsigned long hartid, unsigned long start_addr, unsigned long opaque) { return ecall( static_cast(ExtensionId::HSM), static_cast(FunctionId::HART_START), hartid, start_addr, opaque); } SbiRet hart_stop() { return ecall( static_cast(ExtensionId::HSM), static_cast(FunctionId::HART_STOP)); } SbiRet hart_get_status(unsigned long hartid) { return ecall( static_cast(ExtensionId::HSM), static_cast(FunctionId::HART_GET_STATUS), hartid); } SbiRet hart_suspend( SuspendType suspend_type, unsigned long resume_addr, unsigned long opaque) { return ecall( static_cast(ExtensionId::HSM), static_cast(FunctionId::HART_SUSPEND), static_cast(suspend_type), resume_addr, opaque); } } // End namespace opensbi::hsm } // End namespace drivers