[rpcsx-os] implement sys_execve

This commit is contained in:
DH 2023-11-01 01:58:03 +03:00
parent fd14659dc3
commit 9fe1fb841f
13 changed files with 342 additions and 141 deletions

View file

@ -0,0 +1,21 @@
#pragma once
#include "orbis-config.hpp"
namespace orbis {
struct AppInfo {
uint32_t appId;
uint32_t unk0;
uint32_t unk1;
uint32_t appType;
char titleId[10];
uint16_t unk2;
uint32_t unk3;
slong unk4;
slong unk5;
slong unk6;
slong unk7;
slong unk8;
};
static_assert(sizeof(AppInfo) == 72);
} // namespace orbis

View file

@ -1,10 +1,8 @@
#pragma once
#include "KernelAllocator.hpp"
#include "thread/Thread.hpp"
#include "utils/SharedCV.hpp"
#include "utils/SharedMutex.hpp"
#include <atomic>
#include <condition_variable>
namespace orbis {
enum {

View file

@ -7,6 +7,7 @@
#include "../thread/Thread.hpp"
#include "../thread/types.hpp"
#include "ProcessState.hpp"
#include "orbis/AppInfo.hpp"
#include "orbis/file.hpp"
#include "orbis/module/Module.hpp"
#include "orbis/utils/IdMap.hpp"
@ -53,10 +54,10 @@ struct Process final {
ptr<void> processParam = nullptr;
uint64_t processParamSize = 0;
const ProcessOps *ops = nullptr;
AppInfo appInfo{};
std::uint64_t nextTlsSlot = 1;
std::uint64_t lastTlsOffset = 0;
bool isSystem = false;
utils::RcIdMap<EventFlag, sint, 4097, 1> evfMap;
utils::RcIdMap<Semaphore, sint, 4097, 1> semMap;

View file

@ -71,6 +71,8 @@ struct ProcessOps {
SysResult (*thr_set_name)(Thread *thread, slong id, ptr<const char> name);
SysResult (*fork)(Thread *thread, slong status);
SysResult (*execve)(Thread *thread, ptr<char> fname, ptr<ptr<char>> argv,
ptr<ptr<char>> envv);
SysResult (*exit)(Thread *thread, sint status);
SysResult (*processNeeded)(Thread *thread);