mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
Moved Rc, BitSet, LinkedNode, IdMap utilities from orbis to rx
This commit is contained in:
parent
7b03b695f5
commit
ac853e0817
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
#include "orbis-config.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "utils/BitSet.hpp"
|
||||
#include "utils/Rc.hpp"
|
||||
#include "rx/BitSet.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
#include <mutex>
|
||||
|
|
@ -44,7 +44,7 @@ static_assert(sizeof(BudgetInfo) == 0x18);
|
|||
using BudgetInfoList =
|
||||
std::array<BudgetInfo, static_cast<int>(BudgetResource::_count)>;
|
||||
|
||||
class Budget : public RcBase {
|
||||
class Budget : public rx::RcBase {
|
||||
using BudgetList =
|
||||
std::array<BudgetItem, static_cast<int>(BudgetResource::_count)>;
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ public:
|
|||
|
||||
private:
|
||||
mutable rx::shared_mutex mMtx;
|
||||
orbis::BitSet<static_cast<int>(BudgetResource::_count)> mUsed;
|
||||
rx::BitSet<static_cast<int>(BudgetResource::_count)> mUsed;
|
||||
ProcessType mProcessType{};
|
||||
BudgetList mList;
|
||||
char mName[32]{};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <deque>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
|
@ -56,22 +56,30 @@ using kunmap =
|
|||
template <typename T, typename... Args>
|
||||
requires(std::is_constructible_v<T, Args...>)
|
||||
T *knew(Args &&...args) {
|
||||
auto loc = static_cast<T *>(utils::kalloc(sizeof(T), alignof(T)));
|
||||
auto res = std::construct_at(loc, std::forward<Args>(args)...);
|
||||
if constexpr (requires(T *t) { t->_total_size = sizeof(T); })
|
||||
res->_total_size = sizeof(T);
|
||||
return res;
|
||||
if constexpr (std::is_base_of_v<rx::RcBase, T>) {
|
||||
static_assert(!std::is_final_v<T>);
|
||||
struct DynamicObject final : T {
|
||||
using T::T;
|
||||
|
||||
void operator delete(void *pointer) { utils::kfree(pointer, sizeof(T)); }
|
||||
};
|
||||
|
||||
auto loc = static_cast<DynamicObject *>(
|
||||
utils::kalloc(sizeof(DynamicObject), alignof(DynamicObject)));
|
||||
return std::construct_at(loc, std::forward<Args>(args)...);
|
||||
} else {
|
||||
static_assert(!std::is_polymorphic_v<T>, "Polymorphic type should be derived from rx::RcBase");
|
||||
|
||||
auto loc = static_cast<T *>(utils::kalloc(sizeof(T), alignof(T)));
|
||||
return std::construct_at(loc, std::forward<Args>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
template <typename T> void kdelete(T *ptr) {
|
||||
auto total_size = sizeof(T);
|
||||
if constexpr (requires(T *t) { t->_total_size = sizeof(T); })
|
||||
total_size = ptr->_total_size;
|
||||
else
|
||||
static_assert(std::is_final_v<T>, "Uncertain type size");
|
||||
static_assert(std::is_final_v<T>, "Uncertain type size");
|
||||
ptr->~T();
|
||||
utils::kfree(ptr, total_size);
|
||||
utils::kfree(ptr, sizeof(T));
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include "rx/SharedCV.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "thread/types.hpp"
|
||||
#include "utils/IdMap.hpp"
|
||||
#include "utils/LinkedNode.hpp"
|
||||
#include "rx/IdMap.hpp"
|
||||
#include "rx/LinkedNode.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <mutex>
|
||||
|
|
@ -57,7 +57,7 @@ enum class FwType : std::uint8_t {
|
|||
Ps5,
|
||||
};
|
||||
|
||||
struct RcAppInfo : RcBase, AppInfoEx {
|
||||
struct RcAppInfo : rx::RcBase, AppInfoEx {
|
||||
orbis::uint32_t appState = 0;
|
||||
};
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ public:
|
|||
Process *findProcessById(pid_t pid) const;
|
||||
Process *findProcessByHostId(std::uint64_t pid) const;
|
||||
|
||||
utils::LinkedNode<Process> *getProcessList() { return m_processes; }
|
||||
rx::LinkedNode<Process> *getProcessList() { return m_processes; }
|
||||
|
||||
long allocatePid() {
|
||||
std::lock_guard lock(m_thread_id_mtx);
|
||||
|
|
@ -98,7 +98,7 @@ public:
|
|||
return {it->second.get(), inserted};
|
||||
}
|
||||
|
||||
Ref<EventFlag> findEventFlag(std::string_view name) {
|
||||
rx::Ref<EventFlag> findEventFlag(std::string_view name) {
|
||||
std::lock_guard lock(m_evf_mtx);
|
||||
|
||||
if (auto it = m_event_flags.find(name); it != m_event_flags.end()) {
|
||||
|
|
@ -121,7 +121,7 @@ public:
|
|||
return {it->second.get(), inserted};
|
||||
}
|
||||
|
||||
Ref<Semaphore> findSemaphore(std::string_view name) {
|
||||
rx::Ref<Semaphore> findSemaphore(std::string_view name) {
|
||||
std::lock_guard lock(m_sem_mtx);
|
||||
if (auto it = m_semaphores.find(name); it != m_semaphores.end()) {
|
||||
return it->second;
|
||||
|
|
@ -130,7 +130,7 @@ public:
|
|||
return {};
|
||||
}
|
||||
|
||||
std::pair<Ref<IpmiServer>, ErrorCode> createIpmiServer(utils::kstring name) {
|
||||
std::pair<rx::Ref<IpmiServer>, ErrorCode> createIpmiServer(utils::kstring name) {
|
||||
std::lock_guard lock(m_sem_mtx);
|
||||
auto [it, inserted] = mIpmiServers.try_emplace(std::move(name), nullptr);
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ public:
|
|||
return {it->second, {}};
|
||||
}
|
||||
|
||||
Ref<IpmiServer> findIpmiServer(std::string_view name) {
|
||||
rx::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;
|
||||
|
|
@ -191,20 +191,20 @@ public:
|
|||
return getUmtxChainIndexed(1, t, flags, ptr);
|
||||
}
|
||||
|
||||
Ref<EventEmitter> deviceEventEmitter;
|
||||
Ref<RcBase> shmDevice;
|
||||
Ref<RcBase> dmemDevice;
|
||||
Ref<RcBase> blockpoolDevice;
|
||||
Ref<RcBase> gpuDevice;
|
||||
Ref<RcBase> dceDevice;
|
||||
rx::Ref<EventEmitter> deviceEventEmitter;
|
||||
rx::Ref<rx::RcBase> shmDevice;
|
||||
rx::Ref<rx::RcBase> dmemDevice;
|
||||
rx::Ref<rx::RcBase> blockpoolDevice;
|
||||
rx::Ref<rx::RcBase> gpuDevice;
|
||||
rx::Ref<rx::RcBase> dceDevice;
|
||||
rx::shared_mutex gpuDeviceMtx;
|
||||
uint sdkVersion{};
|
||||
uint fwSdkVersion{};
|
||||
uint safeMode{};
|
||||
utils::RcIdMap<RcBase, sint, 4097, 1> ipmiMap;
|
||||
RcIdMap<RcAppInfo> appInfos;
|
||||
RcIdMap<Budget, sint, 4097, 1> budgets;
|
||||
Ref<Budget> processTypeBudgets[4];
|
||||
rx::RcIdMap<rx::RcBase, sint, 4097, 1> ipmiMap;
|
||||
rx::RcIdMap<RcAppInfo> appInfos;
|
||||
rx::RcIdMap<Budget, sint, 4097, 1> budgets;
|
||||
rx::Ref<Budget> processTypeBudgets[4];
|
||||
|
||||
rx::shared_mutex regMgrMtx;
|
||||
kmap<std::uint32_t, std::uint32_t> regMgrInt;
|
||||
|
|
@ -213,7 +213,7 @@ public:
|
|||
FwType fwType = FwType::Unknown;
|
||||
bool isDevKit = false;
|
||||
|
||||
Ref<Budget> createProcessTypeBudget(Budget::ProcessType processType,
|
||||
rx::Ref<Budget> createProcessTypeBudget(Budget::ProcessType processType,
|
||||
std::string_view name,
|
||||
std::span<const BudgetInfo> items) {
|
||||
auto budget = orbis::knew<orbis::Budget>(name, processType, items);
|
||||
|
|
@ -222,7 +222,7 @@ public:
|
|||
return budget;
|
||||
}
|
||||
|
||||
Ref<Budget> getProcessTypeBudget(Budget::ProcessType processType) {
|
||||
rx::Ref<Budget> getProcessTypeBudget(Budget::ProcessType processType) {
|
||||
return processTypeBudgets[static_cast<int>(processType)];
|
||||
}
|
||||
|
||||
|
|
@ -239,18 +239,18 @@ private:
|
|||
std::atomic<long> m_tsc_freq{0};
|
||||
|
||||
rx::shared_mutex m_thread_id_mtx;
|
||||
OwningIdMap<char, long, 256, 0> m_thread_id_map;
|
||||
rx::OwningIdMap<char, long, 256, 0> m_thread_id_map;
|
||||
mutable rx::shared_mutex m_proc_mtx;
|
||||
utils::LinkedNode<Process> *m_processes = nullptr;
|
||||
rx::LinkedNode<Process> *m_processes = nullptr;
|
||||
|
||||
rx::shared_mutex m_evf_mtx;
|
||||
utils::kmap<utils::kstring, Ref<EventFlag>> m_event_flags;
|
||||
utils::kmap<utils::kstring, rx::Ref<EventFlag>> m_event_flags;
|
||||
|
||||
rx::shared_mutex m_sem_mtx;
|
||||
utils::kmap<utils::kstring, Ref<Semaphore>> m_semaphores;
|
||||
utils::kmap<utils::kstring, rx::Ref<Semaphore>> m_semaphores;
|
||||
|
||||
rx::shared_mutex mIpmiServerMtx;
|
||||
utils::kmap<utils::kstring, Ref<IpmiServer>> mIpmiServers;
|
||||
utils::kmap<utils::kstring, rx::Ref<IpmiServer>> mIpmiServers;
|
||||
|
||||
rx::shared_mutex m_kenv_mtx;
|
||||
utils::kmap<utils::kstring, char[128]> m_kenv; // max size: 127 + '\0'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include "KernelAllocator.hpp"
|
||||
#include "thread/Thread.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "thread/Thread.hpp"
|
||||
#include <atomic>
|
||||
|
||||
namespace orbis {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "note.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "stat.hpp"
|
||||
#include "utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
namespace orbis {
|
||||
|
|
@ -73,11 +73,11 @@ struct FileOps {
|
|||
Thread *thread) = nullptr;
|
||||
};
|
||||
|
||||
struct File : RcBase {
|
||||
struct File : rx::RcBase {
|
||||
rx::shared_mutex mtx;
|
||||
Ref<EventEmitter> event;
|
||||
rx::Ref<EventEmitter> event;
|
||||
const FileOps *ops = nullptr;
|
||||
Ref<RcBase> device;
|
||||
rx::Ref<RcBase> device;
|
||||
std::uint64_t nextOff = 0;
|
||||
int flags = 0;
|
||||
int mode = 0;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "orbis-config.hpp"
|
||||
#include "rx/SharedCV.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <list>
|
||||
#include <optional>
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ struct IpmiSession;
|
|||
struct IpmiClient;
|
||||
struct Thread;
|
||||
|
||||
struct IpmiServer : RcBase {
|
||||
struct IpmiServer : rx::RcBase {
|
||||
struct IpmiPacketInfo {
|
||||
ulong inputSize;
|
||||
uint type;
|
||||
|
|
@ -27,12 +27,12 @@ struct IpmiServer : RcBase {
|
|||
struct Packet {
|
||||
IpmiPacketInfo info;
|
||||
lwpid_t clientTid;
|
||||
Ref<IpmiSession> session;
|
||||
rx::Ref<IpmiSession> session;
|
||||
kvector<std::byte> message;
|
||||
};
|
||||
|
||||
struct ConnectionRequest {
|
||||
Ref<IpmiClient> client;
|
||||
rx::Ref<IpmiClient> client;
|
||||
slong clientTid{};
|
||||
slong clientPid{};
|
||||
slong serverTid{};
|
||||
|
|
@ -53,7 +53,7 @@ struct IpmiServer : RcBase {
|
|||
explicit IpmiServer(kstring name) : name(std::move(name)) {}
|
||||
};
|
||||
|
||||
struct IpmiClient : RcBase {
|
||||
struct IpmiClient : rx::RcBase {
|
||||
struct MessageQueue {
|
||||
rx::shared_cv messageCv;
|
||||
kdeque<kvector<std::byte>> messages;
|
||||
|
|
@ -68,7 +68,7 @@ struct IpmiClient : RcBase {
|
|||
kstring name;
|
||||
ptr<void> clientImpl;
|
||||
ptr<void> userData;
|
||||
Ref<IpmiSession> session;
|
||||
rx::Ref<IpmiSession> session;
|
||||
rx::shared_mutex mutex;
|
||||
rx::shared_cv sessionCv;
|
||||
rx::shared_cv asyncResponseCv;
|
||||
|
|
@ -82,7 +82,7 @@ struct IpmiClient : RcBase {
|
|||
explicit IpmiClient(kstring name) : name(std::move(name)) {}
|
||||
};
|
||||
|
||||
struct IpmiSession : RcBase {
|
||||
struct IpmiSession : rx::RcBase {
|
||||
struct SyncResponse {
|
||||
sint errorCode;
|
||||
std::uint32_t callerTid;
|
||||
|
|
@ -91,8 +91,8 @@ struct IpmiSession : RcBase {
|
|||
|
||||
ptr<void> sessionImpl;
|
||||
ptr<void> userData;
|
||||
Ref<IpmiClient> client;
|
||||
Ref<IpmiServer> server;
|
||||
rx::Ref<IpmiClient> client;
|
||||
rx::Ref<IpmiServer> server;
|
||||
rx::shared_mutex mutex;
|
||||
rx::shared_cv responseCv;
|
||||
kdeque<SyncResponse> syncResponses;
|
||||
|
|
@ -185,12 +185,12 @@ static_assert(sizeof(IpmiClientConnectParams) == 0x20);
|
|||
|
||||
ErrorCode ipmiCreateClient(Process *proc, void *clientImpl, const char *name,
|
||||
const IpmiCreateClientConfig &config,
|
||||
Ref<IpmiClient> &result);
|
||||
rx::Ref<IpmiClient> &result);
|
||||
ErrorCode ipmiCreateServer(Process *proc, void *serverImpl, const char *name,
|
||||
const IpmiCreateServerConfig &config,
|
||||
Ref<IpmiServer> &result);
|
||||
rx::Ref<IpmiServer> &result);
|
||||
ErrorCode ipmiCreateSession(Thread *thread, void *sessionImpl,
|
||||
ptr<void> userData, Ref<IpmiSession> &result);
|
||||
ptr<void> userData, rx::Ref<IpmiSession> &result);
|
||||
|
||||
SysResult sysIpmiCreateClient(Thread *thread, ptr<uint> result,
|
||||
ptr<void> params, uint64_t paramsSz);
|
||||
|
|
|
|||
|
|
@ -4,12 +4,10 @@
|
|||
#include "ModuleSegment.hpp"
|
||||
|
||||
#include "../KernelAllocator.hpp"
|
||||
#include "../utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
|
||||
#include "orbis-config.hpp"
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace orbis {
|
||||
struct Thread;
|
||||
|
|
@ -118,16 +116,13 @@ struct Module final {
|
|||
utils::kvector<Relocation> nonPltRelocations;
|
||||
utils::kvector<ModuleNeeded> neededModules;
|
||||
utils::kvector<ModuleNeeded> neededLibraries;
|
||||
utils::kvector<utils::Ref<Module>> importedModules;
|
||||
utils::kvector<utils::Ref<Module>> namespaceModules;
|
||||
utils::kvector<rx::Ref<Module>> importedModules;
|
||||
utils::kvector<rx::Ref<Module>> namespaceModules;
|
||||
utils::kvector<utils::kstring> needed;
|
||||
|
||||
std::atomic<unsigned> references{0};
|
||||
unsigned _total_size = 0;
|
||||
|
||||
void incRef() {
|
||||
if (_total_size != sizeof(Module))
|
||||
std::abort();
|
||||
if (references.fetch_add(1, std::memory_order::relaxed) > 512) {
|
||||
assert(!"too many references");
|
||||
}
|
||||
|
|
@ -142,10 +137,11 @@ struct Module final {
|
|||
|
||||
orbis::SysResult relocate(Process *process);
|
||||
|
||||
void operator delete(void *pointer);
|
||||
|
||||
private:
|
||||
void destroy();
|
||||
};
|
||||
|
||||
utils::Ref<Module> createModule(Thread *p, std::string vfsPath,
|
||||
const char *name);
|
||||
rx::Ref<Module> createModule(Thread *p, std::string vfsPath, const char *name);
|
||||
} // namespace orbis
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "KernelAllocator.hpp"
|
||||
#include "orbis-config.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include <limits>
|
||||
#include <set>
|
||||
|
|
@ -77,17 +77,17 @@ struct KQueue;
|
|||
struct KNote {
|
||||
rx::shared_mutex mutex;
|
||||
KQueue *queue;
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
KEvent event{};
|
||||
bool enabled = true;
|
||||
bool triggered = false;
|
||||
void *linked = nullptr; // TODO: use Ref<>
|
||||
kvector<Ref<EventEmitter>> emitters;
|
||||
void *linked = nullptr; // TODO: use rx::Ref<>
|
||||
kvector<rx::Ref<EventEmitter>> emitters;
|
||||
|
||||
~KNote();
|
||||
};
|
||||
|
||||
struct EventEmitter : orbis::RcBase {
|
||||
struct EventEmitter : rx::RcBase {
|
||||
rx::shared_mutex mutex;
|
||||
std::set<KNote *, std::less<>, kallocator<KNote *>> notes;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@
|
|||
#include "file.hpp"
|
||||
#include "rx/SharedCV.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <utility>
|
||||
|
||||
namespace orbis {
|
||||
struct Pipe final : File {
|
||||
struct Pipe : File {
|
||||
rx::shared_cv cv;
|
||||
kvector<std::byte> data;
|
||||
Ref<Pipe> other;
|
||||
rx::Ref<Pipe> other;
|
||||
};
|
||||
|
||||
std::pair<Ref<Pipe>, Ref<Pipe>> createPipe();
|
||||
std::pair<rx::Ref<Pipe>, rx::Ref<Pipe>> createPipe();
|
||||
} // namespace orbis
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "orbis/Budget.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/module/Module.hpp"
|
||||
#include "orbis/utils/IdMap.hpp"
|
||||
#include "rx/IdMap.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include <optional>
|
||||
|
||||
|
|
@ -85,16 +85,16 @@ struct Process final {
|
|||
std::uint64_t nextTlsSlot = 1;
|
||||
std::uint64_t lastTlsOffset = 0;
|
||||
|
||||
utils::RcIdMap<EventFlag, sint, 4097, 1> evfMap;
|
||||
utils::RcIdMap<Semaphore, sint, 4097, 1> semMap;
|
||||
utils::RcIdMap<Module, ModuleHandle> modulesMap;
|
||||
utils::OwningIdMap<Thread, lwpid_t> threadsMap;
|
||||
utils::RcIdMap<orbis::File, sint> fileDescriptors;
|
||||
rx::RcIdMap<EventFlag, sint, 4097, 1> evfMap;
|
||||
rx::RcIdMap<Semaphore, sint, 4097, 1> semMap;
|
||||
rx::RcIdMap<Module, ModuleHandle> modulesMap;
|
||||
rx::OwningIdMap<Thread, lwpid_t> threadsMap;
|
||||
rx::RcIdMap<orbis::File, sint> fileDescriptors;
|
||||
|
||||
// Named objects for debugging
|
||||
rx::shared_mutex namedObjMutex;
|
||||
utils::kmap<void *, utils::kstring> namedObjNames;
|
||||
utils::OwningIdMap<NamedObjInfo, uint, 65535, 1> namedObjIds;
|
||||
rx::OwningIdMap<NamedObjInfo, uint, 65535, 1> namedObjIds;
|
||||
|
||||
utils::kmap<std::int32_t, SigAction> sigActions;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "../module/ModuleHandle.hpp"
|
||||
#include "../thread/types.hpp"
|
||||
#include "orbis-config.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
|
||||
namespace orbis {
|
||||
struct Thread;
|
||||
|
|
@ -39,21 +39,21 @@ struct ProcessOps {
|
|||
ptr<MemoryProtection> protection);
|
||||
|
||||
SysResult (*open)(Thread *thread, ptr<const char> path, sint flags, sint mode,
|
||||
Ref<File> *file);
|
||||
rx::Ref<File> *file);
|
||||
SysResult (*shm_open)(Thread *thread, const char *path, sint flags, sint mode,
|
||||
Ref<File> *file);
|
||||
rx::Ref<File> *file);
|
||||
SysResult (*unlink)(Thread *thread, ptr<const char> path);
|
||||
SysResult (*mkdir)(Thread *thread, ptr<const char> path, sint mode);
|
||||
SysResult (*rmdir)(Thread *thread, ptr<const char> path);
|
||||
SysResult (*rename)(Thread *thread, ptr<const char> from, ptr<const char> to);
|
||||
SysResult (*blockpool_open)(Thread *thread, Ref<File> *file);
|
||||
SysResult (*blockpool_open)(Thread *thread, rx::Ref<File> *file);
|
||||
SysResult (*blockpool_map)(Thread *thread, caddr_t addr, size_t len,
|
||||
sint prot, sint flags);
|
||||
SysResult (*blockpool_unmap)(Thread *thread, caddr_t addr, size_t len);
|
||||
SysResult (*socket)(Thread *thread, ptr<const char> name, sint domain,
|
||||
sint type, sint protocol, Ref<File> *file);
|
||||
sint type, sint protocol, rx::Ref<File> *file);
|
||||
SysResult (*socketpair)(Thread *thread, sint domain, sint type, sint protocol,
|
||||
Ref<File> *a, Ref<File> *b);
|
||||
rx::Ref<File> *a, rx::Ref<File> *b);
|
||||
SysResult (*shm_unlink)(Thread *thread, const char *path);
|
||||
SysResult (*dynlib_get_obj_member)(Thread *thread, ModuleHandle handle,
|
||||
uint64_t index, ptr<ptr<void>> addrp);
|
||||
|
|
|
|||
|
|
@ -1,74 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <utility>
|
||||
|
||||
namespace orbis {
|
||||
inline namespace utils {
|
||||
// Atomic operation; returns old value, or pair of old value and return value
|
||||
// (cancel op if evaluates to false)
|
||||
template <typename T, typename F, typename RT = std::invoke_result_t<F, T &>>
|
||||
inline std::conditional_t<std::is_void_v<RT>, T, std::pair<T, RT>>
|
||||
atomic_fetch_op(std::atomic<T> &v, F func) {
|
||||
T _new, old = v.load();
|
||||
while (true) {
|
||||
_new = old;
|
||||
if constexpr (std::is_void_v<RT>) {
|
||||
std::invoke(func, _new);
|
||||
if (v.compare_exchange_strong(old, _new)) [[likely]] {
|
||||
return old;
|
||||
}
|
||||
} else {
|
||||
RT ret = std::invoke(func, _new);
|
||||
if (!ret || v.compare_exchange_strong(old, _new)) [[likely]] {
|
||||
return {old, std::move(ret)};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Atomic operation; returns function result value, function is the lambda
|
||||
template <typename T, typename F, typename RT = std::invoke_result_t<F, T &>>
|
||||
inline RT atomic_op(std::atomic<T> &v, F func) {
|
||||
T _new, old = v.load();
|
||||
while (true) {
|
||||
_new = old;
|
||||
if constexpr (std::is_void_v<RT>) {
|
||||
std::invoke(func, _new);
|
||||
if (v.compare_exchange_strong(old, _new)) [[likely]] {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
RT result = std::invoke(func, _new);
|
||||
if (v.compare_exchange_strong(old, _new)) [[likely]] {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__ATOMIC_HLE_ACQUIRE) && defined(__ATOMIC_HLE_RELEASE)
|
||||
static constexpr int s_hle_ack = __ATOMIC_SEQ_CST | __ATOMIC_HLE_ACQUIRE;
|
||||
static constexpr int s_hle_rel = __ATOMIC_SEQ_CST | __ATOMIC_HLE_RELEASE;
|
||||
#else
|
||||
static constexpr int s_hle_ack = __ATOMIC_SEQ_CST;
|
||||
static constexpr int s_hle_rel = __ATOMIC_SEQ_CST;
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
inline bool compare_exchange_hle_acq(std::atomic<T> &dest, T &comp, T exch) {
|
||||
static_assert(sizeof(T) == 4 || sizeof(T) == 8);
|
||||
static_assert(std::atomic<T>::is_always_lock_free);
|
||||
return __atomic_compare_exchange(reinterpret_cast<T *>(&dest), &comp, &exch,
|
||||
false, s_hle_ack, s_hle_ack);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T fetch_add_hle_rel(std::atomic<T> &dest, T value) {
|
||||
static_assert(sizeof(T) == 4 || sizeof(T) == 8);
|
||||
static_assert(std::atomic<T>::is_always_lock_free);
|
||||
return __atomic_fetch_add(reinterpret_cast<T *>(&dest), value, s_hle_rel);
|
||||
}
|
||||
} // namespace utils
|
||||
} // namespace orbis
|
||||
|
|
@ -51,7 +51,7 @@ KernelContext::KernelContext() {
|
|||
KernelContext::~KernelContext() {}
|
||||
|
||||
Process *KernelContext::createProcess(pid_t pid) {
|
||||
auto newProcess = knew<utils::LinkedNode<Process>>();
|
||||
auto newProcess = knew<rx::LinkedNode<Process>>();
|
||||
newProcess->object.context = this;
|
||||
newProcess->object.pid = pid;
|
||||
newProcess->object.state = ProcessState::NEW;
|
||||
|
|
@ -69,7 +69,7 @@ Process *KernelContext::createProcess(pid_t pid) {
|
|||
}
|
||||
|
||||
void KernelContext::deleteProcess(Process *proc) {
|
||||
auto procNode = reinterpret_cast<utils::LinkedNode<Process> *>(proc);
|
||||
auto procNode = reinterpret_cast<rx::LinkedNode<Process> *>(proc);
|
||||
|
||||
{
|
||||
std::lock_guard lock(m_proc_mtx);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
orbis::ErrorCode orbis::ipmiCreateClient(Process *proc, void *clientImpl,
|
||||
const char *name,
|
||||
const IpmiCreateClientConfig &config,
|
||||
Ref<IpmiClient> &result) {
|
||||
rx::Ref<IpmiClient> &result) {
|
||||
auto client = knew<IpmiClient>(name);
|
||||
if (client == nullptr) {
|
||||
return ErrorCode::NOMEM;
|
||||
|
|
@ -29,7 +29,7 @@ orbis::ErrorCode orbis::ipmiCreateClient(Process *proc, void *clientImpl,
|
|||
orbis::ErrorCode orbis::ipmiCreateServer(Process *proc, void *serverImpl,
|
||||
const char *name,
|
||||
const IpmiCreateServerConfig &config,
|
||||
Ref<IpmiServer> &result) {
|
||||
rx::Ref<IpmiServer> &result) {
|
||||
auto [server, errorCode] = g_context.createIpmiServer(name);
|
||||
ORBIS_RET_ON_ERROR(errorCode);
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ orbis::ErrorCode orbis::ipmiCreateServer(Process *proc, void *serverImpl,
|
|||
|
||||
orbis::ErrorCode orbis::ipmiCreateSession(Thread *thread, void *sessionImpl,
|
||||
ptr<void> userData,
|
||||
Ref<IpmiSession> &result) {
|
||||
rx::Ref<IpmiSession> &result) {
|
||||
std::unique_lock ipmiMapLock(g_context.ipmiMap.mutex);
|
||||
|
||||
for (auto [kid, obj] : g_context.ipmiMap) {
|
||||
|
|
@ -96,7 +96,7 @@ orbis::SysResult orbis::sysIpmiCreateClient(Thread *thread, ptr<uint> result,
|
|||
IpmiCreateClientParams _params;
|
||||
IpmiCreateClientConfig _config;
|
||||
char _name[25];
|
||||
Ref<IpmiClient> client;
|
||||
rx::Ref<IpmiClient> client;
|
||||
|
||||
ORBIS_RET_ON_ERROR(uread(_params, ptr<IpmiCreateClientParams>(params)));
|
||||
ORBIS_RET_ON_ERROR(uread(_config, _params.config));
|
||||
|
|
@ -132,7 +132,7 @@ orbis::SysResult orbis::sysIpmiCreateServer(Thread *thread, ptr<uint> result,
|
|||
IpmiCreateServerParams _params;
|
||||
IpmiCreateServerConfig _config;
|
||||
char _name[25];
|
||||
Ref<IpmiServer> server;
|
||||
rx::Ref<IpmiServer> server;
|
||||
|
||||
ORBIS_RET_ON_ERROR(uread(_params, ptr<IpmiCreateServerParams>(params)));
|
||||
ORBIS_RET_ON_ERROR(uread(_config, _params.config));
|
||||
|
|
@ -172,7 +172,7 @@ orbis::SysResult orbis::sysIpmiCreateSession(Thread *thread, ptr<uint> result,
|
|||
|
||||
IpmiCreateSessionParams _params;
|
||||
IpmiSessionUserData _userData;
|
||||
Ref<IpmiSession> session;
|
||||
rx::Ref<IpmiSession> session;
|
||||
|
||||
ORBIS_RET_ON_ERROR(uread(_params, ptr<IpmiCreateSessionParams>(params)));
|
||||
ORBIS_RET_ON_ERROR(uread(_userData, _params.userData));
|
||||
|
|
@ -306,7 +306,7 @@ orbis::SysResult orbis::sysIpmiSendConnectResult(Thread *thread,
|
|||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
Ref<IpmiClient> client;
|
||||
rx::Ref<IpmiClient> client;
|
||||
if (auto result = ipmiObject.cast<IpmiSession>()) {
|
||||
client = result->client;
|
||||
} else if (auto result = ipmiObject.cast<IpmiClient>()) {
|
||||
|
|
|
|||
|
|
@ -409,6 +409,10 @@ orbis::SysResult orbis::Module::relocate(Process *process) {
|
|||
return {};
|
||||
}
|
||||
|
||||
void orbis::Module::operator delete(void *pointer) {
|
||||
kfree(pointer, sizeof(orbis::Module));
|
||||
}
|
||||
|
||||
void orbis::Module::destroy() {
|
||||
std::lock_guard lock(proc->mtx);
|
||||
proc->modulesMap.close(id);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ static orbis::FileOps pipe_ops = {
|
|||
.write = pipe_write,
|
||||
};
|
||||
|
||||
std::pair<orbis::Ref<orbis::Pipe>, orbis::Ref<orbis::Pipe>>
|
||||
std::pair<rx::Ref<orbis::Pipe>, rx::Ref<orbis::Pipe>>
|
||||
orbis::createPipe() {
|
||||
auto a = knew<Pipe>();
|
||||
auto b = knew<Pipe>();
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ orbis::SysResult orbis::sys_closefrom(Thread *thread, sint lowfd) {
|
|||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_fstat(Thread *thread, sint fd, ptr<Stat> ub) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
orbis::SysResult orbis::sys_read(Thread *thread, sint fd, ptr<void> buf,
|
||||
size_t nbyte) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ orbis::SysResult orbis::sys_read(Thread *thread, sint fd, ptr<void> buf,
|
|||
orbis::SysResult orbis::sys_pread(Thread *thread, sint fd, ptr<void> buf,
|
||||
size_t nbyte, off_t offset) {
|
||||
// ORBIS_LOG_ERROR(__FUNCTION__, fd, buf, nbyte, offset);
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@ orbis::SysResult orbis::sys_freebsd6_pread(Thread *thread, sint fd,
|
|||
}
|
||||
orbis::SysResult orbis::sys_readv(Thread *thread, sint fd, ptr<IoVec> iovp,
|
||||
uint iovcnt) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -119,7 +119,7 @@ orbis::SysResult orbis::sys_readv(Thread *thread, sint fd, ptr<IoVec> iovp,
|
|||
}
|
||||
orbis::SysResult orbis::sys_preadv(Thread *thread, sint fd, ptr<IoVec> iovp,
|
||||
uint iovcnt, off_t offset) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ orbis::SysResult orbis::sys_preadv(Thread *thread, sint fd, ptr<IoVec> iovp,
|
|||
}
|
||||
orbis::SysResult orbis::sys_write(Thread *thread, sint fd, ptr<const void> buf,
|
||||
size_t nbyte) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -185,7 +185,7 @@ orbis::SysResult orbis::sys_write(Thread *thread, sint fd, ptr<const void> buf,
|
|||
}
|
||||
orbis::SysResult orbis::sys_pwrite(Thread *thread, sint fd, ptr<const void> buf,
|
||||
size_t nbyte, off_t offset) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -222,7 +222,7 @@ orbis::SysResult orbis::sys_freebsd6_pwrite(Thread *thread, sint fd,
|
|||
}
|
||||
orbis::SysResult orbis::sys_writev(Thread *thread, sint fd, ptr<IoVec> iovp,
|
||||
uint iovcnt) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -256,7 +256,7 @@ orbis::SysResult orbis::sys_writev(Thread *thread, sint fd, ptr<IoVec> iovp,
|
|||
}
|
||||
orbis::SysResult orbis::sys_pwritev(Thread *thread, sint fd, ptr<IoVec> iovp,
|
||||
uint iovcnt, off_t offset) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -285,7 +285,7 @@ orbis::SysResult orbis::sys_pwritev(Thread *thread, sint fd, ptr<IoVec> iovp,
|
|||
return {};
|
||||
}
|
||||
orbis::SysResult orbis::sys_ftruncate(Thread *thread, sint fd, off_t length) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -426,7 +426,7 @@ orbis::SysResult orbis::sys_ioctl(Thread *thread, sint fd, ulong com,
|
|||
caddr_t data) {
|
||||
auto str = ioctlToString(com);
|
||||
// ORBIS_LOG_WARNING(__FUNCTION__, fd, com, str);
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ orbis::SysResult orbis::sys_socketex(Thread *thread, ptr<const char> name,
|
|||
sint domain, sint type, sint protocol) {
|
||||
ORBIS_LOG_TODO(__FUNCTION__, name, domain, type, protocol);
|
||||
if (auto socket = thread->tproc->ops->socket) {
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
auto result = socket(thread, name, domain, type, protocol, &file);
|
||||
|
||||
if (result.isError()) {
|
||||
|
|
@ -250,7 +250,7 @@ orbis::SysResult orbis::sys_evf_create(Thread *thread, ptr<const char[32]> name,
|
|||
}
|
||||
orbis::SysResult orbis::sys_evf_delete(Thread *thread, sint id) {
|
||||
ORBIS_LOG_WARNING(__FUNCTION__, id);
|
||||
Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
rx::Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
if (evf == nullptr) {
|
||||
return ErrorCode::NOENT;
|
||||
}
|
||||
|
|
@ -298,7 +298,7 @@ orbis::SysResult orbis::sys_evf_wait(Thread *thread, sint id,
|
|||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
rx::Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
|
||||
if (evf == nullptr) {
|
||||
return ErrorCode::SRCH;
|
||||
|
|
@ -336,7 +336,7 @@ orbis::SysResult orbis::sys_evf_trywait(Thread *thread, sint id,
|
|||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
rx::Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
|
||||
if (evf == nullptr) {
|
||||
return ErrorCode::SRCH;
|
||||
|
|
@ -356,7 +356,7 @@ orbis::SysResult orbis::sys_evf_trywait(Thread *thread, sint id,
|
|||
return result;
|
||||
}
|
||||
orbis::SysResult orbis::sys_evf_set(Thread *thread, sint id, uint64_t value) {
|
||||
Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
rx::Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
|
||||
if (evf == nullptr) {
|
||||
return ErrorCode::SRCH;
|
||||
|
|
@ -367,7 +367,7 @@ orbis::SysResult orbis::sys_evf_set(Thread *thread, sint id, uint64_t value) {
|
|||
return {};
|
||||
}
|
||||
orbis::SysResult orbis::sys_evf_clear(Thread *thread, sint id, uint64_t value) {
|
||||
Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
rx::Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
|
||||
if (evf == nullptr) {
|
||||
return ErrorCode::SRCH;
|
||||
|
|
@ -379,7 +379,7 @@ orbis::SysResult orbis::sys_evf_clear(Thread *thread, sint id, uint64_t value) {
|
|||
}
|
||||
orbis::SysResult orbis::sys_evf_cancel(Thread *thread, sint id, uint64_t value,
|
||||
ptr<sint> pNumWaitThreads) {
|
||||
Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
rx::Ref<EventFlag> evf = thread->tproc->evfMap.get(id);
|
||||
|
||||
if (evf == nullptr) {
|
||||
return ErrorCode::SRCH;
|
||||
|
|
@ -522,7 +522,7 @@ orbis::SysResult orbis::sys_osem_create(Thread *thread,
|
|||
}
|
||||
orbis::SysResult orbis::sys_osem_delete(Thread *thread, sint id) {
|
||||
ORBIS_LOG_TRACE(__FUNCTION__, id);
|
||||
Ref<Semaphore> sem = thread->tproc->semMap.get(id);
|
||||
rx::Ref<Semaphore> sem = thread->tproc->semMap.get(id);
|
||||
if (sem == nullptr) {
|
||||
return ErrorCode::NOENT;
|
||||
}
|
||||
|
|
@ -558,7 +558,7 @@ orbis::SysResult orbis::sys_osem_close(Thread *thread, sint id) {
|
|||
orbis::SysResult orbis::sys_osem_wait(Thread *thread, sint id, sint need,
|
||||
ptr<uint> pTimeout) {
|
||||
ORBIS_LOG_TRACE(__FUNCTION__, thread, id, need, pTimeout);
|
||||
Ref<Semaphore> sem = thread->tproc->semMap.get(id);
|
||||
rx::Ref<Semaphore> sem = thread->tproc->semMap.get(id);
|
||||
if (sem == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -624,7 +624,7 @@ orbis::SysResult orbis::sys_osem_wait(Thread *thread, sint id, sint need,
|
|||
}
|
||||
orbis::SysResult orbis::sys_osem_trywait(Thread *thread, sint id, sint need) {
|
||||
ORBIS_LOG_TRACE(__FUNCTION__, thread, id, need);
|
||||
Ref<Semaphore> sem = thread->tproc->semMap.get(id);
|
||||
rx::Ref<Semaphore> sem = thread->tproc->semMap.get(id);
|
||||
if (sem == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -641,7 +641,7 @@ orbis::SysResult orbis::sys_osem_trywait(Thread *thread, sint id, sint need) {
|
|||
}
|
||||
orbis::SysResult orbis::sys_osem_post(Thread *thread, sint id, sint count) {
|
||||
ORBIS_LOG_TRACE(__FUNCTION__, thread, id, count);
|
||||
Ref<Semaphore> sem = thread->tproc->semMap.get(id);
|
||||
rx::Ref<Semaphore> sem = thread->tproc->semMap.get(id);
|
||||
if (sem == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -802,7 +802,7 @@ orbis::SysResult orbis::sys_budget_create(Thread *thread, ptr<char> name,
|
|||
return ErrorCode::PERM;
|
||||
}
|
||||
|
||||
orbis::Ref budget =
|
||||
rx::Ref budget =
|
||||
orbis::knew<Budget>(_name, processType, std::span(_resources, count));
|
||||
auto id = g_context.budgets.insert(budget);
|
||||
thread->retval[0] = id;
|
||||
|
|
@ -835,7 +835,7 @@ orbis::SysResult orbis::sys_budget_get(Thread *thread, sint id,
|
|||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
Ref<Budget> budget;
|
||||
rx::Ref<Budget> budget;
|
||||
bool isProcessTypeBudget = id < 0;
|
||||
if (isProcessTypeBudget) {
|
||||
id = -2 - id;
|
||||
|
|
@ -1134,7 +1134,7 @@ orbis::SysResult orbis::sys_mdbg_service(Thread *thread, uint32_t op,
|
|||
|
||||
case 7: {
|
||||
if (auto open = thread->tproc->ops->open) {
|
||||
Ref<File> console;
|
||||
rx::Ref<File> console;
|
||||
auto result = open(thread, "/dev/console", 0, 0, &console);
|
||||
if (!result.value() && console && console->ops->write) {
|
||||
IoVec vec{.base = (char *)arg0, .len = std::strlen((char *)arg0)};
|
||||
|
|
@ -1680,7 +1680,7 @@ orbis::SysResult orbis::sys_budget_get_ptype_of_budget(Thread *thread,
|
|||
return ErrorCode::NOSYS;
|
||||
}
|
||||
|
||||
orbis::Ref<Budget> budget = g_context.budgets.get(budgetId);
|
||||
rx::Ref<Budget> budget = g_context.budgets.get(budgetId);
|
||||
|
||||
if (!budget) {
|
||||
return ErrorCode::SRCH;
|
||||
|
|
@ -1698,7 +1698,7 @@ orbis::SysResult orbis::sys_process_terminate(Thread *thread /* TODO */) {
|
|||
}
|
||||
orbis::SysResult orbis::sys_blockpool_open(Thread *thread) {
|
||||
if (auto blockpool_open = thread->tproc->ops->blockpool_open) {
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
auto result = blockpool_open(thread, &file);
|
||||
if (result.isError()) {
|
||||
return result;
|
||||
|
|
@ -1874,7 +1874,7 @@ orbis::SysResult orbis::sys_begin_app_mount(Thread *thread,
|
|||
_info.appInfo.unk7, _info.appInfo.unk8, _info.appInfo.unk9,
|
||||
_info.appInfo.unk10);
|
||||
|
||||
orbis::Ref appInfo = orbis::knew<RcAppInfo>();
|
||||
rx::Ref appInfo = orbis::knew<RcAppInfo>();
|
||||
|
||||
AppInfoEx *appInfoData = appInfo.get();
|
||||
auto handle = g_context.appInfos.insert(appInfo);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ orbis::SysResult orbis::sys_socket(Thread *thread, sint domain, sint type,
|
|||
sint protocol) {
|
||||
ORBIS_LOG_TODO(__FUNCTION__, domain, type, protocol);
|
||||
if (auto socket = thread->tproc->ops->socket) {
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
auto result = socket(thread, nullptr, domain, type, protocol, &file);
|
||||
|
||||
if (result.isError()) {
|
||||
|
|
@ -89,8 +89,8 @@ orbis::SysResult orbis::sys_socketpair(Thread *thread, sint domain, sint type,
|
|||
sint protocol, ptr<sint> rsv) {
|
||||
ORBIS_LOG_TODO(__FUNCTION__, domain, type, protocol, rsv);
|
||||
if (auto socketpair = thread->tproc->ops->socketpair) {
|
||||
Ref<File> a;
|
||||
Ref<File> b;
|
||||
rx::Ref<File> a;
|
||||
rx::Ref<File> b;
|
||||
auto result = socketpair(thread, domain, type, protocol, &a, &b);
|
||||
|
||||
if (result.isError()) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ orbis::SysResult orbis::sys_shm_open(Thread *thread, ptr<const char> path,
|
|||
}
|
||||
|
||||
if (auto shm_open = thread->tproc->ops->shm_open) {
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
auto result = shm_open(thread, path, flags, mode, &file);
|
||||
if (result.isError()) {
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ orbis::SysResult orbis::sys_chroot(Thread *thread, ptr<char> path) {
|
|||
orbis::SysResult orbis::sys_open(Thread *thread, ptr<const char> path,
|
||||
sint flags, sint mode) {
|
||||
if (auto open = thread->tproc->ops->open) {
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
auto result = open(thread, path, flags, mode, &file);
|
||||
if (result.isError()) {
|
||||
return result;
|
||||
|
|
@ -114,7 +114,7 @@ orbis::SysResult orbis::sys_openat(Thread *thread, sint fd, ptr<char> path,
|
|||
return sys_open(thread, (cwd + "/" + path).c_str(), flag, mode);
|
||||
}
|
||||
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ orbis::SysResult orbis::sys_unlinkat(Thread *thread, sint fd, ptr<char> path,
|
|||
}
|
||||
orbis::SysResult orbis::sys_lseek(Thread *thread, sint fd, off_t offset,
|
||||
sint whence) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -215,7 +215,7 @@ orbis::SysResult orbis::sys_freebsd6_lseek(Thread *thread, sint fd, sint,
|
|||
}
|
||||
orbis::SysResult orbis::sys_access(Thread *thread, ptr<char> path, sint flags) {
|
||||
if (auto open = thread->tproc->ops->open) {
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
return open(thread, path, flags, 0, &file);
|
||||
}
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ orbis::SysResult orbis::sys_eaccess(Thread *thread, ptr<char> path,
|
|||
}
|
||||
orbis::SysResult orbis::sys_stat(Thread *thread, ptr<char> path, ptr<Stat> ub) {
|
||||
ORBIS_LOG_WARNING(__FUNCTION__, path);
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
auto result = thread->tproc->ops->open(thread, path, 0, 0, &file);
|
||||
if (result.isError()) {
|
||||
return result;
|
||||
|
|
@ -289,7 +289,7 @@ orbis::SysResult orbis::sys_readlink(Thread *thread, ptr<char> path,
|
|||
return ErrorCode::NAMETOOLONG;
|
||||
}
|
||||
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
if (auto error = thread->tproc->ops->open(thread, path, 0, 0, &file);
|
||||
error.value()) {
|
||||
return error;
|
||||
|
|
@ -362,7 +362,7 @@ orbis::SysResult orbis::sys_futimes(Thread *thread, sint fd,
|
|||
}
|
||||
orbis::SysResult orbis::sys_truncate(Thread *thread, ptr<char> path,
|
||||
off_t length) {
|
||||
Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
auto result = thread->tproc->ops->open(thread, path, 2, 0, &file);
|
||||
if (result.isError()) {
|
||||
return result;
|
||||
|
|
@ -400,7 +400,7 @@ orbis::SysResult orbis::sys_mkdir(Thread *thread, ptr<char> path, sint mode) {
|
|||
}
|
||||
orbis::SysResult orbis::sys_mkdirat(Thread *thread, sint fd, ptr<char> path,
|
||||
mode_t mode) {
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
@ -425,7 +425,7 @@ orbis::SysResult orbis::sys_getdirentries(Thread *thread, sint fd,
|
|||
ptr<char> buf, uint count,
|
||||
ptr<slong> basep) {
|
||||
ORBIS_LOG_WARNING(__FUNCTION__, fd, (void *)buf, count, basep);
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
rx::Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ enum class FwType : std::uint8_t {
|
|||
Ps5,
|
||||
};
|
||||
|
||||
struct RcAppInfo : RcBase, AppInfoEx {
|
||||
struct RcAppInfo : rx::RcBase, AppInfoEx {
|
||||
orbis::uint32_t appState = 0;
|
||||
};
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ public:
|
|||
Process *findProcessById(pid_t pid) const;
|
||||
Process *findProcessByHostId(std::uint64_t pid) const;
|
||||
|
||||
utils::LinkedNode<Process> *getProcessList() { return m_processes; }
|
||||
rx::LinkedNode<Process> *getProcessList() { return m_processes; }
|
||||
|
||||
long allocatePid() {
|
||||
std::lock_guard lock(m_thread_id_mtx);
|
||||
|
|
@ -98,7 +98,7 @@ public:
|
|||
return {it->second.get(), inserted};
|
||||
}
|
||||
|
||||
Ref<EventFlag> findEventFlag(std::string_view name) {
|
||||
rx::Ref<EventFlag> findEventFlag(std::string_view name) {
|
||||
std::lock_guard lock(m_evf_mtx);
|
||||
|
||||
if (auto it = m_event_flags.find(name); it != m_event_flags.end()) {
|
||||
|
|
@ -121,7 +121,7 @@ public:
|
|||
return {it->second.get(), inserted};
|
||||
}
|
||||
|
||||
Ref<Semaphore> findSemaphore(std::string_view name) {
|
||||
rx::Ref<Semaphore> findSemaphore(std::string_view name) {
|
||||
std::lock_guard lock(m_sem_mtx);
|
||||
if (auto it = m_semaphores.find(name); it != m_semaphores.end()) {
|
||||
return it->second;
|
||||
|
|
@ -148,7 +148,7 @@ public:
|
|||
return {it->second, {}};
|
||||
}
|
||||
|
||||
Ref<IpmiServer> findIpmiServer(std::string_view name) {
|
||||
rx::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;
|
||||
|
|
@ -191,12 +191,12 @@ public:
|
|||
return getUmtxChainIndexed(1, t, flags, ptr);
|
||||
}
|
||||
|
||||
Ref<EventEmitter> deviceEventEmitter;
|
||||
Ref<RcBase> shmDevice;
|
||||
Ref<RcBase> dmemDevice;
|
||||
Ref<RcBase> blockpoolDevice;
|
||||
Ref<RcBase> gpuDevice;
|
||||
Ref<RcBase> dceDevice;
|
||||
rx::Ref<EventEmitter> deviceEventEmitter;
|
||||
rx::Ref<RcBase> shmDevice;
|
||||
rx::Ref<RcBase> dmemDevice;
|
||||
rx::Ref<RcBase> blockpoolDevice;
|
||||
rx::Ref<RcBase> gpuDevice;
|
||||
rx::Ref<RcBase> dceDevice;
|
||||
rx::shared_mutex gpuDeviceMtx;
|
||||
uint sdkVersion{};
|
||||
uint fwSdkVersion{};
|
||||
|
|
@ -204,7 +204,7 @@ public:
|
|||
utils::RcIdMap<RcBase, sint, 4097, 1> ipmiMap;
|
||||
RcIdMap<RcAppInfo> appInfos;
|
||||
RcIdMap<Budget, sint, 4097, 1> budgets;
|
||||
Ref<Budget> processTypeBudgets[4];
|
||||
rx::Ref<Budget> processTypeBudgets[4];
|
||||
|
||||
rx::shared_mutex regMgrMtx;
|
||||
kmap<std::uint32_t, std::uint32_t> regMgrInt;
|
||||
|
|
@ -213,7 +213,7 @@ public:
|
|||
FwType fwType = FwType::Unknown;
|
||||
bool isDevKit = false;
|
||||
|
||||
Ref<Budget> createProcessTypeBudget(Budget::ProcessType processType,
|
||||
rx::Ref<Budget> createProcessTypeBudget(Budget::ProcessType processType,
|
||||
std::string_view name,
|
||||
std::span<const BudgetInfo> items) {
|
||||
auto budget = orbis::knew<orbis::Budget>(name, processType, items);
|
||||
|
|
@ -222,7 +222,7 @@ public:
|
|||
return budget;
|
||||
}
|
||||
|
||||
Ref<Budget> getProcessTypeBudget(Budget::ProcessType processType) {
|
||||
rx::Ref<Budget> getProcessTypeBudget(Budget::ProcessType processType) {
|
||||
return processTypeBudgets[static_cast<int>(processType)];
|
||||
}
|
||||
|
||||
|
|
@ -244,13 +244,13 @@ private:
|
|||
utils::LinkedNode<Process> *m_processes = nullptr;
|
||||
|
||||
rx::shared_mutex m_evf_mtx;
|
||||
utils::kmap<utils::kstring, Ref<EventFlag>> m_event_flags;
|
||||
utils::kmap<utils::kstring, rx::Ref<EventFlag>> m_event_flags;
|
||||
|
||||
rx::shared_mutex m_sem_mtx;
|
||||
utils::kmap<utils::kstring, Ref<Semaphore>> m_semaphores;
|
||||
utils::kmap<utils::kstring, rx::Ref<Semaphore>> m_semaphores;
|
||||
|
||||
rx::shared_mutex mIpmiServerMtx;
|
||||
utils::kmap<utils::kstring, Ref<IpmiServer>> mIpmiServers;
|
||||
utils::kmap<utils::kstring, rx::Ref<IpmiServer>> mIpmiServers;
|
||||
|
||||
rx::shared_mutex m_kenv_mtx;
|
||||
utils::kmap<utils::kstring, char[128]> m_kenv; // max size: 127 + '\0'
|
||||
|
|
|
|||
1405
orbis-kernel/src/ipmi.cpp
Normal file
1405
orbis-kernel/src/ipmi.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -4,7 +4,7 @@
|
|||
#include <cstdint>
|
||||
#include <mutex>
|
||||
#include <orbis/evf.hpp>
|
||||
#include <orbis/utils/Rc.hpp>
|
||||
#include <rx/Rc.hpp>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ struct AudioOutChannelInfo {
|
|||
std::int32_t port{};
|
||||
std::int32_t idControl{};
|
||||
std::int32_t channel{};
|
||||
orbis::Ref<orbis::EventFlag> evf;
|
||||
rx::Ref<orbis::EventFlag> evf;
|
||||
};
|
||||
|
||||
struct AudioOutParams {
|
||||
|
|
@ -38,7 +38,7 @@ struct AudioOutParams {
|
|||
std::uint32_t sampleLength{};
|
||||
};
|
||||
|
||||
struct AudioOut : orbis::RcBase {
|
||||
struct AudioOut : rx::RcBase {
|
||||
std::mutex thrMtx;
|
||||
std::mutex soxMtx;
|
||||
std::vector<std::thread> threads;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "orbis-config.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <cstdlib>
|
||||
#include <orbis/sys/sysproto.hpp>
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ enum class AudioFormat : std::uint32_t {
|
|||
S32_LE = 0x1000,
|
||||
};
|
||||
|
||||
class AudioDevice : public orbis::RcBase {
|
||||
class AudioDevice : public rx::RcBase {
|
||||
protected:
|
||||
bool mWorking = false;
|
||||
AudioFormat mFormat{};
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
#include "Pipe.hpp"
|
||||
#include "amdgpu/tiler_vulkan.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include "rx/MemoryTable.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "shader/SemanticInfo.hpp"
|
||||
#include "shader/SpvConverter.hpp"
|
||||
#include "shader/gcn.hpp"
|
||||
|
|
@ -63,7 +63,7 @@ struct RemoteMemory {
|
|||
}
|
||||
};
|
||||
|
||||
struct Device : orbis::RcBase, DeviceContext {
|
||||
struct Device : rx::RcBase, DeviceContext {
|
||||
static constexpr auto kComputePipeCount = 8;
|
||||
static constexpr auto kGfxPipeCount = 2;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
using namespace amdgpu;
|
||||
|
||||
DeviceCtl::DeviceCtl() noexcept = default;
|
||||
DeviceCtl::DeviceCtl(orbis::Ref<orbis::RcBase> device) noexcept
|
||||
DeviceCtl::DeviceCtl(rx::Ref<rx::RcBase> device) noexcept
|
||||
: mDevice(device.rawStaticCast<Device>()) {}
|
||||
DeviceCtl::DeviceCtl(DeviceCtl &&) noexcept = default;
|
||||
DeviceCtl::DeviceCtl(const DeviceCtl &) = default;
|
||||
|
|
@ -28,7 +28,7 @@ DeviceCtl DeviceCtl::createDevice() {
|
|||
}
|
||||
|
||||
DeviceContext &DeviceCtl::getContext() { return *mDevice.get(); }
|
||||
orbis::Ref<orbis::RcBase> DeviceCtl::getOpaque() { return mDevice; }
|
||||
rx::Ref<rx::RcBase> DeviceCtl::getOpaque() { return mDevice; }
|
||||
|
||||
void DeviceCtl::submitGfxCommand(int gfxPipe, int vmId,
|
||||
std::span<const std::uint32_t> command) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "DeviceContext.hpp"
|
||||
#include "orbis-config.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
|
||||
|
|
@ -10,11 +10,11 @@ namespace amdgpu {
|
|||
class Device;
|
||||
|
||||
class DeviceCtl {
|
||||
orbis::Ref<Device> mDevice;
|
||||
rx::Ref<Device> mDevice;
|
||||
|
||||
public:
|
||||
DeviceCtl() noexcept;
|
||||
DeviceCtl(orbis::Ref<orbis::RcBase> device) noexcept;
|
||||
DeviceCtl(rx::Ref<rx::RcBase> device) noexcept;
|
||||
DeviceCtl(DeviceCtl &&) noexcept;
|
||||
DeviceCtl(const DeviceCtl &);
|
||||
DeviceCtl &operator=(DeviceCtl &&) noexcept;
|
||||
|
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
static DeviceCtl createDevice();
|
||||
DeviceContext &getContext();
|
||||
orbis::Ref<orbis::RcBase> getOpaque();
|
||||
rx::Ref<rx::RcBase> getOpaque();
|
||||
|
||||
void submitGfxCommand(int gfxPipe, int vmId,
|
||||
std::span<const std::uint32_t> command);
|
||||
|
|
|
|||
|
|
@ -704,7 +704,7 @@ IoDevice *createHostIoDevice(orbis::kstring hostPath,
|
|||
return orbis::knew<HostFsDevice>(std::move(hostPath), std::move(virtualPath));
|
||||
}
|
||||
|
||||
orbis::Ref<orbis::File> wrapSocket(int hostFd, orbis::kstring name, int dom,
|
||||
rx::Ref<orbis::File> wrapSocket(int hostFd, orbis::kstring name, int dom,
|
||||
int type, int prot) {
|
||||
auto s = orbis::knew<SocketFile>();
|
||||
s->name = std::move(name);
|
||||
|
|
@ -716,7 +716,7 @@ orbis::Ref<orbis::File> wrapSocket(int hostFd, orbis::kstring name, int dom,
|
|||
return s;
|
||||
}
|
||||
|
||||
orbis::ErrorCode createSocket(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode createSocket(rx::Ref<orbis::File> *file,
|
||||
orbis::kstring name, int dom, int type,
|
||||
int prot) {
|
||||
// ORBIS_LOG_ERROR(__FUNCTION__, name, dom, type, prot);
|
||||
|
|
@ -771,7 +771,7 @@ toRealPath(const std::filesystem::path &inp) {
|
|||
return result;
|
||||
}
|
||||
|
||||
orbis::ErrorCode HostFsDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode HostFsDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto realPath = hostPath + "/" + path;
|
||||
|
|
@ -938,7 +938,7 @@ orbis::ErrorCode HostFsDevice::rename(const char *from, const char *to,
|
|||
return convertErrorCode(ec);
|
||||
}
|
||||
|
||||
orbis::File *createHostFile(int hostFd, orbis::Ref<IoDevice> device,
|
||||
orbis::File *createHostFile(int hostFd, rx::Ref<IoDevice> device,
|
||||
bool alignTruncate) {
|
||||
auto newFile = orbis::knew<HostFile>();
|
||||
newFile->hostFd = hostFd;
|
||||
|
|
@ -951,7 +951,7 @@ orbis::File *createHostFile(int hostFd, orbis::Ref<IoDevice> device,
|
|||
struct FdWrapDevice : public IoDevice {
|
||||
int fd;
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
*file = createHostFile(fd, this);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <cstdint>
|
||||
#include <system_error>
|
||||
|
||||
|
|
@ -24,8 +24,8 @@ enum OpenFlags {
|
|||
kOpenFlagDirectory = 0x20000,
|
||||
};
|
||||
|
||||
struct IoDevice : orbis::RcBase {
|
||||
virtual orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
struct IoDevice : rx::RcBase {
|
||||
virtual orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) = 0;
|
||||
virtual orbis::ErrorCode unlink(const char *path, bool recursive,
|
||||
|
|
@ -56,7 +56,7 @@ struct HostFsDevice : IoDevice {
|
|||
|
||||
HostFsDevice(orbis::kstring path, orbis::kstring virtualPath)
|
||||
: hostPath(std::move(path)), virtualPath(std::move(virtualPath)) {}
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
orbis::ErrorCode unlink(const char *path, bool recursive,
|
||||
|
|
@ -74,10 +74,10 @@ orbis::ErrorCode convertErrorCode(const std::error_code &code);
|
|||
orbis::ErrorCode convertErrno();
|
||||
IoDevice *createHostIoDevice(orbis::kstring hostPath,
|
||||
orbis::kstring virtualPath);
|
||||
orbis::Ref<orbis::File> wrapSocket(int hostFd, orbis::kstring name, int dom,
|
||||
rx::Ref<orbis::File> wrapSocket(int hostFd, orbis::kstring name, int dom,
|
||||
int type, int prot);
|
||||
orbis::ErrorCode createSocket(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode createSocket(rx::Ref<orbis::File> *file,
|
||||
orbis::kstring name, int dom, int type, int prot);
|
||||
orbis::File *createHostFile(int hostFd, orbis::Ref<IoDevice> device,
|
||||
orbis::File *createHostFile(int hostFd, rx::Ref<IoDevice> device,
|
||||
bool alignTruncate = false);
|
||||
IoDevice *createFdWrapDevice(int fd);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct A53IoDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<A53IoFile>();
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ struct AjmDevice : IoDevice {
|
|||
orbis::uint32_t instanceIds[AJM_CODEC_COUNT]{};
|
||||
orbis::uint32_t unimplementedInstanceId = 0;
|
||||
orbis::kmap<orbis::int32_t, Instance> instanceMap;
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -778,7 +778,7 @@ static const orbis::FileOps fileOps = {
|
|||
.ioctl = ajm_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode AjmDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode AjmDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<AjmFile>();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "orbis/thread/Thread.hpp"
|
||||
#include "orbis/uio.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <bits/types/struct_iovec.h>
|
||||
// #include <rx/hexdump.hpp>
|
||||
|
||||
|
|
@ -29,12 +29,12 @@ struct AoutFile : orbis::File {};
|
|||
|
||||
struct AoutDevice : public IoDevice {
|
||||
std::int8_t id;
|
||||
orbis::Ref<AudioDevice> audioDevice;
|
||||
rx::Ref<AudioDevice> audioDevice;
|
||||
|
||||
AoutDevice(std::int8_t id, AudioDevice *audioDevice)
|
||||
: id(id), audioDevice(audioDevice) {}
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -192,7 +192,7 @@ static const orbis::FileOps fileOps = {
|
|||
.write = aout_write,
|
||||
};
|
||||
|
||||
orbis::ErrorCode AoutDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode AoutDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
ORBIS_LOG_FATAL("aout device open", path, flags, mode);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct AVControlDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<AVControlFile>();
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ static const orbis::FileOps ops = {
|
|||
.mmap = blockpool_mmap,
|
||||
};
|
||||
|
||||
orbis::ErrorCode BlockPoolDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode BlockPoolDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/error/ErrorCode.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include "rx/MemoryTable.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
struct BlockPoolDevice : public IoDevice {
|
||||
rx::shared_mutex mtx;
|
||||
rx::MemoryAreaTable<> pool;
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
orbis::ErrorCode map(void **address, std::uint64_t len, std::int32_t prot,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct BtDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<BtFile>();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct CameraDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<CameraFile>();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct CaymanRegDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -22,7 +22,7 @@ static const orbis::FileOps fileOps = {
|
|||
.ioctl = cayman_reg_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode CaymanRegDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode CaymanRegDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct CdDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<CdFile>();
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ struct ConsoleDevice : IoDevice {
|
|||
ConsoleDevice(int inputFd, int outputFd)
|
||||
: inputFd(inputFd), outputFd(outputFd) {}
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -64,7 +64,7 @@ static const orbis::FileOps fileOps = {
|
|||
.write = console_write,
|
||||
};
|
||||
|
||||
orbis::ErrorCode ConsoleDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode ConsoleDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -626,7 +626,7 @@ static void createGpu() {
|
|||
}
|
||||
}
|
||||
|
||||
orbis::ErrorCode DceDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode DceDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<DceFile>();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "orbis/error/ErrorCode.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/thread/Process.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
|
||||
static constexpr auto kVmIdCount = 6;
|
||||
|
|
@ -16,7 +16,7 @@ struct DceDevice : IoDevice {
|
|||
std::uint32_t freeVmIds = (1 << (kVmIdCount + 1)) - 1;
|
||||
orbis::uint64_t dmemOffset = ~static_cast<std::uint64_t>(0);
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct DevActDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<DevActFile>();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ static const orbis::FileOps fileOps = {
|
|||
|
||||
struct DevCtlDevice : IoDevice {
|
||||
orbis::kstring data;
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<DevCtlFile>();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct DevStatDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<DevStatFile>();
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ static const orbis::FileOps ops = {
|
|||
};
|
||||
|
||||
struct DipswDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<DipswFile>();
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ orbis::ErrorCode DmemDevice::queryMaxFreeChunkSize(std::uint64_t *start,
|
|||
return {};
|
||||
}
|
||||
|
||||
orbis::ErrorCode DmemDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode DmemDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<DmemFile>();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/error/ErrorCode.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include <cstdint>
|
||||
#include <rx/MemoryTable.hpp>
|
||||
|
|
@ -38,7 +38,7 @@ struct DmemDevice : public IoDevice {
|
|||
|
||||
orbis::ErrorCode release(std::uint64_t start, std::uint64_t size);
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct EvlgDevice : IoDevice {
|
|||
|
||||
EvlgDevice(int outputFd) : outputFd(outputFd) {}
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -42,7 +42,7 @@ static const orbis::FileOps fileOps = {
|
|||
.write = evlg_write,
|
||||
};
|
||||
|
||||
orbis::ErrorCode EvlgDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode EvlgDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<EvlgFile>();
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct GbaseDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<GbaseFile>();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ struct GcDevice : public IoDevice {
|
|||
orbis::kmap<orbis::pid_t, int> clients;
|
||||
orbis::kmap<std::uint64_t, ComputeQueue> computeQueues;
|
||||
void *submitArea = nullptr;
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
|
||||
|
|
@ -458,7 +458,7 @@ static const orbis::FileOps ops = {
|
|||
.mmap = gc_mmap,
|
||||
};
|
||||
|
||||
orbis::ErrorCode GcDevice::open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode GcDevice::open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<GcFile>();
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct HddDevice : IoDevice {
|
|||
std::uint64_t size;
|
||||
HddDevice(std::uint64_t size) : size(size) {}
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *fs, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *fs, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -135,7 +135,7 @@ static const orbis::FileOps fsOps = {
|
|||
.stat = hdd_stat,
|
||||
};
|
||||
|
||||
orbis::ErrorCode HddDevice::open(orbis::Ref<orbis::File> *fs, const char *path,
|
||||
orbis::ErrorCode HddDevice::open(rx::Ref<orbis::File> *fs, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<HddFile>();
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct HDMIDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<HDMIFile>();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <chrono>
|
||||
|
||||
struct HidDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -155,7 +155,7 @@ static const orbis::FileOps ops = {
|
|||
.ioctl = hid_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode HidDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode HidDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<HidFile>();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd2CmdDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -19,7 +19,7 @@ static const orbis::FileOps ops = {
|
|||
.ioctl = hmd2_cmd_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd2CmdDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode Hmd2CmdDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd2GazeDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -20,7 +20,7 @@ static const orbis::FileOps ops = {
|
|||
.ioctl = hmd2_gaze_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd2GazeDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode Hmd2GazeDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd2GenDataDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -20,7 +20,7 @@ static const orbis::FileOps ops = {
|
|||
.ioctl = hmd2_gen_data_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd2GenDataDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode Hmd2GenDataDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd2ImuDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -19,7 +19,7 @@ static const orbis::FileOps ops = {
|
|||
.ioctl = hmd2_imu_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd2ImuDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode Hmd2ImuDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd3daDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -22,7 +22,7 @@ static const orbis::FileOps ops = {
|
|||
.ioctl = hmd_3da_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd3daDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode Hmd3daDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<Hmd3daFile>();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct HmdCmdDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -21,7 +21,7 @@ static const orbis::FileOps ops = {
|
|||
.ioctl = hmd_cmd_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode HmdCmdDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode HmdCmdDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<HmdCmdFile>();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "vm.hpp"
|
||||
|
||||
struct HmdMmapDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -38,7 +38,7 @@ static const orbis::FileOps ops = {
|
|||
.mmap = hmd_mmap_mmap,
|
||||
};
|
||||
|
||||
orbis::ErrorCode HmdMmapDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode HmdMmapDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct HmdSnsrDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -22,7 +22,7 @@ static const orbis::FileOps ops = {
|
|||
.ioctl = hmd_snsr_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode HmdSnsrDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode HmdSnsrDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct IccConfigurationDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<IccConfigurationFile>();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
struct IccPowerDevice : IoDevice {
|
||||
std::uint8_t bootphase = 0;
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -57,7 +57,7 @@ static const orbis::FileOps fileOps = {
|
|||
.stat = icc_stat,
|
||||
};
|
||||
|
||||
orbis::ErrorCode IccPowerDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode IccPowerDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct LvdCtlDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<LvdCtlFile>();
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ void MBusDevice::emitEvent(const MBusEvent &event) {
|
|||
eventEmitter->emit(orbis::kEvFiltRead);
|
||||
}
|
||||
|
||||
orbis::ErrorCode MBusDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode MBusDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
ORBIS_LOG_FATAL("mbus device open");
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ struct MBusDevice : IoDevice {
|
|||
rx::shared_mutex mtx;
|
||||
rx::shared_cv cv;
|
||||
orbis::kdeque<MBusEvent> events;
|
||||
orbis::Ref<orbis::EventEmitter> eventEmitter =
|
||||
rx::Ref<orbis::EventEmitter> eventEmitter =
|
||||
orbis::knew<orbis::EventEmitter>();
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static const orbis::FileOps fileOps = {
|
|||
.read = mbus_av_read,
|
||||
};
|
||||
|
||||
orbis::ErrorCode MBusAVDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode MBusAVDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<MBusAVFile>();
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ struct MBusAVDevice : IoDevice {
|
|||
rx::shared_mutex mtx;
|
||||
rx::shared_cv cv;
|
||||
orbis::kdeque<MBusEvent> events;
|
||||
orbis::Ref<orbis::EventEmitter> eventEmitter =
|
||||
rx::Ref<orbis::EventEmitter> eventEmitter =
|
||||
orbis::knew<orbis::EventEmitter>();
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct MetaDbgDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<MetaDbgFile>();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct NotificationDevice : IoDevice {
|
|||
orbis::kvector<std::byte> data;
|
||||
|
||||
NotificationDevice(int index) : index(index) {}
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -90,7 +90,7 @@ static const orbis::FileOps fileOps = {
|
|||
.write = notification_write,
|
||||
};
|
||||
|
||||
orbis::ErrorCode NotificationDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode NotificationDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct NpdrmDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<NpdrmFile>();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct NsidCtlDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<NsidCtlFile>();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include <span>
|
||||
|
||||
struct NullDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -22,7 +22,7 @@ static const orbis::FileOps ops = {
|
|||
.write = null_write,
|
||||
};
|
||||
|
||||
orbis::ErrorCode NullDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode NullDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<NullFile>();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "vm.hpp"
|
||||
|
||||
struct RngDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -38,7 +38,7 @@ static const orbis::FileOps ops = {
|
|||
.mmap = rng_mmap,
|
||||
};
|
||||
|
||||
orbis::ErrorCode RngDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode RngDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<RngFile>();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct S3DADevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<S3DAFile>();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ struct SblSrvFile : public orbis::File {};
|
|||
|
||||
struct SblSrvDevice : IoDevice {
|
||||
rx::shared_mutex mtx;
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -43,7 +43,7 @@ static const orbis::FileOps ops = {
|
|||
.mmap = sbl_srv_mmap,
|
||||
};
|
||||
|
||||
orbis::ErrorCode SblSrvDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode SblSrvDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<SblSrvFile>();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct ScaninDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<ScaninFile>();
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@
|
|||
#include <sys/mman.h>
|
||||
|
||||
struct ShmDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
orbis::ErrorCode unlink(const char *path, bool recursive,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
||||
orbis::ErrorCode ShmDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode ShmDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
ORBIS_LOG_WARNING("shm_open", path, flags, mode);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct SrtcDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<SrtcFile>();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct ScreenShotDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<ScreenShotFile>();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <span>
|
||||
|
||||
struct UrandomDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -25,7 +25,7 @@ static const orbis::FileOps ops = {
|
|||
.read = urandom_read,
|
||||
};
|
||||
|
||||
orbis::ErrorCode UrandomDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode UrandomDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode,
|
||||
orbis::Thread *thread) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct UVDDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<UVDFile>();
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct VCEDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<VCEFile>();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ static const orbis::FileOps fileOps = {
|
|||
};
|
||||
|
||||
struct XptDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<XptFile>();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <span>
|
||||
|
||||
struct ZeroDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
|
|
@ -25,7 +25,7 @@ static const orbis::FileOps ops = {
|
|||
.read = zero_read,
|
||||
};
|
||||
|
||||
orbis::ErrorCode ZeroDevice::open(orbis::Ref<orbis::File> *file,
|
||||
orbis::ErrorCode ZeroDevice::open(rx::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<ZeroFile>();
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ orbis::sint ipmi::IpmiClient::sendSyncMessageRaw(
|
|||
|
||||
ipmi::IpmiClient ipmi::createIpmiClient(orbis::Thread *thread,
|
||||
const char *name) {
|
||||
orbis::Ref<orbis::IpmiClient> client;
|
||||
rx::Ref<orbis::IpmiClient> client;
|
||||
GuestAlloc config = orbis::IpmiCreateClientConfig{
|
||||
.size = sizeof(orbis::IpmiCreateClientConfig),
|
||||
};
|
||||
|
|
@ -178,7 +178,7 @@ orbis::EventFlag *ipmi::createEventFlag(std::string_view name, uint32_t attrs,
|
|||
|
||||
void ipmi::createShm(const char *name, uint32_t flags, uint32_t mode,
|
||||
uint64_t size) {
|
||||
orbis::Ref<orbis::File> shm;
|
||||
rx::Ref<orbis::File> shm;
|
||||
auto shmDevice = orbis::g_context.shmDevice.staticCast<IoDevice>();
|
||||
shmDevice->open(&shm, name, flags, mode, nullptr);
|
||||
shm->ops->truncate(shm.get(), size, nullptr);
|
||||
|
|
@ -299,7 +299,7 @@ ipmi::IpmiServer::handle(orbis::IpmiSession *session,
|
|||
ipmi::IpmiServer &ipmi::createIpmiServer(orbis::Process *process,
|
||||
const char *name) {
|
||||
orbis::IpmiCreateServerConfig config{};
|
||||
orbis::Ref<orbis::IpmiServer> serverImpl;
|
||||
rx::Ref<orbis::IpmiServer> serverImpl;
|
||||
orbis::ipmiCreateServer(process, nullptr, name, config, serverImpl);
|
||||
auto server = std::make_shared<ipmi::IpmiServer>();
|
||||
server->serverImpl = serverImpl;
|
||||
|
|
@ -428,7 +428,7 @@ struct SceSysAudioSystemPortAndThreadArgs {
|
|||
};
|
||||
|
||||
void ipmi::createAudioSystemObjects(orbis::Process *process) {
|
||||
auto audioOut = orbis::Ref<AudioOut>(orbis::knew<AudioOut>());
|
||||
auto audioOut = rx::Ref<AudioOut>(orbis::knew<AudioOut>());
|
||||
|
||||
createIpmiServer(process, "SceSysAudioSystemIpc")
|
||||
.addSyncMethod<SceSysAudioSystemThreadArgs>(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ template <typename T> std::vector<std::byte> toBytes(const T &value) {
|
|||
}
|
||||
|
||||
struct IpmiClient {
|
||||
orbis::Ref<orbis::IpmiClient> clientImpl;
|
||||
rx::Ref<orbis::IpmiClient> clientImpl;
|
||||
orbis::uint kid;
|
||||
orbis::Thread *thread;
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ struct IpmiClient {
|
|||
};
|
||||
|
||||
struct IpmiServer {
|
||||
orbis::Ref<orbis::IpmiServer> serverImpl;
|
||||
rx::Ref<orbis::IpmiServer> serverImpl;
|
||||
|
||||
std::unordered_map<std::uint32_t,
|
||||
std::function<orbis::ErrorCode(
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@
|
|||
#include <sys/mman.h>
|
||||
#include <unordered_map>
|
||||
|
||||
using orbis::utils::Ref;
|
||||
|
||||
std::uint64_t monoPimpAddress;
|
||||
|
||||
static std::vector<std::byte> unself(const std::byte *image, std::size_t size) {
|
||||
|
|
@ -361,9 +359,9 @@ void rx::linker::override(std::string originalModuleName,
|
|||
std::move(replacedModulePath);
|
||||
}
|
||||
|
||||
Ref<orbis::Module> rx::linker::loadModule(std::span<std::byte> image,
|
||||
orbis::Process *process) {
|
||||
Ref<orbis::Module> result{orbis::knew<orbis::Module>()};
|
||||
rx::Ref<orbis::Module> rx::linker::loadModule(std::span<std::byte> image,
|
||||
orbis::Process *process) {
|
||||
rx::Ref<orbis::Module> result{orbis::knew<orbis::Module>()};
|
||||
|
||||
Elf64_Ehdr header;
|
||||
std::memcpy(&header, image.data(), sizeof(Elf64_Ehdr));
|
||||
|
|
@ -973,9 +971,9 @@ Ref<orbis::Module> rx::linker::loadModule(std::span<std::byte> image,
|
|||
return result;
|
||||
}
|
||||
|
||||
static Ref<orbis::Module> loadModuleFileImpl(std::string_view path,
|
||||
orbis::Thread *thread) {
|
||||
orbis::Ref<orbis::File> instance;
|
||||
static rx::Ref<orbis::Module> loadModuleFileImpl(std::string_view path,
|
||||
orbis::Thread *thread) {
|
||||
rx::Ref<orbis::File> instance;
|
||||
if (vfs::open(path, kOpenFlagReadOnly, 0, &instance, thread).isError()) {
|
||||
return {};
|
||||
}
|
||||
|
|
@ -1029,8 +1027,8 @@ static Ref<orbis::Module> loadModuleFileImpl(std::string_view path,
|
|||
return rx::linker::loadModule(image, thread->tproc);
|
||||
}
|
||||
|
||||
Ref<orbis::Module> rx::linker::loadModuleFile(std::string_view path,
|
||||
orbis::Thread *thread) {
|
||||
rx::Ref<orbis::Module> rx::linker::loadModuleFile(std::string_view path,
|
||||
orbis::Thread *thread) {
|
||||
if (auto result = loadModuleFileImpl(path, thread)) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "orbis/module/Module.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <cstddef>
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
|
|
@ -75,8 +75,8 @@ enum OrbisElfType_t {
|
|||
|
||||
void override(std::string originalModuleName,
|
||||
std::filesystem::path replacedModulePath);
|
||||
orbis::Ref<orbis::Module> loadModule(std::span<std::byte> image,
|
||||
orbis::Process *process);
|
||||
orbis::Ref<orbis::Module> loadModuleFile(std::string_view path,
|
||||
orbis::Thread *thread);
|
||||
rx::Ref<orbis::Module> loadModule(std::span<std::byte> image,
|
||||
orbis::Process *process);
|
||||
rx::Ref<orbis::Module> loadModuleFile(std::string_view path,
|
||||
orbis::Thread *thread);
|
||||
} // namespace rx::linker
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#include "vm.hpp"
|
||||
#include "xbyak/xbyak.h"
|
||||
#include <optional>
|
||||
#include <orbis/utils/Rc.hpp>
|
||||
#include <rx/Rc.hpp>
|
||||
#include <rx/Version.hpp>
|
||||
#include <rx/align.hpp>
|
||||
#include <rx/hexdump.hpp>
|
||||
|
|
@ -519,9 +519,9 @@ static void guestInitDev() {
|
|||
}
|
||||
|
||||
static void guestInitFd(orbis::Thread *mainThread) {
|
||||
orbis::Ref<orbis::File> stdinFile;
|
||||
orbis::Ref<orbis::File> stdoutFile;
|
||||
orbis::Ref<orbis::File> stderrFile;
|
||||
rx::Ref<orbis::File> stdinFile;
|
||||
rx::Ref<orbis::File> stdoutFile;
|
||||
rx::Ref<orbis::File> stderrFile;
|
||||
rx::procOpsTable.open(mainThread, "/dev/stdin", 0, 0, &stdinFile);
|
||||
rx::procOpsTable.open(mainThread, "/dev/stdout", 0, 0, &stdoutFile);
|
||||
rx::procOpsTable.open(mainThread, "/dev/stderr", 0, 0, &stderrFile);
|
||||
|
|
@ -551,7 +551,7 @@ struct ExecEnv {
|
|||
};
|
||||
|
||||
int guestExec(orbis::Thread *mainThread, ExecEnv execEnv,
|
||||
orbis::utils::Ref<orbis::Module> executableModule,
|
||||
rx::Ref<orbis::Module> executableModule,
|
||||
std::span<std::string> argv, std::span<std::string> envp) {
|
||||
const auto stackEndAddress = 0x7'ffff'c000ull;
|
||||
const auto stackSize = 0x40000 * 32;
|
||||
|
|
@ -657,7 +657,7 @@ struct ProcessParam {
|
|||
};
|
||||
|
||||
ExecEnv guestCreateExecEnv(orbis::Thread *mainThread,
|
||||
const orbis::Ref<orbis::Module> &executableModule,
|
||||
const rx::Ref<orbis::Module> &executableModule,
|
||||
bool isSystem) {
|
||||
std::uint64_t interpBase = 0;
|
||||
std::uint64_t entryPoint = executableModule->entryPoint;
|
||||
|
|
@ -760,7 +760,7 @@ ExecEnv guestCreateExecEnv(orbis::Thread *mainThread,
|
|||
}
|
||||
|
||||
int guestExec(orbis::Thread *mainThread,
|
||||
orbis::utils::Ref<orbis::Module> executableModule,
|
||||
rx::Ref<orbis::Module> executableModule,
|
||||
std::span<std::string> argv, std::span<std::string> envp) {
|
||||
auto execEnv = guestCreateExecEnv(mainThread, executableModule, true);
|
||||
return guestExec(mainThread, execEnv, std::move(executableModule), argv,
|
||||
|
|
@ -858,14 +858,14 @@ static orbis::SysResult launchDaemon(orbis::Thread *thread, std::string path,
|
|||
|
||||
guestInitFd(newThread);
|
||||
|
||||
orbis::Ref<orbis::File> socket;
|
||||
rx::Ref<orbis::File> socket;
|
||||
createSocket(&socket, "", 1, 1, 0);
|
||||
process->fileDescriptors.insert(socket);
|
||||
|
||||
ORBIS_LOG_ERROR(__FUNCTION__, path);
|
||||
|
||||
{
|
||||
orbis::Ref<orbis::File> file;
|
||||
rx::Ref<orbis::File> file;
|
||||
auto result = vfs::open(path, kOpenFlagReadOnly, 0, &file, thread);
|
||||
if (result.isError()) {
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "orbis/uio.hpp"
|
||||
#include "orbis/umtx.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include "orbis/vm.hpp"
|
||||
#include "rx/watchdog.hpp"
|
||||
#include "thread.hpp"
|
||||
|
|
@ -43,11 +43,11 @@ extern bool allowMonoDebug;
|
|||
extern "C" void __register_frame(const void *);
|
||||
void setupSigHandlers();
|
||||
int guestExec(orbis::Thread *mainThread,
|
||||
orbis::utils::Ref<orbis::Module> executableModule,
|
||||
rx::Ref<orbis::Module> executableModule,
|
||||
std::span<std::string> argv, std::span<std::string> envp);
|
||||
|
||||
namespace {
|
||||
static std::pair<SysResult, Ref<Module>>
|
||||
static std::pair<SysResult, rx::Ref<Module>>
|
||||
loadPrx(orbis::Thread *thread, std::string_view name, bool relocate,
|
||||
std::map<std::string, Module *, std::less<>> &loadedObjects,
|
||||
std::map<std::string, Module *, std::less<>> &loadedModules,
|
||||
|
|
@ -130,7 +130,7 @@ loadPrx(orbis::Thread *thread, std::string_view name, bool relocate,
|
|||
return {{}, module};
|
||||
}
|
||||
|
||||
static std::pair<SysResult, Ref<Module>>
|
||||
static std::pair<SysResult, rx::Ref<Module>>
|
||||
loadPrx(orbis::Thread *thread, std::string_view path, bool relocate) {
|
||||
std::map<std::string, Module *, std::less<>> loadedObjects;
|
||||
std::map<std::string, Module *, std::less<>> loadedModules;
|
||||
|
|
@ -296,13 +296,13 @@ query_memory_protection(orbis::Thread *thread, orbis::ptr<void> address,
|
|||
|
||||
orbis::SysResult open(orbis::Thread *thread, orbis::ptr<const char> path,
|
||||
orbis::sint flags, orbis::sint mode,
|
||||
orbis::Ref<orbis::File> *file) {
|
||||
rx::Ref<orbis::File> *file) {
|
||||
return vfs::open(getAbsolutePath(path, thread), flags, mode, file, thread);
|
||||
}
|
||||
|
||||
orbis::SysResult shm_open(orbis::Thread *thread, const char *path,
|
||||
orbis::sint flags, orbis::sint mode,
|
||||
orbis::Ref<orbis::File> *file) {
|
||||
rx::Ref<orbis::File> *file) {
|
||||
auto dev = static_cast<IoDevice *>(orbis::g_context.shmDevice.get());
|
||||
return dev->open(file, path, flags, mode, thread);
|
||||
}
|
||||
|
|
@ -325,7 +325,7 @@ orbis::SysResult rename(Thread *thread, ptr<const char> from,
|
|||
}
|
||||
|
||||
orbis::SysResult blockpool_open(orbis::Thread *thread,
|
||||
orbis::Ref<orbis::File> *file) {
|
||||
rx::Ref<orbis::File> *file) {
|
||||
auto dev = static_cast<IoDevice *>(orbis::g_context.blockpoolDevice.get());
|
||||
return dev->open(file, nullptr, 0, 0, thread);
|
||||
}
|
||||
|
|
@ -353,13 +353,13 @@ orbis::SysResult blockpool_unmap(orbis::Thread *thread, orbis::caddr_t addr,
|
|||
|
||||
orbis::SysResult socket(orbis::Thread *thread, orbis::ptr<const char> name,
|
||||
orbis::sint domain, orbis::sint type,
|
||||
orbis::sint protocol, Ref<File> *file) {
|
||||
orbis::sint protocol, rx::Ref<File> *file) {
|
||||
return createSocket(file, name ? name : "", domain, type, protocol);
|
||||
}
|
||||
|
||||
orbis::SysResult socketPair(orbis::Thread *thread, orbis::sint domain,
|
||||
orbis::sint type, orbis::sint protocol,
|
||||
Ref<File> *a, Ref<File> *b) {
|
||||
rx::Ref<File> *a, rx::Ref<File> *b) {
|
||||
|
||||
if (domain == 1 && type == 1 && protocol == 0) {
|
||||
int fds[2];
|
||||
|
|
@ -479,7 +479,7 @@ orbis::SysResult dynlib_load_prx(orbis::Thread *thread,
|
|||
auto path = getAbsolutePath(_name, thread);
|
||||
|
||||
{
|
||||
orbis::Ref<orbis::File> file;
|
||||
rx::Ref<orbis::File> file;
|
||||
if (auto result = vfs::open(path, 0, 0, &file, thread); result.isError()) {
|
||||
return result;
|
||||
}
|
||||
|
|
@ -571,7 +571,7 @@ SysResult thr_new(orbis::Thread *thread, orbis::ptr<thr_param> param,
|
|||
ORBIS_LOG_NOTICE(" rtp: ", _rtp.type, _rtp.prio);
|
||||
}
|
||||
childThread->handle =
|
||||
std::thread{[=, childThread = Ref<Thread>(childThread)] {
|
||||
std::thread{[=, childThread = rx::Ref<Thread>(childThread)] {
|
||||
static_cast<void>(
|
||||
uwrite(_param.child_tid, slong(childThread->tid))); // TODO: verify
|
||||
auto context = new ucontext_t{};
|
||||
|
|
@ -893,7 +893,7 @@ SysResult execve(Thread *thread, ptr<char> fname, ptr<ptr<char>> argv,
|
|||
// }
|
||||
// }
|
||||
{
|
||||
orbis::Ref<File> file;
|
||||
rx::Ref<File> file;
|
||||
auto result = vfs::open(path, kOpenFlagReadOnly, 0, &file, thread);
|
||||
if (result.isError()) {
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ static orbis::FileOps devfs_ops = {
|
|||
};
|
||||
|
||||
struct DevFs : IoDevice {
|
||||
std::map<std::string, orbis::Ref<IoDevice>, std::less<>> devices;
|
||||
std::map<std::string, rx::Ref<IoDevice>, std::less<>> devices;
|
||||
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
if (path[0] == '\0') {
|
||||
|
|
@ -51,7 +51,7 @@ struct DevFs : IoDevice {
|
|||
};
|
||||
|
||||
struct ProcFs : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
orbis::ErrorCode open(rx::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
std::fprintf(stderr, "procfs access: %s\n", path);
|
||||
|
|
@ -60,8 +60,8 @@ struct ProcFs : IoDevice {
|
|||
};
|
||||
|
||||
static rx::shared_mutex gMountMtx;
|
||||
static std::map<std::string, orbis::Ref<IoDevice>, std::greater<>> gMountsMap;
|
||||
static orbis::Ref<DevFs> gDevFs;
|
||||
static std::map<std::string, rx::Ref<IoDevice>, std::greater<>> gMountsMap;
|
||||
static rx::Ref<DevFs> gDevFs;
|
||||
|
||||
void vfs::fork() {
|
||||
std::lock_guard lock(gMountMtx);
|
||||
|
|
@ -98,11 +98,11 @@ void vfs::addDevice(std::string name, IoDevice *device) {
|
|||
gDevFs->devices[std::move(name)] = device;
|
||||
}
|
||||
|
||||
std::pair<orbis::Ref<IoDevice>, std::string>
|
||||
std::pair<rx::Ref<IoDevice>, std::string>
|
||||
vfs::get(const std::filesystem::path &guestPath) {
|
||||
std::string normalPath = std::filesystem::path(guestPath).lexically_normal();
|
||||
std::string_view path = normalPath;
|
||||
orbis::Ref<IoDevice> device;
|
||||
rx::Ref<IoDevice> device;
|
||||
|
||||
std::lock_guard lock(gMountMtx);
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ orbis::SysResult vfs::mount(const std::filesystem::path &guestPath,
|
|||
}
|
||||
|
||||
orbis::SysResult vfs::open(std::string_view path, int flags, int mode,
|
||||
orbis::Ref<orbis::File> *file,
|
||||
rx::Ref<orbis::File> *file,
|
||||
orbis::Thread *thread) {
|
||||
auto [device, devPath] = get(path);
|
||||
if (device == nullptr) {
|
||||
|
|
@ -175,7 +175,7 @@ bool vfs::exists(std::string_view path, orbis::Thread *thread) {
|
|||
return false;
|
||||
}
|
||||
|
||||
orbis::Ref<orbis::File> file;
|
||||
rx::Ref<orbis::File> file;
|
||||
if (device->open(&file, devPath.c_str(), 0, 0, thread) !=
|
||||
orbis::ErrorCode{}) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "orbis/error/SysResult.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include <filesystem>
|
||||
|
||||
struct IoDevice;
|
||||
|
|
@ -12,11 +12,11 @@ void fork();
|
|||
void initialize();
|
||||
void deinitialize();
|
||||
void addDevice(std::string name, IoDevice *device);
|
||||
std::pair<orbis::Ref<IoDevice>, std::string>
|
||||
std::pair<rx::Ref<IoDevice>, std::string>
|
||||
get(const std::filesystem::path &guestPath);
|
||||
orbis::SysResult mount(const std::filesystem::path &guestPath, IoDevice *dev);
|
||||
orbis::SysResult open(std::string_view path, int flags, int mode,
|
||||
orbis::Ref<orbis::File> *file, orbis::Thread *thread);
|
||||
rx::Ref<orbis::File> *file, orbis::Thread *thread);
|
||||
bool exists(std::string_view path, orbis::Thread *thread);
|
||||
orbis::SysResult mkdir(std::string_view path, int mode, orbis::Thread *thread);
|
||||
orbis::SysResult rmdir(std::string_view path, orbis::Thread *thread);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "orbis/thread/Process.hpp"
|
||||
#include "orbis/thread/Thread.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
#include "rx/Rc.hpp"
|
||||
#include "rx/format.hpp"
|
||||
#include "rx/print.hpp"
|
||||
#include "rx/watchdog.hpp"
|
||||
|
|
@ -649,7 +649,7 @@ struct Block {
|
|||
static Block gBlocks[kBlockCount];
|
||||
|
||||
struct MapInfo {
|
||||
orbis::Ref<IoDevice> device;
|
||||
rx::Ref<IoDevice> device;
|
||||
std::uint64_t offset;
|
||||
std::uint32_t flags;
|
||||
char name[32];
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
namespace orbis {
|
||||
inline namespace utils {
|
||||
namespace rx {
|
||||
template <std::size_t Count> struct BitSet {
|
||||
using chunk_type = std::uint64_t;
|
||||
static constexpr auto BitsPerChunk = sizeof(chunk_type) * 8;
|
||||
|
|
@ -128,5 +127,4 @@ template <std::size_t Count> struct BitSet {
|
|||
[[nodiscard]] constexpr iterator begin() const { return iterator(this); }
|
||||
[[nodiscard]] constexpr iterator_end end() const { return {}; }
|
||||
};
|
||||
} // namespace utils
|
||||
} // namespace orbis
|
||||
} // namespace rx
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "BitSet.hpp"
|
||||
#include "Rc.hpp"
|
||||
#include "rx/SharedMutex.hpp"
|
||||
#include "SharedMutex.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
|
|
@ -10,8 +10,7 @@
|
|||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
|
||||
namespace orbis {
|
||||
inline namespace utils {
|
||||
namespace rx {
|
||||
template <WithRc T, typename IdT = int, std::size_t MaxId = 4096,
|
||||
std::size_t MinId = 0>
|
||||
requires(MaxId > MinId)
|
||||
|
|
@ -178,7 +177,7 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
IdT insert(const Ref<T> &ref) { return insert(ref.get()); }
|
||||
IdT insert(const rx::Ref<T> &ref) { return insert(ref.get()); }
|
||||
|
||||
IdT insert(Ref<T> &&ref) {
|
||||
auto object = ref.release();
|
||||
|
|
@ -200,9 +199,9 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
bool insert(IdT id, const Ref<T> &ref) { return insert(id, ref.get()); }
|
||||
bool insert(IdT id, const rx::Ref<T> &ref) { return insert(id, ref.get()); }
|
||||
|
||||
bool insert(IdT id, Ref<T> &&ref) {
|
||||
bool insert(IdT id, rx::Ref<T> &&ref) {
|
||||
auto object = ref.release();
|
||||
|
||||
if (!insert_impl(id, object)) {
|
||||
|
|
@ -213,7 +212,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
Ref<T> get(IdT id) const {
|
||||
rx::Ref<T> get(IdT id) const {
|
||||
const auto rawId = static_cast<std::size_t>(id) - MinId;
|
||||
|
||||
if (rawId >= MaxId - MinId) {
|
||||
|
|
@ -404,5 +403,4 @@ struct OwningIdMap {
|
|||
}
|
||||
}
|
||||
};
|
||||
} // namespace utils
|
||||
} // namespace orbis
|
||||
} // namespace rx
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
namespace orbis {
|
||||
inline namespace utils {
|
||||
namespace rx {
|
||||
template <typename T> struct LinkedNode final {
|
||||
T object;
|
||||
LinkedNode *next = nullptr;
|
||||
|
|
@ -44,5 +43,4 @@ template <typename T> struct LinkedNode final {
|
|||
return result;
|
||||
}
|
||||
};
|
||||
} // namespace utils
|
||||
} // namespace orbis
|
||||
} // namespace rx
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue