2023-07-13 09:56:36 +00:00
|
|
|
#include "LibKernel.h"
|
2023-10-06 18:49:53 +00:00
|
|
|
|
2023-08-13 13:54:56 +00:00
|
|
|
#include <Util/log.h>
|
2023-10-06 18:49:53 +00:00
|
|
|
#include <debug.h>
|
|
|
|
|
2023-10-15 07:03:26 +00:00
|
|
|
#include "Emulator/Util/singleton.h"
|
2023-10-06 18:49:53 +00:00
|
|
|
#include "../Loader/Elf.h"
|
2023-08-02 10:51:10 +00:00
|
|
|
#include "Kernel/Objects/physical_memory.h"
|
2023-08-15 20:10:45 +00:00
|
|
|
#include "Kernel/cpu_management.h"
|
2023-08-17 07:10:13 +00:00
|
|
|
#include "Kernel/event_queues.h"
|
2023-10-06 18:49:53 +00:00
|
|
|
#include "Kernel/memory_management.h"
|
|
|
|
#include "Libs.h"
|
2023-10-19 09:13:09 +00:00
|
|
|
#include "Emulator/HLE/Libraries/LibKernel/FileSystem/file_system.h"
|
|
|
|
#include "Emulator/HLE/Libraries/LibKernel/FileSystem/posix_file_system.h"
|
2023-07-13 09:56:36 +00:00
|
|
|
|
|
|
|
namespace HLE::Libs::LibKernel {
|
|
|
|
|
2023-10-06 18:49:53 +00:00
|
|
|
static u64 g_stack_chk_guard = 0xDEADBEEF54321ABC; // dummy return
|
2023-07-13 09:56:36 +00:00
|
|
|
|
2023-10-06 18:49:53 +00:00
|
|
|
int32_t PS4_SYSV_ABI sceKernelReleaseDirectMemory(off_t start, size_t len) {
|
|
|
|
BREAKPOINT();
|
|
|
|
return 0;
|
|
|
|
}
|
2023-07-14 11:29:13 +00:00
|
|
|
|
2023-10-06 18:49:53 +00:00
|
|
|
static PS4_SYSV_ABI void stack_chk_fail() { BREAKPOINT(); }
|
|
|
|
u64 PS4_SYSV_ABI sceKernelReadTsc() {
|
|
|
|
LARGE_INTEGER c;
|
|
|
|
QueryPerformanceCounter(&c);
|
|
|
|
return c.QuadPart;
|
|
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceKernelMunmap(void* addr, size_t len) { BREAKPOINT(); }
|
|
|
|
void LibKernel_Register(SymbolsResolver* sym) {
|
|
|
|
// obj
|
|
|
|
LIB_OBJ("f7uOxY9mM1U", "libkernel", 1, "libkernel", 1, 1, &HLE::Libs::LibKernel::g_stack_chk_guard);
|
|
|
|
// memory
|
|
|
|
LIB_FUNCTION("rTXw65xmLIA", "libkernel", 1, "libkernel", 1, 1, MemoryManagement::sceKernelAllocateDirectMemory);
|
|
|
|
LIB_FUNCTION("pO96TwzOm5E", "libkernel", 1, "libkernel", 1, 1, MemoryManagement::sceKernelGetDirectMemorySize);
|
|
|
|
LIB_FUNCTION("L-Q3LEjIbgA", "libkernel", 1, "libkernel", 1, 1, MemoryManagement::sceKernelMapDirectMemory);
|
|
|
|
LIB_FUNCTION("MBuItvba6z8", "libkernel", 1, "libkernel", 1, 1, sceKernelReleaseDirectMemory);
|
|
|
|
LIB_FUNCTION("cQke9UuBQOk", "libkernel", 1, "libkernel", 1, 1, sceKernelMunmap);
|
|
|
|
// equeue
|
|
|
|
LIB_FUNCTION("D0OdFMjp46I", "libkernel", 1, "libkernel", 1, 1, EventQueues::sceKernelCreateEqueue);
|
|
|
|
LIB_FUNCTION("fzyMKs9kim0", "libkernel", 1, "libkernel", 1, 1, EventQueues::sceKernelWaitEqueue);
|
|
|
|
// misc
|
|
|
|
LIB_FUNCTION("WslcK1FQcGI", "libkernel", 1, "libkernel", 1, 1, CPUManagement::sceKernelIsNeoMode);
|
|
|
|
LIB_FUNCTION("Ou3iL1abvng", "libkernel", 1, "libkernel", 1, 1, stack_chk_fail);
|
|
|
|
// time
|
|
|
|
LIB_FUNCTION("-2IRUCO--PM", "libkernel", 1, "libkernel", 1, 1, sceKernelReadTsc);
|
2023-10-19 09:13:09 +00:00
|
|
|
// fs
|
|
|
|
LIB_FUNCTION("1G3lF1Gg1k8", "libkernel", 1, "libkernel", 1, 1, Emulator::HLE::Libraries::LibKernel::FileSystem::sceKernelOpen);
|
|
|
|
LIB_FUNCTION("wuCroIGjt2g", "libScePosix", 1, "libkernel", 1, 1, Emulator::HLE::Libraries::LibKernel::FileSystem::POSIX::open);
|
2023-10-06 18:49:53 +00:00
|
|
|
}
|
2023-07-13 09:56:36 +00:00
|
|
|
|
2023-10-06 18:49:53 +00:00
|
|
|
}; // namespace HLE::Libs::LibKernel
|