From 232ef55c1a13552e5ba8b72d61d1d072f5851598 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 15 Dec 2016 19:01:48 -0500 Subject: core: Consolidate core and system state, remove system module & cleanups. --- src/core/hle/service/ldr_ro/ldr_ro.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index 9e5d6a318..614f16d44 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -457,7 +457,7 @@ static void LoadCRO(Interface* self, bool link_on_load_bug_fix) { } } - Core::g_app_core->ClearInstructionCache(); + Core::AppCore().ClearInstructionCache(); LOG_INFO(Service_LDR, "CRO \"%s\" loaded at 0x%08X, fixed_end=0x%08X", cro.ModuleName().data(), cro_address, cro_address + fix_size); @@ -562,7 +562,7 @@ static void UnloadCRO(Interface* self) { memory_synchronizer.RemoveMemoryBlock(cro_address, cro_buffer_ptr); } - Core::g_app_core->ClearInstructionCache(); + Core::AppCore().ClearInstructionCache(); cmd_buff[1] = result.raw; } @@ -624,7 +624,7 @@ static void LinkCRO(Interface* self) { } memory_synchronizer.SynchronizeOriginalMemory(); - Core::g_app_core->ClearInstructionCache(); + Core::AppCore().ClearInstructionCache(); cmd_buff[1] = result.raw; } @@ -686,7 +686,7 @@ static void UnlinkCRO(Interface* self) { } memory_synchronizer.SynchronizeOriginalMemory(); - Core::g_app_core->ClearInstructionCache(); + Core::AppCore().ClearInstructionCache(); cmd_buff[1] = result.raw; } -- cgit v1.2.3 From 4fc8b8229ed1d9ea9d20faee7059c898265db6cf Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 16 Dec 2016 00:37:38 -0500 Subject: core: Remove HLE module, consolidate code & various cleanups. --- src/core/hle/service/csnd_snd.cpp | 1 - src/core/hle/service/fs/archive.cpp | 5 +---- src/core/hle/service/fs/archive.h | 4 ++-- src/core/hle/service/ir/ir.cpp | 3 ++- src/core/hle/service/mic_u.cpp | 3 ++- 5 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/core/hle/service/csnd_snd.cpp b/src/core/hle/service/csnd_snd.cpp index 6544e89a2..25392f3cf 100644 --- a/src/core/hle/service/csnd_snd.cpp +++ b/src/core/hle/service/csnd_snd.cpp @@ -4,7 +4,6 @@ #include #include "common/alignment.h" -#include "core/hle/hle.h" #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/service/csnd_snd.h" diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 09205e4b2..6cddc1fdb 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -23,7 +23,6 @@ #include "core/file_sys/archive_systemsavedata.h" #include "core/file_sys/directory_backend.h" #include "core/file_sys/file_backend.h" -#include "core/hle/hle.h" #include "core/hle/kernel/client_session.h" #include "core/hle/result.h" #include "core/hle/service/fs/archive.h" @@ -46,9 +45,7 @@ struct hash { }; } -/// TODO(Subv): Confirm length of these strings -const std::string SYSTEM_ID = "00000000000000000000000000000000"; -const std::string SDCARD_ID = "00000000000000000000000000000000"; +static constexpr Kernel::Handle INVALID_HANDLE{}; namespace Service { namespace FS { diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index 7ba62ede0..0aa373f40 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -17,9 +17,9 @@ class FileBackend; } /// The unique system identifier hash, also known as ID0 -extern const std::string SYSTEM_ID; +static constexpr char SYSTEM_ID[]{ "00000000000000000000000000000000" }; /// The scrambled SD card CID, also known as ID1 -extern const std::string SDCARD_ID; +static constexpr char SDCARD_ID[]{ "00000000000000000000000000000000" }; namespace Service { namespace FS { diff --git a/src/core/hle/service/ir/ir.cpp b/src/core/hle/service/ir/ir.cpp index 4d6639ded..7f1731a50 100644 --- a/src/core/hle/service/ir/ir.cpp +++ b/src/core/hle/service/ir/ir.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "core/hle/kernel/event.h" +#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/service/ir/ir.h" #include "core/hle/service/ir/ir_rst.h" @@ -36,7 +37,7 @@ void InitializeIrNopShared(Interface* self) { u32 send_buff_size = cmd_buff[4]; u32 unk2 = cmd_buff[5]; u8 baud_rate = cmd_buff[6] & 0xFF; - Handle handle = cmd_buff[8]; + Kernel::Handle handle = cmd_buff[8]; if (Kernel::g_handle_table.IsValid(handle)) { transfer_shared_memory = Kernel::g_handle_table.Get(handle); diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp index 7ced36439..4f1dd2fce 100644 --- a/src/core/hle/service/mic_u.cpp +++ b/src/core/hle/service/mic_u.cpp @@ -4,6 +4,7 @@ #include "common/logging/log.h" #include "core/hle/kernel/event.h" +#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/service/mic_u.h" @@ -50,7 +51,7 @@ static bool audio_buffer_loop; static void MapSharedMem(Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 size = cmd_buff[1]; - Handle mem_handle = cmd_buff[3]; + Kernel::Handle mem_handle = cmd_buff[3]; shared_memory = Kernel::g_handle_table.Get(mem_handle); if (shared_memory) { shared_memory->name = "MIC_U:shared_memory"; -- cgit v1.2.3 From 5ac5cbeab7387b2eabd4618291e223fd7189bb8b Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 17 Dec 2016 01:20:47 -0500 Subject: Address clang-format issues. --- src/core/hle/service/fs/archive.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index 0aa373f40..519c1f3a9 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -17,9 +17,9 @@ class FileBackend; } /// The unique system identifier hash, also known as ID0 -static constexpr char SYSTEM_ID[]{ "00000000000000000000000000000000" }; +static constexpr char SYSTEM_ID[]{"00000000000000000000000000000000"}; /// The scrambled SD card CID, also known as ID1 -static constexpr char SDCARD_ID[]{ "00000000000000000000000000000000" }; +static constexpr char SDCARD_ID[]{"00000000000000000000000000000000"}; namespace Service { namespace FS { -- cgit v1.2.3 From e26fbfd1d72c026d0f25c09595e7123459b1734f Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 22 Dec 2016 00:00:01 -0500 Subject: core: Replace "AppCore" nomenclature with just "CPU". --- src/core/hle/service/ldr_ro/ldr_ro.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index 614f16d44..8d00a7577 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -457,7 +457,7 @@ static void LoadCRO(Interface* self, bool link_on_load_bug_fix) { } } - Core::AppCore().ClearInstructionCache(); + Core::CPU().ClearInstructionCache(); LOG_INFO(Service_LDR, "CRO \"%s\" loaded at 0x%08X, fixed_end=0x%08X", cro.ModuleName().data(), cro_address, cro_address + fix_size); @@ -562,7 +562,7 @@ static void UnloadCRO(Interface* self) { memory_synchronizer.RemoveMemoryBlock(cro_address, cro_buffer_ptr); } - Core::AppCore().ClearInstructionCache(); + Core::CPU().ClearInstructionCache(); cmd_buff[1] = result.raw; } @@ -624,7 +624,7 @@ static void LinkCRO(Interface* self) { } memory_synchronizer.SynchronizeOriginalMemory(); - Core::AppCore().ClearInstructionCache(); + Core::CPU().ClearInstructionCache(); cmd_buff[1] = result.raw; } @@ -686,7 +686,7 @@ static void UnlinkCRO(Interface* self) { } memory_synchronizer.SynchronizeOriginalMemory(); - Core::AppCore().ClearInstructionCache(); + Core::CPU().ClearInstructionCache(); cmd_buff[1] = result.raw; } -- cgit v1.2.3