mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
[rpcsx-os] fork: implement vm and vfs fork
stub metadbg device implement notification device implement sys_pipe
This commit is contained in:
parent
39092c7f16
commit
525ef02e8a
22 changed files with 379 additions and 76 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
#include "evf.hpp"
|
||||
#include "ipmi.hpp"
|
||||
#include "orbis/utils/IdMap.hpp"
|
||||
#include "osem.hpp"
|
||||
#include "utils/LinkedNode.hpp"
|
||||
#include "utils/SharedCV.hpp"
|
||||
|
|
@ -54,6 +55,15 @@ public:
|
|||
void deleteProcess(Process *proc);
|
||||
Process *findProcessById(pid_t pid) const;
|
||||
|
||||
utils::LinkedNode<Process> *getProcessList() {
|
||||
return m_processes;
|
||||
}
|
||||
|
||||
long allocatePid() {
|
||||
std::lock_guard lock(m_thread_id_mtx);
|
||||
return m_thread_id_map.emplace(0).first;
|
||||
}
|
||||
|
||||
long getTscFreq();
|
||||
|
||||
void *kalloc(std::size_t size,
|
||||
|
|
@ -161,6 +171,8 @@ private:
|
|||
|
||||
std::atomic<long> m_tsc_freq{0};
|
||||
|
||||
shared_mutex m_thread_id_mtx;
|
||||
OwningIdMap<char, long, 256, 0> m_thread_id_map;
|
||||
mutable shared_mutex m_proc_mtx;
|
||||
utils::LinkedNode<Process> *m_processes = nullptr;
|
||||
|
||||
|
|
|
|||
13
orbis-kernel/include/orbis/pipe.hpp
Normal file
13
orbis-kernel/include/orbis/pipe.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include "KernelAllocator.hpp"
|
||||
#include "file.hpp"
|
||||
#include "utils/Rc.hpp"
|
||||
|
||||
namespace orbis {
|
||||
struct Pipe final : File {
|
||||
kvector<std::byte> data;
|
||||
};
|
||||
|
||||
Ref<Pipe> createPipe();
|
||||
} // namespace orbis
|
||||
|
|
@ -70,6 +70,7 @@ struct ProcessOps {
|
|||
SysResult (*thr_wake)(Thread *thread, slong id);
|
||||
SysResult (*thr_set_name)(Thread *thread, slong id, ptr<const char> name);
|
||||
|
||||
SysResult (*fork)(Thread *thread, slong status);
|
||||
SysResult (*exit)(Thread *thread, sint status);
|
||||
|
||||
SysResult (*processNeeded)(Thread *thread);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace orbis {
|
||||
inline namespace utils {
|
||||
// IPC-ready lightweight condition variable
|
||||
class shared_cv {
|
||||
class shared_cv final {
|
||||
enum : unsigned {
|
||||
c_waiter_mask = 0xffff,
|
||||
c_signal_mask = 0x7fff0000,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue