2023-07-13 09:56:36 +00:00
|
|
|
#include "../Loader/Elf.h"
|
|
|
|
#include "LibKernel.h"
|
|
|
|
#include "Libs.h"
|
2023-07-24 10:05:57 +00:00
|
|
|
#include "../../../Debug.h"
|
2023-07-26 20:52:26 +00:00
|
|
|
#include "../../../Util/Log.h"
|
2023-07-27 10:36:47 +00:00
|
|
|
#include "Kernel/MemoryManagement.h"
|
2023-08-02 05:04:09 +00:00
|
|
|
#include "../../../Util/Singleton.h"
|
2023-08-02 05:41:41 +00:00
|
|
|
#include "Kernel/Objects/PhysicalMemory.h"
|
2023-07-13 09:56:36 +00:00
|
|
|
|
|
|
|
namespace HLE::Libs::LibKernel {
|
|
|
|
|
2023-07-17 10:53:27 +00:00
|
|
|
static u64 g_stack_chk_guard = 0xDEADBEEF54321ABC; //dummy return
|
|
|
|
|
2023-07-21 11:52:40 +00:00
|
|
|
int32_t PS4_SYSV_ABI sceKernelMapDirectMemory(void** addr, size_t len, int prot, int flags, off_t directMemoryStart, size_t alignment) {
|
2023-08-02 05:41:41 +00:00
|
|
|
auto* physical_memory = Singleton<HLE::Kernel::Objects::PhysicalMemory>::Instance();
|
2023-07-24 10:05:57 +00:00
|
|
|
BREAKPOINT();
|
2023-07-21 11:52:40 +00:00
|
|
|
return 0;
|
2023-07-13 09:56:36 +00:00
|
|
|
}
|
2023-07-21 11:52:40 +00:00
|
|
|
int32_t PS4_SYSV_ABI sceKernelReleaseDirectMemory(off_t start, size_t len) {
|
2023-07-24 10:05:57 +00:00
|
|
|
BREAKPOINT();
|
2023-07-21 11:52:40 +00:00
|
|
|
return 0;
|
2023-07-13 09:56:36 +00:00
|
|
|
}
|
|
|
|
|
2023-07-21 11:52:40 +00:00
|
|
|
int PS4_SYSV_ABI sceKernelCreateEqueue(/* SceKernelEqueue* eq*/ int eq, const char* name)
|
|
|
|
{
|
2023-07-26 20:52:26 +00:00
|
|
|
//BREAKPOINT();
|
2023-07-27 14:56:57 +00:00
|
|
|
PRINT_DUMMY_FUNCTION_NAME();
|
2023-07-21 11:52:40 +00:00
|
|
|
return 0;
|
2023-07-13 09:56:36 +00:00
|
|
|
}
|
2023-07-21 11:52:40 +00:00
|
|
|
int PS4_SYSV_ABI sceKernelWaitEqueue(/*SceKernelEqueue eq, SceKernelEvent* ev,*/ int num, int* out /*, SceKernelUseconds* timo*/)
|
|
|
|
{
|
2023-07-24 10:05:57 +00:00
|
|
|
BREAKPOINT();
|
2023-07-21 11:52:40 +00:00
|
|
|
return 0;
|
2023-07-14 11:29:13 +00:00
|
|
|
}
|
2023-07-21 11:52:40 +00:00
|
|
|
int PS4_SYSV_ABI sceKernelIsNeoMode()
|
|
|
|
{
|
2023-07-26 20:52:26 +00:00
|
|
|
//BREAKPOINT();
|
2023-07-27 14:56:57 +00:00
|
|
|
PRINT_DUMMY_FUNCTION_NAME();
|
2023-07-26 20:52:26 +00:00
|
|
|
return 0; //it isn't PS4VR TODO
|
2023-07-14 11:29:13 +00:00
|
|
|
}
|
|
|
|
|
2023-07-24 10:05:57 +00:00
|
|
|
static PS4_SYSV_ABI void stack_chk_fail() { BREAKPOINT();
|
2023-07-14 11:29:13 +00:00
|
|
|
}
|
2023-07-13 09:56:36 +00:00
|
|
|
void LibKernel_Register(SymbolsResolver* sym) {
|
2023-07-17 10:53:27 +00:00
|
|
|
//obj
|
|
|
|
LIB_OBJ("f7uOxY9mM1U", "libkernel", 1, "libkernel", 1, 1, &HLE::Libs::LibKernel::g_stack_chk_guard);
|
2023-07-13 09:56:36 +00:00
|
|
|
//memory
|
2023-07-27 10:36:47 +00:00
|
|
|
LIB_FUNCTION("rTXw65xmLIA", "libkernel", 1, "libkernel", 1, 1, HLE::Libs::LibKernel::MemoryManagement::sceKernelAllocateDirectMemory);
|
|
|
|
LIB_FUNCTION("pO96TwzOm5E", "libkernel", 1, "libkernel", 1, 1, HLE::Libs::LibKernel::MemoryManagement::sceKernelGetDirectMemorySize);
|
2023-07-13 09:56:36 +00:00
|
|
|
LIB_FUNCTION("L-Q3LEjIbgA", "libkernel", 1, "libkernel", 1, 1, sceKernelMapDirectMemory);
|
|
|
|
LIB_FUNCTION("MBuItvba6z8", "libkernel", 1, "libkernel", 1, 1, sceKernelReleaseDirectMemory);
|
|
|
|
//equeue
|
|
|
|
LIB_FUNCTION("D0OdFMjp46I", "libkernel", 1, "libkernel", 1, 1, sceKernelCreateEqueue);
|
2023-07-14 11:29:13 +00:00
|
|
|
LIB_FUNCTION("fzyMKs9kim0", "libkernel", 1, "libkernel", 1, 1, sceKernelWaitEqueue);
|
|
|
|
//misc
|
|
|
|
LIB_FUNCTION("WslcK1FQcGI", "libkernel", 1, "libkernel", 1, 1, sceKernelIsNeoMode);
|
|
|
|
LIB_FUNCTION("Ou3iL1abvng", "libkernel", 1, "libkernel", 1, 1, stack_chk_fail);
|
2023-07-13 09:56:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|