mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-30 23:33:17 +00:00
chore: Make shadps4 REUSE compliant
This commit is contained in:
parent
6f4c6ae0bb
commit
584b7d2b15
124 changed files with 659 additions and 1891 deletions
|
@ -1,8 +1,10 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <atomic>
|
||||
#include <xxh3.h>
|
||||
#include "gpu_memory.h"
|
||||
|
||||
#include "common/singleton.h"
|
||||
#include "core/PS4/GPU/gpu_memory.h"
|
||||
|
||||
void* GPU::memoryCreateObj(u64 submit_id, HLE::Libs::Graphics::GraphicCtx* ctx,
|
||||
void* todo /*CommandBuffer?*/, u64 virtual_addr, u64 size,
|
||||
|
@ -24,7 +26,7 @@ void GPU::memorySetAllocArea(u64 virtual_addr, u64 size) {
|
|||
gpumemory->m_heaps.push_back(h);
|
||||
}
|
||||
|
||||
u64 GPU::calculate_hash(const u08* buf, u64 size) {
|
||||
u64 GPU::calculate_hash(const u8* buf, u64 size) {
|
||||
return (size > 0 && buf != nullptr ? XXH3_64bits(buf, size) : 0);
|
||||
}
|
||||
|
||||
|
@ -108,7 +110,7 @@ void* GPU::GPUMemory::memoryCreateObj(u64 submit_id, HLE::Libs::Graphics::Graphi
|
|||
for (int h = 0; h < virtual_addr_num; h++) {
|
||||
if (info.check_hash) {
|
||||
objInfo.hash[h] =
|
||||
GPU::calculate_hash(reinterpret_cast<const u08*>(virtual_addr[h]), size[h]);
|
||||
GPU::calculate_hash(reinterpret_cast<const u8*>(virtual_addr[h]), size[h]);
|
||||
} else {
|
||||
objInfo.hash[h] = 0;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
#include <core/PS4/HLE/Graphics/graphics_ctx.h>
|
||||
#include "common/types.h"
|
||||
#include "core/PS4/HLE/Graphics/graphics_ctx.h"
|
||||
|
||||
namespace GPU {
|
||||
|
||||
|
@ -84,8 +87,8 @@ void memorySetAllocArea(u64 virtual_addr, u64 size);
|
|||
void* memoryCreateObj(u64 submit_id, HLE::Libs::Graphics::GraphicCtx* ctx,
|
||||
/*CommandBuffer* buffer*/ void* todo, u64 virtual_addr, u64 size,
|
||||
const GPUObject& info);
|
||||
u64 calculate_hash(const u08* buf, u64 size);
|
||||
u64 calculate_hash(const u8* buf, u64 size);
|
||||
bool vulkanAllocateMemory(HLE::Libs::Graphics::GraphicCtx* ctx,
|
||||
HLE::Libs::Graphics::VulkanMemory* mem);
|
||||
void flushGarlic(HLE::Libs::Graphics::GraphicCtx* ctx);
|
||||
} // namespace GPU
|
||||
} // namespace GPU
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <mutex>
|
||||
#include "common/singleton.h"
|
||||
#include "tile_manager.h"
|
||||
#include "core/PS4/GPU/tile_manager.h"
|
||||
|
||||
namespace GPU {
|
||||
|
||||
|
@ -160,15 +163,15 @@ void convertTileToLinear(void* dst, const void* src, u32 width, u32 height, bool
|
|||
for (; x + 1 < width; x += 2) {
|
||||
auto tiled_offset = t.getTiledOffs(x, y, is_neo);
|
||||
|
||||
*reinterpret_cast<u64*>(static_cast<u08*>(dst) + linear_offset) =
|
||||
*reinterpret_cast<const u64*>(static_cast<const u08*>(src) + tiled_offset);
|
||||
*reinterpret_cast<u64*>(static_cast<u8*>(dst) + linear_offset) =
|
||||
*reinterpret_cast<const u64*>(static_cast<const u8*>(src) + tiled_offset);
|
||||
linear_offset += 8;
|
||||
}
|
||||
if (x < width) {
|
||||
auto tiled_offset = t.getTiledOffs(x, y, is_neo);
|
||||
|
||||
*reinterpret_cast<u32*>(static_cast<u08*>(dst) + linear_offset) =
|
||||
*reinterpret_cast<const u32*>(static_cast<const u08*>(src) + tiled_offset);
|
||||
*reinterpret_cast<u32*>(static_cast<u8*>(dst) + linear_offset) =
|
||||
*reinterpret_cast<const u32*>(static_cast<const u8*>(src) + tiled_offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
@ -5,4 +8,5 @@
|
|||
namespace GPU {
|
||||
|
||||
void convertTileToLinear(void* dst, const void* src, u32 width, u32 height, bool neo);
|
||||
}
|
||||
|
||||
} // namespace GPU
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#include "video_out_buffer.h"
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/log.h"
|
||||
|
||||
#include <vulkan_util.h>
|
||||
#include "common/debug.h"
|
||||
#include "tile_manager.h"
|
||||
#include "common/log.h"
|
||||
#include "core/PS4/GPU/tile_manager.h"
|
||||
#include "core/PS4/GPU/video_out_buffer.h"
|
||||
#include "vulkan_util.h"
|
||||
|
||||
constexpr bool log_file_videoOutBuffer = true; // disable it to disable logging
|
||||
|
||||
|
@ -22,7 +23,7 @@ static void update_func(HLE::Libs::Graphics::GraphicCtx* ctx, const u64* params,
|
|||
vk_obj->layout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
|
||||
if (tiled) {
|
||||
std::vector<u08> tempbuff(*size);
|
||||
std::vector<u8> tempbuff(*size);
|
||||
GPU::convertTileToLinear(tempbuff.data(), reinterpret_cast<void*>(*virtual_addr), width,
|
||||
height, neo);
|
||||
Graphics::Vulkan::vulkanFillImage(
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
#include "gpu_memory.h"
|
||||
#include "core/PS4/GPU/gpu_memory.h"
|
||||
|
||||
namespace GPU {
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "core/PS4/HLE/Graphics/Objects/video_out_ctx.h"
|
||||
#include "core/hle/libraries/libkernel/time_management.h"
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <core/PS4/HLE/Graphics/graphics_ctx.h>
|
||||
#include <core/PS4/HLE/Graphics/video_out.h>
|
||||
#include <emulator.h>
|
||||
#include "core/PS4/HLE/Graphics/graphics_ctx.h"
|
||||
#include "core/PS4/HLE/Graphics/video_out.h"
|
||||
#include "emulator.h"
|
||||
|
||||
using namespace HLE::Libs::Graphics::VideoOut;
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include "common/singleton.h"
|
||||
#include "core/PS4/HLE/Graphics/graphics_render.h"
|
||||
#include "emulator.h"
|
||||
#include "graphics_render.h"
|
||||
|
||||
static thread_local GPU::CommandPool g_command_pool;
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include "graphics_ctx.h"
|
||||
#include "core/PS4/HLE/Graphics/graphics_ctx.h"
|
||||
|
||||
namespace GPU {
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <magic_enum.hpp>
|
||||
|
@ -8,6 +11,7 @@
|
|||
#include "common/singleton.h"
|
||||
#include "core/PS4/GPU/gpu_memory.h"
|
||||
#include "core/PS4/GPU/video_out_buffer.h"
|
||||
#include "core/PS4/HLE/Graphics/graphics_render.h"
|
||||
#include "core/PS4/HLE/Graphics/video_out.h"
|
||||
#include "core/hle/error_codes.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
|
@ -15,7 +19,6 @@
|
|||
#include "core/hle/libraries/libuserservice/usr_mng_codes.h"
|
||||
#include "core/loader/symbols_resolver.h"
|
||||
#include "emulator.h"
|
||||
#include "graphics_render.h"
|
||||
|
||||
namespace HLE::Libs::Graphics::VideoOut {
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -92,8 +95,8 @@ struct SceVideoOutVblankStatus {
|
|||
u64 processTime = 0;
|
||||
u64 tsc = 0;
|
||||
u64 reserved[1] = {0};
|
||||
u08 flags = 0;
|
||||
u08 pad1[7] = {};
|
||||
u8 flags = 0;
|
||||
u8 pad1[7] = {};
|
||||
};
|
||||
|
||||
struct VideoOutBufferSetInternal {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <cstring>
|
||||
#include "common/types.h"
|
||||
#include "core/aerolib/aerolib.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// generated using ps4_names2stubs.py
|
||||
|
||||
STUB("++DO8Y1JaYU", sceAvSettingDebugSetProcessAttribute)
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/log.h"
|
||||
#include "core/aerolib/aerolib.h"
|
||||
#include "core/aerolib/stubs.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "fs.h"
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <algorithm>
|
||||
#include "core/file_sys/fs.h"
|
||||
|
||||
namespace Core::FileSys {
|
||||
|
||||
|
@ -88,4 +90,4 @@ File* HandleTable::getFile(const std::string& host_name) {
|
|||
}
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace Core::FileSys
|
||||
} // namespace Core::FileSys
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <common/io_file.h>
|
||||
#include "common/fs_file.h"
|
||||
#include "common/io_file.h"
|
||||
|
||||
namespace Core::FileSys {
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
// posix error codes
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "core/hle/kernel/Objects/event_queue.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <condition_variable>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/kernel/Objects/physical_memory.h"
|
||||
|
||||
namespace Core::Kernel {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
|
||||
#include "common/types.h"
|
||||
#include "core/PS4/GPU/gpu_memory.h"
|
||||
#include "core/virtual_memory.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "Util/config.h"
|
||||
#include "common/log.h"
|
||||
#include "core/hle/kernel/cpu_management.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "core/hle/error_codes.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/kernel/Objects/event_queue.h"
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <bit>
|
||||
#include <core/PS4/GPU/gpu_memory.h>
|
||||
#include <core/virtual_memory.h>
|
||||
#include <magic_enum.hpp>
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/singleton.h"
|
||||
#include "core/PS4/GPU/gpu_memory.h"
|
||||
#include "core/hle/error_codes.h"
|
||||
#include "core/hle/kernel/Objects/physical_memory.h"
|
||||
#include "core/hle/kernel/memory_management.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
#include "core/virtual_memory.h"
|
||||
|
||||
namespace Core::Kernel {
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <cstdlib>
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Core::Loader {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#include "libc_cxa.h"
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "core/hle/libraries/libc/libc_cxa.h"
|
||||
|
||||
// adapted from
|
||||
// https://opensource.apple.com/source/libcppabi/libcppabi-14/src/cxa_guard.cxx.auto.html
|
||||
|
@ -57,23 +59,23 @@ __attribute__((noinline)) static pthread_mutex_t* guard_mutex() {
|
|||
|
||||
// helper functions for getting/setting flags in guard_object
|
||||
static bool initializerHasRun(u64* guard_object) {
|
||||
return (*((u08*)guard_object) != 0);
|
||||
return (*((u8*)guard_object) != 0);
|
||||
}
|
||||
|
||||
static void setInitializerHasRun(u64* guard_object) {
|
||||
*((u08*)guard_object) = 1;
|
||||
*((u8*)guard_object) = 1;
|
||||
}
|
||||
|
||||
static bool inUse(u64* guard_object) {
|
||||
return (((u08*)guard_object)[1] != 0);
|
||||
return (((u8*)guard_object)[1] != 0);
|
||||
}
|
||||
|
||||
static void setInUse(u64* guard_object) {
|
||||
((u08*)guard_object)[1] = 1;
|
||||
((u8*)guard_object)[1] = 1;
|
||||
}
|
||||
|
||||
static void setNotInUse(u64* guard_object) {
|
||||
((u08*)guard_object)[1] = 0;
|
||||
((u8*)guard_object)[1] = 0;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
#define _TIMESPEC_DEFINED
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <cmath>
|
||||
#include "core/hle/libraries/libc/libc_math.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "core/hle/libraries/libc/libc_stdio.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <cstdlib>
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <cstring>
|
||||
#include "core/hle/libraries/libc/libc_string.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2014-2018 Marco Paland (info@paland.com)
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// \author (c) Marco Paland (info@paland.com)
|
||||
// 2014-2018, PALANDesign Hannover, Germany
|
||||
|
@ -609,7 +612,7 @@ static inline int _vsnprintf(out_fct_type out, char* buffer, const char* format,
|
|||
// (unsigned short int)va.next<unsigned int>(cpu, mem) : va.next<unsigned
|
||||
// int>(cpu, mem);
|
||||
const unsigned int value =
|
||||
(flags & FLAGS_CHAR) ? static_cast<u08>(vaArgInteger(va_list))
|
||||
(flags & FLAGS_CHAR) ? static_cast<u8>(vaArgInteger(va_list))
|
||||
: (flags & FLAGS_SHORT) ? static_cast<u16>(vaArgInteger(va_list))
|
||||
: static_cast<u32>(vaArgInteger(va_list));
|
||||
idx = _ntoa_long(out, buffer, idx, maxlen, value, false, base, precision, width,
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <xmmintrin.h>
|
||||
#include "common/types.h"
|
||||
|
||||
|
@ -50,7 +53,7 @@ struct VaCtx {
|
|||
|
||||
template <class T, uint32_t Size>
|
||||
T vaArgRegSaveAreaGp(VaList* l) {
|
||||
auto* addr = reinterpret_cast<T*>(static_cast<u08*>(l->reg_save_area) + l->gp_offset);
|
||||
auto* addr = reinterpret_cast<T*>(static_cast<u8*>(l->reg_save_area) + l->gp_offset);
|
||||
l->gp_offset += Size;
|
||||
return *addr;
|
||||
}
|
||||
|
@ -64,7 +67,7 @@ T vaArgOverflowArgArea(VaList* l) {
|
|||
|
||||
template <class T, uint32_t Size>
|
||||
T vaArgRegSaveAreaFp(VaList* l) {
|
||||
auto* addr = reinterpret_cast<T*>(static_cast<u08*>(l->reg_save_area) + l->fp_offset);
|
||||
auto* addr = reinterpret_cast<T*>(static_cast<u8*>(l->reg_save_area) + l->fp_offset);
|
||||
l->fp_offset += Size;
|
||||
return *addr;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
#include <common/singleton.h>
|
||||
#include <core/file_sys/fs.h>
|
||||
#include <core/hle/error_codes.h>
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/singleton.h"
|
||||
#include "core/file_sys/fs.h"
|
||||
#include "core/hle/error_codes.h"
|
||||
#include "core/hle/libraries/libkernel/file_system.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "core/hle/libraries/libkernel/libkernel.h"
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
|
@ -8,6 +9,8 @@
|
|||
#include "core/hle/kernel/event_queues.h"
|
||||
#include "core/hle/kernel/memory_management.h"
|
||||
#include "core/hle/libraries/libkernel/file_system.h"
|
||||
#include "core/hle/libraries/libkernel/libkernel.h"
|
||||
#include "core/hle/libraries/libkernel/thread_management.h"
|
||||
#include "core/hle/libraries/libkernel/time_management.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
#include "core/loader/elf.h"
|
||||
|
@ -18,7 +21,6 @@
|
|||
#else
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
#include "thread_management.h"
|
||||
|
||||
namespace Core::Libraries::LibKernel {
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
namespace Core::Loader {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#include "core/hle/libraries/libkernel/thread_management.h"
|
||||
|
||||
#include <core/hle/libraries/libs.h>
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "core/hle/error_codes.h"
|
||||
#include "core/hle/libraries/libkernel/thread_management.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
|
||||
namespace Core::Libraries::LibKernel {
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
#define _TIMESPEC_DEFINED
|
||||
|
||||
#include <string>
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
namespace Core::Loader {
|
||||
|
@ -32,14 +34,14 @@ using ScePthreadCondattr = PthreadCondAttrInternal*;
|
|||
using pthreadEntryFunc = PS4_SYSV_ABI void* (*)(void*);
|
||||
|
||||
struct PthreadInternal {
|
||||
u08 reserved[4096];
|
||||
u8 reserved[4096];
|
||||
std::string name;
|
||||
pthread_t pth;
|
||||
ScePthreadAttr attr;
|
||||
};
|
||||
|
||||
struct PthreadAttrInternal {
|
||||
u08 reserved[64];
|
||||
u8 reserved[64];
|
||||
u64 affinity;
|
||||
size_t guard_size;
|
||||
int policy;
|
||||
|
@ -48,25 +50,25 @@ struct PthreadAttrInternal {
|
|||
};
|
||||
|
||||
struct PthreadMutexInternal {
|
||||
u08 reserved[256];
|
||||
u8 reserved[256];
|
||||
std::string name;
|
||||
pthread_mutex_t pth_mutex;
|
||||
};
|
||||
|
||||
struct PthreadMutexattrInternal {
|
||||
u08 reserved[64];
|
||||
u8 reserved[64];
|
||||
pthread_mutexattr_t pth_mutex_attr;
|
||||
int pprotocol;
|
||||
};
|
||||
|
||||
struct PthreadCondInternal {
|
||||
u08 reserved[256];
|
||||
u8 reserved[256];
|
||||
std::string name;
|
||||
pthread_cond_t cond;
|
||||
};
|
||||
|
||||
struct PthreadCondAttrInternal {
|
||||
u08 reserved[64];
|
||||
u8 reserved[64];
|
||||
pthread_condattr_t cond_attr;
|
||||
};
|
||||
|
||||
|
@ -132,4 +134,4 @@ int PS4_SYSV_ABI posix_pthread_mutex_unlock(ScePthreadMutex* mutex);
|
|||
int PS4_SYSV_ABI posix_pthread_cond_broadcast(ScePthreadCond* cond);
|
||||
|
||||
void pthreadSymbolsRegister(Loader::SymbolsResolver* sym);
|
||||
} // namespace Core::Libraries::LibKernel
|
||||
} // namespace Core::Libraries::LibKernel
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/native_clock.h"
|
||||
#include "core/hle/libraries/libkernel/time_management.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "Emulator/Host/controller.h"
|
||||
#include "common/log.h"
|
||||
#include "common/singleton.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
@ -26,17 +29,17 @@ enum ScePadButton : u32 {
|
|||
};
|
||||
|
||||
struct ScePadOpenParam {
|
||||
u08 reserve[8];
|
||||
u8 reserve[8];
|
||||
};
|
||||
|
||||
struct ScePadAnalogStick {
|
||||
u08 x;
|
||||
u08 y;
|
||||
u8 x;
|
||||
u8 y;
|
||||
};
|
||||
struct ScePadAnalogButtons {
|
||||
u08 l2;
|
||||
u08 r2;
|
||||
u08 padding[2];
|
||||
u8 l2;
|
||||
u8 r2;
|
||||
u8 padding[2];
|
||||
};
|
||||
|
||||
struct SceFQuaternion {
|
||||
|
@ -50,24 +53,24 @@ struct SceFVector3 {
|
|||
struct ScePadTouch {
|
||||
u16 x;
|
||||
u16 y;
|
||||
u08 id;
|
||||
u08 reserve[3];
|
||||
u8 id;
|
||||
u8 reserve[3];
|
||||
};
|
||||
|
||||
constexpr int SCE_PAD_MAX_TOUCH_NUM = 2;
|
||||
|
||||
typedef struct ScePadTouchData {
|
||||
u08 touchNum;
|
||||
u08 reserve[3];
|
||||
u8 touchNum;
|
||||
u8 reserve[3];
|
||||
u32 reserve1;
|
||||
ScePadTouch touch[SCE_PAD_MAX_TOUCH_NUM];
|
||||
} ScePadTouchData;
|
||||
|
||||
struct ScePadExtensionUnitData {
|
||||
u32 extensionUnitId;
|
||||
u08 reserve[1];
|
||||
u08 dataLength;
|
||||
u08 data[10];
|
||||
u8 reserve[1];
|
||||
u8 dataLength;
|
||||
u8 data[10];
|
||||
};
|
||||
|
||||
struct ScePadData {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/PS4/HLE/Graphics/video_out.h"
|
||||
#include "core/hle/libraries/libc/libc.h"
|
||||
#include "core/hle/libraries/libkernel/libkernel.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/loader/elf.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/log.h"
|
||||
#include "core/PS4/GPU/gpu_memory.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#include "core/hle/libraries/libsystemservice/system_service.h"
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/log.h"
|
||||
#include "core/hle/error_codes.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
#include "core/hle/libraries/libsystemservice/system_service.h"
|
||||
|
||||
namespace Core::Libraries::LibSystemService {
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
@ -15,7 +18,7 @@ struct SceSystemServiceStatus {
|
|||
bool isCpuMode7CpuNormal;
|
||||
bool isGameLiveStreamingOnAir;
|
||||
bool isOutOfVrPlayArea;
|
||||
u08 reserved[];
|
||||
u8 reserved[];
|
||||
};
|
||||
|
||||
s32 PS4_SYSV_ABI sceSystemServiceHideSplashScreen();
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/log.h"
|
||||
#include "core/hle/error_codes.h"
|
||||
#include "core/hle/libraries/libs.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
// constants
|
||||
|
||||
constexpr int SCE_USER_SERVICE_MAX_LOGIN_USERS = 4; // max users logged in at once
|
||||
constexpr int SCE_USER_SERVICE_MAX_LOGIN_USERS = 4; // Max users logged in at once
|
||||
constexpr int SCE_USER_SERVICE_MAX_USER_NAME_LENGTH = 16; // Max length for user name
|
||||
|
||||
constexpr int SCE_USER_SERVICE_USER_ID_INVALID = -1; // invalid user ID
|
||||
constexpr int SCE_USER_SERVICE_USER_ID_SYSTEM = 255; // generic id for device
|
||||
constexpr int SCE_USER_SERVICE_USER_ID_INVALID = -1; // Invalid user ID
|
||||
constexpr int SCE_USER_SERVICE_USER_ID_SYSTEM = 255; // Generic id for device
|
||||
constexpr int SCE_USER_SERVICE_USER_ID_EVERYONE =
|
||||
254; // generic id for user (mostly used in common dialogs)
|
||||
254; // Generic id for user (mostly used in common dialogs)
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <Zydis/Zydis.h>
|
||||
#include <fmt/core.h>
|
||||
#include "common/log.h"
|
||||
|
@ -531,7 +534,7 @@ static void relocate(u32 idx, elf_relocation* rel, Module* m, bool isJmpRel) {
|
|||
u64 rel_base_virtual_addr = m->base_virtual_addr;
|
||||
u64 rel_virtual_addr = m->base_virtual_addr + rel->rel_offset;
|
||||
bool rel_isResolved = false;
|
||||
u08 rel_sym_type = 0;
|
||||
u8 rel_sym_type = 0;
|
||||
std::string rel_name;
|
||||
|
||||
switch (type) {
|
||||
|
@ -605,16 +608,15 @@ static void relocate(u32 idx, elf_relocation* rel, Module* m, bool isJmpRel) {
|
|||
void Linker::Relocate(Module* m) {
|
||||
u32 idx = 0;
|
||||
for (auto* rel = m->dynamic_info.relocation_table;
|
||||
reinterpret_cast<u08*>(rel) < reinterpret_cast<u08*>(m->dynamic_info.relocation_table) +
|
||||
m->dynamic_info.relocation_table_size;
|
||||
reinterpret_cast<u8*>(rel) < reinterpret_cast<u8*>(m->dynamic_info.relocation_table) +
|
||||
m->dynamic_info.relocation_table_size;
|
||||
rel++, idx++) {
|
||||
relocate(idx, rel, m, false);
|
||||
}
|
||||
idx = 0;
|
||||
for (auto* rel = m->dynamic_info.jmp_relocation_table;
|
||||
reinterpret_cast<u08*>(rel) <
|
||||
reinterpret_cast<u08*>(m->dynamic_info.jmp_relocation_table) +
|
||||
m->dynamic_info.jmp_relocation_table_size;
|
||||
reinterpret_cast<u8*>(rel) < reinterpret_cast<u8*>(m->dynamic_info.jmp_relocation_table) +
|
||||
m->dynamic_info.jmp_relocation_table_size;
|
||||
rel++, idx++) {
|
||||
relocate(idx, rel, m, true);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
|
@ -22,8 +25,8 @@ struct ModuleInfo {
|
|||
u64 value;
|
||||
struct {
|
||||
u32 name_offset;
|
||||
u08 version_minor;
|
||||
u08 version_major;
|
||||
u8 version_minor;
|
||||
u8 version_major;
|
||||
u16 id;
|
||||
};
|
||||
};
|
||||
|
@ -98,8 +101,8 @@ struct Module {
|
|||
|
||||
Linker* linker = nullptr;
|
||||
|
||||
std::vector<u08> m_dynamic;
|
||||
std::vector<u08> m_dynamic_data;
|
||||
std::vector<u8> m_dynamic;
|
||||
std::vector<u8> m_dynamic_data;
|
||||
DynamicModuleInfo dynamic_info{};
|
||||
|
||||
Loader::SymbolsResolver export_sym;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cinttypes>
|
||||
|
@ -12,12 +15,12 @@ struct self_header {
|
|||
static const u32 signature = 0x1D3D154Fu;
|
||||
|
||||
u32 magic;
|
||||
u08 version;
|
||||
u08 mode;
|
||||
u08 endian; // 1 is little endian
|
||||
u08 attributes;
|
||||
u08 category;
|
||||
u08 program_type;
|
||||
u8 version;
|
||||
u8 mode;
|
||||
u8 endian; // 1 is little endian
|
||||
u8 attributes;
|
||||
u8 category;
|
||||
u8 program_type;
|
||||
u16 padding1;
|
||||
u16 header_size;
|
||||
u16 meta_size;
|
||||
|
@ -59,21 +62,21 @@ struct self_segment_header {
|
|||
u64 memory_size;
|
||||
};
|
||||
|
||||
constexpr u08 EI_MAG0 = 0; /* e_ident[] indexes */
|
||||
constexpr u08 EI_MAG1 = 1;
|
||||
constexpr u08 EI_MAG2 = 2;
|
||||
constexpr u08 EI_MAG3 = 3;
|
||||
constexpr u08 EI_CLASS = 4;
|
||||
constexpr u08 EI_DATA = 5;
|
||||
constexpr u08 EI_VERSION = 6;
|
||||
constexpr u08 EI_OSABI = 7;
|
||||
constexpr u08 EI_ABIVERSION = 8;
|
||||
constexpr u8 EI_MAG0 = 0; /* e_ident[] indexes */
|
||||
constexpr u8 EI_MAG1 = 1;
|
||||
constexpr u8 EI_MAG2 = 2;
|
||||
constexpr u8 EI_MAG3 = 3;
|
||||
constexpr u8 EI_CLASS = 4;
|
||||
constexpr u8 EI_DATA = 5;
|
||||
constexpr u8 EI_VERSION = 6;
|
||||
constexpr u8 EI_OSABI = 7;
|
||||
constexpr u8 EI_ABIVERSION = 8;
|
||||
|
||||
// Magic number
|
||||
constexpr u08 ELFMAG0 = 0x7F;
|
||||
constexpr u08 ELFMAG1 = 'E';
|
||||
constexpr u08 ELFMAG2 = 'L';
|
||||
constexpr u08 ELFMAG3 = 'F';
|
||||
constexpr u8 ELFMAG0 = 0x7F;
|
||||
constexpr u8 ELFMAG1 = 'E';
|
||||
constexpr u8 ELFMAG2 = 'L';
|
||||
constexpr u8 ELFMAG3 = 'F';
|
||||
|
||||
typedef enum : u16 {
|
||||
ET_NONE = 0x0,
|
||||
|
@ -183,27 +186,27 @@ typedef enum : u16 {
|
|||
|
||||
typedef enum : u32 { EV_NONE = 0x0, EV_CURRENT = 0x1 } e_version_es;
|
||||
|
||||
typedef enum : u08 {
|
||||
typedef enum : u8 {
|
||||
ELF_CLASS_NONE = 0x0,
|
||||
ELF_CLASS_32 = 0x1,
|
||||
ELF_CLASS_64 = 0x2,
|
||||
ELF_CLASS_NUM = 0x3
|
||||
} ident_class_es;
|
||||
|
||||
typedef enum : u08 {
|
||||
typedef enum : u8 {
|
||||
ELF_DATA_NONE = 0x0,
|
||||
ELF_DATA_2LSB = 0x1,
|
||||
ELF_DATA_2MSB = 0x2,
|
||||
ELF_DATA_NUM = 0x3
|
||||
} ident_endian_es;
|
||||
|
||||
typedef enum : u08 {
|
||||
typedef enum : u8 {
|
||||
ELF_VERSION_NONE = 0x0,
|
||||
ELF_VERSION_CURRENT = 0x1,
|
||||
ELF_VERSION_NUM = 0x2
|
||||
} ident_version_es;
|
||||
|
||||
typedef enum : u08 {
|
||||
typedef enum : u8 {
|
||||
ELF_OSABI_NONE = 0x0, /* No extensions or unspecified */
|
||||
ELF_OSABI_HPUX = 0x1, /* Hewlett-Packard HP-UX */
|
||||
ELF_OSABI_NETBSD = 0x2, /* NetBSD */
|
||||
|
@ -223,7 +226,7 @@ typedef enum : u08 {
|
|||
ELF_OSABI_STANDALONE = 0xFF /* Standalone (embedded applications) */
|
||||
} ident_osabi_es;
|
||||
|
||||
typedef enum : u08 {
|
||||
typedef enum : u8 {
|
||||
ELF_ABI_VERSION_AMDGPU_HSA_V2 = 0x0,
|
||||
ELF_ABI_VERSION_AMDGPU_HSA_V3 = 0x1,
|
||||
ELF_ABI_VERSION_AMDGPU_HSA_V4 = 0x2,
|
||||
|
@ -231,13 +234,13 @@ typedef enum : u08 {
|
|||
} ident_abiversion_es;
|
||||
|
||||
struct elf_ident {
|
||||
u08 magic[4];
|
||||
u8 magic[4];
|
||||
ident_class_es ei_class;
|
||||
ident_endian_es ei_data;
|
||||
ident_version_es ei_version;
|
||||
ident_osabi_es ei_osabi;
|
||||
ident_abiversion_es ei_abiversion;
|
||||
u08 pad[6];
|
||||
u8 pad[6];
|
||||
};
|
||||
|
||||
struct elf_header {
|
||||
|
@ -339,7 +342,7 @@ struct elf_program_id_header {
|
|||
program_type_es program_type;
|
||||
u64 appver;
|
||||
u64 firmver;
|
||||
u08 digest[32];
|
||||
u8 digest[32];
|
||||
};
|
||||
|
||||
constexpr s64 DT_NULL = 0;
|
||||
|
@ -387,43 +390,43 @@ struct elf_dynamic {
|
|||
} d_un;
|
||||
};
|
||||
|
||||
constexpr u08 STB_LOCAL = 0;
|
||||
constexpr u08 STB_GLOBAL = 1;
|
||||
constexpr u08 STB_WEAK = 2;
|
||||
constexpr u8 STB_LOCAL = 0;
|
||||
constexpr u8 STB_GLOBAL = 1;
|
||||
constexpr u8 STB_WEAK = 2;
|
||||
|
||||
constexpr u08 STT_NOTYPE = 0;
|
||||
constexpr u08 STT_OBJECT = 1;
|
||||
constexpr u08 STT_FUN = 2;
|
||||
constexpr u08 STT_SECTION = 3;
|
||||
constexpr u08 STT_FILE = 4;
|
||||
constexpr u08 STT_COMMON = 5;
|
||||
constexpr u08 STT_TLS = 6;
|
||||
constexpr u08 STT_LOOS = 10;
|
||||
constexpr u08 STT_SCE = 11; // module_start/module_stop
|
||||
constexpr u08 STT_HIOS = 12;
|
||||
constexpr u08 STT_LOPRO = 13;
|
||||
constexpr u08 STT_SPARC_REGISTER = 13;
|
||||
constexpr u08 STT_HIPROC = 15;
|
||||
constexpr u8 STT_NOTYPE = 0;
|
||||
constexpr u8 STT_OBJECT = 1;
|
||||
constexpr u8 STT_FUN = 2;
|
||||
constexpr u8 STT_SECTION = 3;
|
||||
constexpr u8 STT_FILE = 4;
|
||||
constexpr u8 STT_COMMON = 5;
|
||||
constexpr u8 STT_TLS = 6;
|
||||
constexpr u8 STT_LOOS = 10;
|
||||
constexpr u8 STT_SCE = 11; // module_start/module_stop
|
||||
constexpr u8 STT_HIOS = 12;
|
||||
constexpr u8 STT_LOPRO = 13;
|
||||
constexpr u8 STT_SPARC_REGISTER = 13;
|
||||
constexpr u8 STT_HIPROC = 15;
|
||||
|
||||
constexpr u08 STV_DEFAULT = 0;
|
||||
constexpr u08 STV_INTERNAL = 1;
|
||||
constexpr u08 STV_HIDDEN = 2;
|
||||
constexpr u08 STV_PROTECTED = 3;
|
||||
constexpr u8 STV_DEFAULT = 0;
|
||||
constexpr u8 STV_INTERNAL = 1;
|
||||
constexpr u8 STV_HIDDEN = 2;
|
||||
constexpr u8 STV_PROTECTED = 3;
|
||||
|
||||
struct elf_symbol {
|
||||
u08 GetBind() const {
|
||||
u8 GetBind() const {
|
||||
return st_info >> 4u;
|
||||
}
|
||||
u08 GetType() const {
|
||||
u8 GetType() const {
|
||||
return st_info & 0xfu;
|
||||
}
|
||||
u08 GetVisibility() const {
|
||||
u8 GetVisibility() const {
|
||||
return st_other & 3u;
|
||||
}
|
||||
|
||||
u32 st_name;
|
||||
u08 st_info;
|
||||
u08 st_other;
|
||||
u8 st_info;
|
||||
u8 st_other;
|
||||
u16 st_shndx;
|
||||
u64 st_value;
|
||||
u64 st_size;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/log.h"
|
||||
#include "common/types.h"
|
||||
#include "core/loader/symbols_resolver.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -18,8 +21,8 @@ struct SymbolRes {
|
|||
std::string library;
|
||||
u16 library_version;
|
||||
std::string module;
|
||||
u08 module_version_major;
|
||||
u08 module_version_minor;
|
||||
u8 module_version_major;
|
||||
u8 module_version_minor;
|
||||
u32 type;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/virtual_memory.h"
|
||||
|
||||
#include "common/log.h"
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
constexpr u64 SYSTEM_RESERVED = 0x800000000u;
|
||||
|
@ -40,4 +44,4 @@ inline bool containsExecuteMode(MemoryMode mode) {
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace VirtualMemory
|
||||
} // namespace VirtualMemory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue