diff options
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | externals/CMakeLists.txt | 3 | ||||
m--------- | externals/SDL | 0 | ||||
-rw-r--r-- | src/core/hle/kernel/transfer_memory.cpp | 55 | ||||
-rw-r--r-- | src/core/hle/kernel/transfer_memory.h | 96 |
5 files changed, 6 insertions, 154 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 73274c2e0..c8e9ebf8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,7 +274,7 @@ if (ENABLE_SDL2) if (YUZU_USE_BUNDLED_SDL2) # Detect toolchain and platform if ((MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) AND ARCHITECTURE_x86_64) - set(SDL2_VER "SDL2-2.0.14") + set(SDL2_VER "SDL2-2.0.15-prerelease") else() message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable YUZU_USE_BUNDLED_SDL2 and provide your own.") endif() @@ -292,7 +292,7 @@ if (ENABLE_SDL2) target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") else() - find_package(SDL2 2.0.14 QUIET) + find_package(SDL2 2.0.15 QUIET) if (SDL2_FOUND) # Some installations don't set SDL2_LIBRARIES @@ -305,7 +305,7 @@ if (ENABLE_SDL2) add_library(SDL2 INTERFACE) target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") else() - message(STATUS "SDL2 2.0.14 or newer not found, falling back to externals.") + message(STATUS "SDL2 2.0.15 or newer not found, falling back to externals.") endif() endif() endif() diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index e044d9730..e280e53d7 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -47,7 +47,10 @@ target_include_directories(unicorn-headers INTERFACE ./unicorn/include) # SDL2 if (NOT SDL2_FOUND AND ENABLE_SDL2) + set(SDL_STATIC ON) + set(SDL_SHARED OFF) add_subdirectory(SDL EXCLUDE_FROM_ALL) + add_library(SDL2 ALIAS SDL2-static) endif() # SoundTouch diff --git a/externals/SDL b/externals/SDL -Subproject 4cd981609b50ed273d80c635c1ca4c1e5518fb2 +Subproject 107db2d89953ee7cc03417d43da1f26bd03aad5 diff --git a/src/core/hle/kernel/transfer_memory.cpp b/src/core/hle/kernel/transfer_memory.cpp deleted file mode 100644 index 1dd65468d..000000000 --- a/src/core/hle/kernel/transfer_memory.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "core/hle/kernel/k_page_table.h" -#include "core/hle/kernel/k_resource_limit.h" -#include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/process.h" -#include "core/hle/kernel/transfer_memory.h" -#include "core/hle/result.h" -#include "core/memory.h" - -namespace Kernel { - -TransferMemory::TransferMemory(KernelCore& kernel, Core::Memory::Memory& memory) - : Object{kernel}, memory{memory} {} - -TransferMemory::~TransferMemory() { - // Release memory region when transfer memory is destroyed - Reset(); - owner_process->GetResourceLimit()->Release(LimitableResource::TransferMemory, 1); -} - -std::shared_ptr<TransferMemory> TransferMemory::Create(KernelCore& kernel, - Core::Memory::Memory& memory, - VAddr base_address, std::size_t size, - KMemoryPermission permissions) { - std::shared_ptr<TransferMemory> transfer_memory{ - std::make_shared<TransferMemory>(kernel, memory)}; - - transfer_memory->base_address = base_address; - transfer_memory->size = size; - transfer_memory->owner_permissions = permissions; - transfer_memory->owner_process = kernel.CurrentProcess(); - - return transfer_memory; -} - -u8* TransferMemory::GetPointer() { - return memory.GetPointer(base_address); -} - -const u8* TransferMemory::GetPointer() const { - return memory.GetPointer(base_address); -} - -ResultCode TransferMemory::Reserve() { - return owner_process->PageTable().ReserveTransferMemory(base_address, size, owner_permissions); -} - -ResultCode TransferMemory::Reset() { - return owner_process->PageTable().ResetTransferMemory(base_address, size); -} - -} // namespace Kernel diff --git a/src/core/hle/kernel/transfer_memory.h b/src/core/hle/kernel/transfer_memory.h deleted file mode 100644 index 59328c0fe..000000000 --- a/src/core/hle/kernel/transfer_memory.h +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2019 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <memory> - -#include "core/hle/kernel/k_memory_block.h" -#include "core/hle/kernel/object.h" -#include "core/hle/kernel/physical_memory.h" - -union ResultCode; - -namespace Core::Memory { -class Memory; -} - -namespace Kernel { - -class KernelCore; -class Process; - -/// Defines the interface for transfer memory objects. -/// -/// Transfer memory is typically used for the purpose of -/// transferring memory between separate process instances, -/// thus the name. -/// -class TransferMemory final : public Object { -public: - explicit TransferMemory(KernelCore& kernel, Core::Memory::Memory& memory); - ~TransferMemory() override; - - static constexpr HandleType HANDLE_TYPE = HandleType::TransferMemory; - - static std::shared_ptr<TransferMemory> Create(KernelCore& kernel, Core::Memory::Memory& memory, - VAddr base_address, std::size_t size, - KMemoryPermission permissions); - - TransferMemory(const TransferMemory&) = delete; - TransferMemory& operator=(const TransferMemory&) = delete; - - TransferMemory(TransferMemory&&) = delete; - TransferMemory& operator=(TransferMemory&&) = delete; - - std::string GetTypeName() const override { - return "TransferMemory"; - } - - std::string GetName() const override { - return GetTypeName(); - } - - HandleType GetHandleType() const override { - return HANDLE_TYPE; - } - - /// Gets a pointer to the backing block of this instance. - u8* GetPointer(); - - /// Gets a pointer to the backing block of this instance. - const u8* GetPointer() const; - - /// Gets the size of the memory backing this instance in bytes. - constexpr std::size_t GetSize() const { - return size; - } - - /// Reserves the region to be used for the transfer memory, called after the transfer memory is - /// created. - ResultCode Reserve(); - - /// Resets the region previously used for the transfer memory, called after the transfer memory - /// is closed. - ResultCode Reset(); - - void Finalize() override {} - -private: - /// The base address for the memory managed by this instance. - VAddr base_address{}; - - /// Size of the memory, in bytes, that this instance manages. - std::size_t size{}; - - /// The memory permissions that are applied to this instance. - KMemoryPermission owner_permissions{}; - - /// The process that this transfer memory instance was created under. - Process* owner_process{}; - - Core::Memory::Memory& memory; -}; - -} // namespace Kernel |