mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-14 08:12:16 +00:00
kernel: macos/linux Implement sceKernelUuidCreate (#2923)
* kernel: macos/linux Implement sceKernelUuidCreate * Fix clang-format * Fix Linux build * Fix Linux build (2) --------- Co-authored-by: squidbus <175574877+squidbus@users.noreply.github.com>
This commit is contained in:
parent
6bbb424c28
commit
2a3a701115
2 changed files with 20 additions and 4 deletions
|
@ -1094,9 +1094,13 @@ if (ENABLE_DISCORD_RPC)
|
||||||
target_compile_definitions(shadps4 PRIVATE ENABLE_DISCORD_RPC)
|
target_compile_definitions(shadps4 PRIVATE ENABLE_DISCORD_RPC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Optional due to https://github.com/shadps4-emu/shadPS4/issues/1704
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ENABLE_USERFAULTFD)
|
# Optional due to https://github.com/shadps4-emu/shadPS4/issues/1704
|
||||||
target_compile_definitions(shadps4 PRIVATE ENABLE_USERFAULTFD)
|
if (ENABLE_USERFAULTFD)
|
||||||
|
target_compile_definitions(shadps4 PRIVATE ENABLE_USERFAULTFD)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(shadps4 PRIVATE uuid)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
#include <Rpc.h>
|
#include <Rpc.h>
|
||||||
|
#else
|
||||||
|
#include <uuid/uuid.h>
|
||||||
#endif
|
#endif
|
||||||
#include <common/singleton.h>
|
#include <common/singleton.h>
|
||||||
#include "aio.h"
|
#include "aio.h"
|
||||||
|
@ -164,7 +166,17 @@ int PS4_SYSV_ABI sceKernelUuidCreate(OrbisKernelUuid* orbisUuid) {
|
||||||
orbisUuid->node[i] = uuid.Data4[2 + i];
|
orbisUuid->node[i] = uuid.Data4[2 + i];
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
LOG_ERROR(Kernel, "sceKernelUuidCreate: Add linux");
|
uuid_t uuid;
|
||||||
|
uuid_generate(uuid);
|
||||||
|
orbisUuid->timeLow =
|
||||||
|
((u32)uuid[0] << 24) | ((u32)uuid[1] << 16) | ((u32)uuid[2] << 8) | (u32)uuid[3];
|
||||||
|
orbisUuid->timeMid = ((u16)uuid[4] << 8) | uuid[5];
|
||||||
|
orbisUuid->timeHiAndVersion = ((u16)uuid[6] << 8) | uuid[7];
|
||||||
|
orbisUuid->clockSeqHiAndReserved = uuid[8];
|
||||||
|
orbisUuid->clockSeqLow = uuid[9];
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
|
orbisUuid->node[i] = uuid[10 + i];
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue