From 65be230fdda302b25447f2f09b06e3238bd09e79 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 19 Feb 2023 14:42:12 -0500 Subject: service: move hle_ipc from kernel --- src/core/hle/service/bcat/bcat_module.cpp | 48 +++++++++++++++---------------- src/core/hle/service/bcat/bcat_module.h | 6 ++-- 2 files changed, 26 insertions(+), 28 deletions(-) (limited to 'src/core/hle/service/bcat') diff --git a/src/core/hle/service/bcat/bcat_module.cpp b/src/core/hle/service/bcat/bcat_module.cpp index 1db3f026b..a6281913a 100644 --- a/src/core/hle/service/bcat/bcat_module.cpp +++ b/src/core/hle/service/bcat/bcat_module.cpp @@ -9,12 +9,12 @@ #include "common/string_util.h" #include "core/core.h" #include "core/file_sys/vfs.h" -#include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_readable_event.h" #include "core/hle/service/bcat/backend/backend.h" #include "core/hle/service/bcat/bcat.h" #include "core/hle/service/bcat/bcat_module.h" #include "core/hle/service/filesystem/filesystem.h" +#include "core/hle/service/ipc_helpers.h" #include "core/hle/service/server_manager.h" namespace Service::BCAT { @@ -51,8 +51,7 @@ BCATDigest DigestFile(const FileSys::VirtualFile& file) { // For a name to be valid it must be non-empty, must have a null terminating character as the final // char, can only contain numbers, letters, underscores and a hyphen if directory and a period if // file. -bool VerifyNameValidInternal(Kernel::HLERequestContext& ctx, std::array name, - char match_char) { +bool VerifyNameValidInternal(HLERequestContext& ctx, std::array name, char match_char) { const auto null_chars = std::count(name.begin(), name.end(), 0); const auto bad_chars = std::count_if(name.begin(), name.end(), [match_char](char c) { return !std::isalnum(static_cast(c)) && c != '_' && c != match_char && c != '\0'; @@ -67,11 +66,11 @@ bool VerifyNameValidInternal(Kernel::HLERequestContext& ctx, std::array(); const auto name = @@ -203,7 +202,7 @@ private: rb.PushIpcInterface(CreateProgressService(SyncType::Directory)); } - void SetPassphrase(Kernel::HLERequestContext& ctx) { + void SetPassphrase(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto title_id = rp.PopRaw(); @@ -235,7 +234,7 @@ private: rb.Push(ResultSuccess); } - void ClearDeliveryCacheStorage(Kernel::HLERequestContext& ctx) { + void ClearDeliveryCacheStorage(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto title_id = rp.PopRaw(); @@ -271,7 +270,7 @@ private: std::array(SyncType::Count)> progress; }; -void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) { +void Module::Interface::CreateBcatService(HLERequestContext& ctx) { LOG_DEBUG(Service_BCAT, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; @@ -296,7 +295,7 @@ public: } private: - void Open(Kernel::HLERequestContext& ctx) { + void Open(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto dir_name_raw = rp.PopRaw(); const auto file_name_raw = rp.PopRaw(); @@ -340,7 +339,7 @@ private: rb.Push(ResultSuccess); } - void Read(Kernel::HLERequestContext& ctx) { + void Read(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto offset{rp.PopRaw()}; @@ -363,7 +362,7 @@ private: rb.Push(buffer.size()); } - void GetSize(Kernel::HLERequestContext& ctx) { + void GetSize(HLERequestContext& ctx) { LOG_DEBUG(Service_BCAT, "called"); if (current_file == nullptr) { @@ -377,7 +376,7 @@ private: rb.Push(current_file->GetSize()); } - void GetDigest(Kernel::HLERequestContext& ctx) { + void GetDigest(HLERequestContext& ctx) { LOG_DEBUG(Service_BCAT, "called"); if (current_file == nullptr) { @@ -412,7 +411,7 @@ public: } private: - void Open(Kernel::HLERequestContext& ctx) { + void Open(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto name_raw = rp.PopRaw(); const auto name = @@ -443,7 +442,7 @@ private: rb.Push(ResultSuccess); } - void Read(Kernel::HLERequestContext& ctx) { + void Read(HLERequestContext& ctx) { auto write_size = ctx.GetWriteBufferNumElements(); LOG_DEBUG(Service_BCAT, "called, write_size={:016X}", write_size); @@ -473,7 +472,7 @@ private: rb.Push(static_cast(write_size * sizeof(DeliveryCacheDirectoryEntry))); } - void GetCount(Kernel::HLERequestContext& ctx) { + void GetCount(HLERequestContext& ctx) { LOG_DEBUG(Service_BCAT, "called"); if (current_dir == nullptr) { @@ -517,7 +516,7 @@ public: } private: - void CreateFileService(Kernel::HLERequestContext& ctx) { + void CreateFileService(HLERequestContext& ctx) { LOG_DEBUG(Service_BCAT, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; @@ -525,7 +524,7 @@ private: rb.PushIpcInterface(system, root); } - void CreateDirectoryService(Kernel::HLERequestContext& ctx) { + void CreateDirectoryService(HLERequestContext& ctx) { LOG_DEBUG(Service_BCAT, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; @@ -533,7 +532,7 @@ private: rb.PushIpcInterface(system, root); } - void EnumerateDeliveryCacheDirectory(Kernel::HLERequestContext& ctx) { + void EnumerateDeliveryCacheDirectory(HLERequestContext& ctx) { auto size = ctx.GetWriteBufferNumElements(); LOG_DEBUG(Service_BCAT, "called, size={:016X}", size); @@ -552,7 +551,7 @@ private: u64 next_read_index = 0; }; -void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx) { +void Module::Interface::CreateDeliveryCacheStorageService(HLERequestContext& ctx) { LOG_DEBUG(Service_BCAT, "called"); const auto title_id = system.GetApplicationProcessProgramID(); @@ -561,8 +560,7 @@ void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestCont rb.PushIpcInterface(system, fsc.GetBCATDirectory(title_id)); } -void Module::Interface::CreateDeliveryCacheStorageServiceWithApplicationId( - Kernel::HLERequestContext& ctx) { +void Module::Interface::CreateDeliveryCacheStorageServiceWithApplicationId(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto title_id = rp.PopRaw(); diff --git a/src/core/hle/service/bcat/bcat_module.h b/src/core/hle/service/bcat/bcat_module.h index 0c134d1ff..87576288b 100644 --- a/src/core/hle/service/bcat/bcat_module.h +++ b/src/core/hle/service/bcat/bcat_module.h @@ -27,9 +27,9 @@ public: FileSystem::FileSystemController& fsc_, const char* name); ~Interface() override; - void CreateBcatService(Kernel::HLERequestContext& ctx); - void CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx); - void CreateDeliveryCacheStorageServiceWithApplicationId(Kernel::HLERequestContext& ctx); + void CreateBcatService(HLERequestContext& ctx); + void CreateDeliveryCacheStorageService(HLERequestContext& ctx); + void CreateDeliveryCacheStorageServiceWithApplicationId(HLERequestContext& ctx); protected: FileSystem::FileSystemController& fsc; -- cgit v1.2.3