MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / ipmiCreateSession

Method ipmiCreateSession

kernel/orbis/src/ipmi.cpp:44–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44orbis::ErrorCode orbis::ipmiCreateSession(Thread *thread, void *sessionImpl,
45 ptr<void> userData,
46 rx::Ref<IpmiSession> &result) {
47 std::unique_lock ipmiMapLock(g_context->ipmiMap.mutex);
48
49 for (auto [kid, obj] : g_context->ipmiMap) {
50 auto server = dynamic_cast<IpmiServer *>(obj);
51 if (server == nullptr) {
52 continue;
53 }
54
55 std::lock_guard serverLock(server->mutex);
56 for (auto &conReq : server->connectionRequests) {
57 if (conReq.serverTid != thread->tid ||
58 conReq.client->session != nullptr ||
59 conReq.client->name != server->name) {
60 continue;
61 }
62
63 std::lock_guard clientLock(conReq.client->mutex);
64 if (conReq.client->session != nullptr) {
65 continue;
66 }
67
68 auto session = knew<IpmiSession>();
69 if (session == nullptr) {
70 return ErrorCode::NOMEM;
71 }
72
73 result = session;
74 session->sessionImpl = sessionImpl;
75 session->userData = userData;
76 session->client = conReq.client;
77 session->server = server;
78 conReq.client->session = session;
79 conReq.client->sessionCv.notify_one(conReq.client->mutex);
80
81 return {};
82 }
83 }
84
85 ORBIS_LOG_ERROR(__FUNCTION__, ": connection request not found");
86 return ErrorCode::INVAL;
87}
88
89orbis::SysResult orbis::sysIpmiCreateClient(Thread *thread, ptr<uint> result,
90 ptr<void> params,

Callers

nothing calls this directly

Calls 1

notify_oneMethod · 0.45

Tested by

no test coverage detected