mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-03 07:10:08 +01:00
add missed file
This commit is contained in:
parent
0f11b4020d
commit
0ce879d966
|
|
@ -129,11 +129,11 @@ struct IpmiServer {
|
|||
}
|
||||
|
||||
template <typename OutT, typename InT>
|
||||
requires(!std::is_same_v<InT, void>)
|
||||
IpmiServer &addSyncMethod(
|
||||
std::uint32_t methodId,
|
||||
std::function<std::int32_t(OutT &out, const InT ¶m)> handler) {
|
||||
syncMethods[methodId] = [=](orbis::IpmiSession &session,
|
||||
std::int32_t &errorCode,
|
||||
syncMethods[methodId] = [=](orbis::IpmiSession &, std::int32_t &errorCode,
|
||||
std::vector<std::vector<std::byte>> &outData,
|
||||
const std::vector<std::span<std::byte>> &inData)
|
||||
-> orbis::ErrorCode {
|
||||
|
|
@ -157,6 +157,31 @@ struct IpmiServer {
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename OutT, typename InT>
|
||||
requires std::is_same_v<InT, void>
|
||||
IpmiServer &addSyncMethod(std::uint32_t methodId,
|
||||
std::function<std::int32_t(OutT &out)> handler) {
|
||||
syncMethods[methodId] = [=](orbis::IpmiSession &, std::int32_t &errorCode,
|
||||
std::vector<std::vector<std::byte>> &outData,
|
||||
const std::vector<std::span<std::byte>> &inData)
|
||||
-> orbis::ErrorCode {
|
||||
if (outData.size() != 1 || inData.size() != 0) {
|
||||
return orbis::ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
if (outData[0].size() < sizeof(OutT)) {
|
||||
return orbis::ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
OutT out;
|
||||
errorCode = handler(out);
|
||||
std::memcpy(outData[0].data(), &out, sizeof(out));
|
||||
outData[0].resize(sizeof(OutT));
|
||||
return {};
|
||||
};
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
IpmiServer &
|
||||
addSyncMethod(std::uint32_t methodId,
|
||||
|
|
|
|||
Loading…
Reference in a new issue