mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-07 15:36:26 +00:00
[orbis-kernel] stub ipmi server/client
This commit is contained in:
parent
482a61766e
commit
25d4e35509
4 changed files with 162 additions and 16 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include "evf.hpp"
|
||||
#include "ipmi.hpp"
|
||||
#include "osem.hpp"
|
||||
#include "utils/LinkedNode.hpp"
|
||||
#include "utils/SharedCV.hpp"
|
||||
|
|
@ -104,6 +105,28 @@ public:
|
|||
return {};
|
||||
}
|
||||
|
||||
std::pair<IpmiServer *, bool> createIpmiServer(utils::kstring name,
|
||||
std::uint32_t attrs,
|
||||
std::int32_t initCount,
|
||||
std::int32_t maxCount) {
|
||||
std::lock_guard lock(m_sem_mtx);
|
||||
auto [it, inserted] = mIpmiServers.try_emplace(std::move(name), nullptr);
|
||||
if (inserted) {
|
||||
it->second = knew<IpmiServer>(name);
|
||||
}
|
||||
|
||||
return {it->second.get(), inserted};
|
||||
}
|
||||
|
||||
Ref<IpmiServer> findIpmiServer(std::string_view name) {
|
||||
std::lock_guard lock(m_sem_mtx);
|
||||
if (auto it = mIpmiServers.find(name); it != mIpmiServers.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
enum {
|
||||
c_golden_ratio_prime = 2654404609u,
|
||||
c_umtx_chains = 512,
|
||||
|
|
@ -145,6 +168,9 @@ private:
|
|||
|
||||
shared_mutex m_sem_mtx;
|
||||
utils::kmap<utils::kstring, Ref<Semaphore>> m_semaphores;
|
||||
|
||||
shared_mutex mIpmiServerMtx;
|
||||
utils::kmap<utils::kstring, Ref<IpmiServer>> mIpmiServers;
|
||||
};
|
||||
|
||||
extern KernelContext &g_context;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue