mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
feat(razor): implement the libSceRazorCpu CPU profiler stubs
libSceRazorCpu is the CPU-side instrumentation for the Razor capture tool. AnyPS5 does not host that tool, so the instrumentation does nothing and succeeds, which is also what shadPS4 does: - sceRazorCpuIsCapturing -> 0 (no capture is in progress, so titles skip their profiling paths) - sceRazorCpuJobManagerDispatch / sceRazorCpuJobManagerJob / sceRazorCpuJobManagerSequence -> 0 These only feed the profiler; they do not affect execution. Adds a CMakeLists.txt so the library can carry its guest test. New test core/libs/tests/GuestRazorCpu.cpp checks the four return values; it fails on main (the functions throw) and passes with the change.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
add_library(libSceRazorCpu SHARED EXCLUDE_FROM_ALL Export.cpp)
|
||||
target_include_directories(libSceRazorCpu PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
configure_windows_unwind(libSceRazorCpu)
|
||||
|
||||
if(MINGW)
|
||||
foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static)
|
||||
string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_test_executable(guest_razor_cpu_tests ${LIBS_INCLUDE_DIR}/tests/GuestRazorCpu.cpp)
|
||||
target_include_directories(guest_razor_cpu_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(guest_razor_cpu_tests PRIVATE libSceRazorCpu)
|
||||
add_test(NAME guest_razor_cpu COMMAND guest_razor_cpu_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_razor_cpu PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceRazorCpu>")
|
||||
endif()
|
||||
endif()
|
||||
@@ -6,25 +6,21 @@
|
||||
extern "C" {
|
||||
|
||||
uint32_t APS5_VABI sceRazorCpuIsCapturing(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceRazorCpuJobManagerDispatch(const void* args) {
|
||||
(void)args;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceRazorCpuJobManagerJob(const void* args) {
|
||||
(void)args;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceRazorCpuJobManagerSequence(const void* args) {
|
||||
(void)args;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "prx/libc/include/general/VabiMacros.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
extern "C" {
|
||||
std::uint32_t APS5_VABI sceRazorCpuIsCapturing(void);
|
||||
int APS5_VABI sceRazorCpuJobManagerDispatch(const void* args);
|
||||
int APS5_VABI sceRazorCpuJobManagerJob(const void* args);
|
||||
int APS5_VABI sceRazorCpuJobManagerSequence(const void* args);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
void Require(bool value) { if (!value) std::abort(); }
|
||||
|
||||
}
|
||||
|
||||
int main() {
|
||||
Require(sceRazorCpuIsCapturing() == 0);
|
||||
Require(sceRazorCpuJobManagerDispatch(nullptr) == 0);
|
||||
Require(sceRazorCpuJobManagerJob(nullptr) == 0);
|
||||
Require(sceRazorCpuJobManagerSequence(nullptr) == 0);
|
||||
}
|
||||
Reference in New Issue
Block a user