mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
refactor(libkernel): refactir direct memory exports organization
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
add_library(libkernel SHARED EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DirectMemory/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DirectMemory/DirectMemory.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DirectMemory/MemoryPool.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Pthread/Pthread.cpp
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#pragma once
|
||||
#ifndef CORE_LIBS_PRX_LIBKERNEL_DIRECTMEMORY_DIRECTMEMORY_HPP
|
||||
#define CORE_LIBS_PRX_LIBKERNEL_DIRECTMEMORY_DIRECTMEMORY_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
@@ -18,3 +20,5 @@ int DoMapAnon(void** addr, size_t len, int prot, int flags);
|
||||
int DoMprotect(const void* addr, size_t len, int prot);
|
||||
int DoMunmap(void* addr, size_t len);
|
||||
int DoReserveVirtual(void** addr, size_t len, size_t alignment);
|
||||
|
||||
#endif
|
||||
@@ -1,3 +1,11 @@
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
#include "DirectMemory.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int sceKernelAllocateDirectMemory(int64_t search_start, int64_t search_end, size_t len, size_t alignment, int memory_type, int64_t* phys_addr_out) {
|
||||
(void)memory_type;
|
||||
@@ -93,3 +101,5 @@ int sceKernelVirtualQuery(const void* addr, int flags, VirtualQueryInfo* info, u
|
||||
info->protection = 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#pragma once
|
||||
#ifndef CORE_LIBS_PRX_LIBKERNEL_DIRECTMEMORY_MEMORYPOOL_HPP
|
||||
#define CORE_LIBS_PRX_LINKERNEL_DIRECTMEMORY_MEMORYPOOL_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
int DirectMemoryAlloc(int64_t searchStart, int64_t searchEnd, size_t len, size_t alignment, int64_t* physOut);
|
||||
void DirectMemoryFree(int64_t start, size_t len);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1405,84 +1405,6 @@ int64_t sceKernelWrite(int d, const void* buf, size_t nbytes) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int sched_get_priority_max_nid_postfix(int policy) {
|
||||
(void)policy;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
@@ -1619,6 +1541,4 @@ int64_t write_nid_postfix(int d, const char* str, int64_t size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "DirectMemory/Export.cpp"
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#pragma once
|
||||
#ifndef CORE_LIBS_PRX_LIBKERNEL_PTHREAD_PTHREAD_HPP
|
||||
#define CORE_LIBS_PRX_LIBKERNEL_PTHREAD_PTHREAD_HPP
|
||||
|
||||
#include <sched.h>
|
||||
#include "SceTypes.hpp"
|
||||
#include <atomic>
|
||||
@@ -55,3 +57,5 @@ struct PthreadPrivate {
|
||||
|
||||
PthreadPrivate() : _finished(false), _retval(nullptr), _detached(false) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user