|
|
@ -26,6 +26,7 @@ |
|
|
#include "core/hle/kernel/process.h"
|
|
|
#include "core/hle/kernel/process.h"
|
|
|
#include "core/hle/service/filesystem/filesystem.h"
|
|
|
#include "core/hle/service/filesystem/filesystem.h"
|
|
|
#include "core/hle/service/filesystem/fsp_srv.h"
|
|
|
#include "core/hle/service/filesystem/fsp_srv.h"
|
|
|
|
|
|
#include "core/reporter.h"
|
|
|
|
|
|
|
|
|
namespace Service::FileSystem { |
|
|
namespace Service::FileSystem { |
|
|
|
|
|
|
|
|
@ -613,7 +614,7 @@ private: |
|
|
u64 next_entry_index = 0; |
|
|
u64 next_entry_index = 0; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
FSP_SRV::FSP_SRV() : ServiceFramework("fsp-srv") { |
|
|
|
|
|
|
|
|
FSP_SRV::FSP_SRV(const Core::Reporter& reporter) : ServiceFramework("fsp-srv"), reporter(reporter) { |
|
|
// clang-format off
|
|
|
// clang-format off
|
|
|
static const FunctionInfo functions[] = { |
|
|
static const FunctionInfo functions[] = { |
|
|
{0, nullptr, "OpenFileSystem"}, |
|
|
{0, nullptr, "OpenFileSystem"}, |
|
|
@ -710,9 +711,9 @@ FSP_SRV::FSP_SRV() : ServiceFramework("fsp-srv") { |
|
|
{1001, nullptr, "SetSaveDataSize"}, |
|
|
{1001, nullptr, "SetSaveDataSize"}, |
|
|
{1002, nullptr, "SetSaveDataRootPath"}, |
|
|
{1002, nullptr, "SetSaveDataRootPath"}, |
|
|
{1003, nullptr, "DisableAutoSaveDataCreation"}, |
|
|
{1003, nullptr, "DisableAutoSaveDataCreation"}, |
|
|
{1004, nullptr, "SetGlobalAccessLogMode"}, |
|
|
|
|
|
|
|
|
{1004, &FSP_SRV::SetGlobalAccessLogMode, "SetGlobalAccessLogMode"}, |
|
|
{1005, &FSP_SRV::GetGlobalAccessLogMode, "GetGlobalAccessLogMode"}, |
|
|
{1005, &FSP_SRV::GetGlobalAccessLogMode, "GetGlobalAccessLogMode"}, |
|
|
{1006, nullptr, "OutputAccessLogToSdCard"}, |
|
|
|
|
|
|
|
|
{1006, &FSP_SRV::OutputAccessLogToSdCard, "OutputAccessLogToSdCard"}, |
|
|
{1007, nullptr, "RegisterUpdatePartition"}, |
|
|
{1007, nullptr, "RegisterUpdatePartition"}, |
|
|
{1008, nullptr, "OpenRegisteredUpdatePartition"}, |
|
|
{1008, nullptr, "OpenRegisteredUpdatePartition"}, |
|
|
{1009, nullptr, "GetAndClearMemoryReportInfo"}, |
|
|
{1009, nullptr, "GetAndClearMemoryReportInfo"}, |
|
|
@ -814,21 +815,22 @@ void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& |
|
|
rb.PushIpcInterface<ISaveDataInfoReader>(std::make_shared<ISaveDataInfoReader>(space)); |
|
|
rb.PushIpcInterface<ISaveDataInfoReader>(std::make_shared<ISaveDataInfoReader>(space)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { |
|
|
|
|
|
LOG_WARNING(Service_FS, "(STUBBED) called"); |
|
|
|
|
|
|
|
|
void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { |
|
|
|
|
|
IPC::RequestParser rp{ctx}; |
|
|
|
|
|
log_mode = rp.PopEnum<LogMode>(); |
|
|
|
|
|
|
|
|
enum class LogMode : u32 { |
|
|
|
|
|
Off, |
|
|
|
|
|
Log, |
|
|
|
|
|
RedirectToSdCard, |
|
|
|
|
|
LogToSdCard = Log | RedirectToSdCard, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_FS, "called, log_mode={:08X}", static_cast<u32>(log_mode)); |
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2}; |
|
|
|
|
|
rb.Push(RESULT_SUCCESS); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { |
|
|
|
|
|
LOG_WARNING(Service_FS, "called"); |
|
|
|
|
|
|
|
|
// Given we always want to receive logging information,
|
|
|
|
|
|
// we always specify logging as enabled.
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3}; |
|
|
IPC::ResponseBuilder rb{ctx, 3}; |
|
|
rb.Push(RESULT_SUCCESS); |
|
|
rb.Push(RESULT_SUCCESS); |
|
|
rb.PushEnum(LogMode::Log); |
|
|
|
|
|
|
|
|
rb.PushEnum(log_mode); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { |
|
|
void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { |
|
|
@ -902,4 +904,17 @@ void FSP_SRV::OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ct |
|
|
rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); |
|
|
rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) { |
|
|
|
|
|
const auto raw = ctx.ReadBuffer(); |
|
|
|
|
|
auto log = Common::StringFromFixedZeroTerminatedBuffer( |
|
|
|
|
|
reinterpret_cast<const char*>(raw.data()), raw.size()); |
|
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_FS, "called, log='{}'", log); |
|
|
|
|
|
|
|
|
|
|
|
reporter.SaveFilesystemAccessReport(log_mode, std::move(log)); |
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2}; |
|
|
|
|
|
rb.Push(RESULT_SUCCESS); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} // namespace Service::FileSystem
|
|
|
} // namespace Service::FileSystem
|