mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-26 12:55:45 +01:00
fsp: Implement IProgramRegistry
This commit is contained in:
parent
f9a67ff75d
commit
b14f38946c
@ -634,8 +634,8 @@ add_library(core STATIC
|
||||
hle/service/filesystem/fsp/fs_i_storage.h
|
||||
hle/service/filesystem/fsp/fsp_ldr.cpp
|
||||
hle/service/filesystem/fsp/fsp_ldr.h
|
||||
hle/service/filesystem/fsp/fsp_pr.cpp
|
||||
hle/service/filesystem/fsp/fsp_pr.h
|
||||
hle/service/filesystem/fsp/fs_i_program_registry.cpp
|
||||
hle/service/filesystem/fsp/fs_i_program_registry.h
|
||||
hle/service/filesystem/fsp/fsp_srv.cpp
|
||||
hle/service/filesystem/fsp/fsp_srv.h
|
||||
hle/service/filesystem/fsp/fsp_types.h
|
||||
|
@ -20,8 +20,8 @@
|
||||
#include "core/file_sys/vfs/vfs.h"
|
||||
#include "core/file_sys/vfs/vfs_offset.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/hle/service/filesystem/fsp/fs_i_program_registry.h"
|
||||
#include "core/hle/service/filesystem/fsp/fsp_ldr.h"
|
||||
#include "core/hle/service/filesystem/fsp/fsp_pr.h"
|
||||
#include "core/hle/service/filesystem/fsp/fsp_srv.h"
|
||||
#include "core/hle/service/filesystem/romfs_controller.h"
|
||||
#include "core/hle/service/filesystem/save_data_controller.h"
|
||||
@ -726,7 +726,7 @@ void LoopProcess(Core::System& system) {
|
||||
const auto FileSystemProxyFactory = [&] { return std::make_shared<FSP_SRV>(system); };
|
||||
|
||||
server_manager->RegisterNamedService("fsp-ldr", std::make_shared<FSP_LDR>(system));
|
||||
server_manager->RegisterNamedService("fsp:pr", std::make_shared<FSP_PR>(system));
|
||||
server_manager->RegisterNamedService("fsp:pr", std::make_shared<IProgramRegistry>(system));
|
||||
server_manager->RegisterNamedService("fsp-srv", std::move(FileSystemProxyFactory));
|
||||
ServerManager::RunServer(std::move(server_manager));
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/filesystem/fsp/fs_i_program_registry.h"
|
||||
|
||||
namespace Service::FileSystem {
|
||||
|
||||
IProgramRegistry::IProgramRegistry(Core::System& system_)
|
||||
: ServiceFramework{system_, "fsp:pr"}, registry{system_} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, C<&IProgramRegistry::RegisterProgram>, "RegisterProgram"},
|
||||
{1, C<&IProgramRegistry::UnregisterProgram>, "UnregisterProgram"},
|
||||
{2, C<&IProgramRegistry::SetCurrentProcess>, "SetCurrentProcess"},
|
||||
{256, C<&IProgramRegistry::SetEnabledProgramVerification>, "SetEnabledProgramVerification"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
IProgramRegistry::~IProgramRegistry() = default;
|
||||
|
||||
Result IProgramRegistry::RegisterProgram(u8 storage_id, u64 process_id, u64 program_id,
|
||||
const InBuffer<BufferAttr_HipcMapAlias> data,
|
||||
s64 data_size,
|
||||
const InBuffer<BufferAttr_HipcMapAlias> desc,
|
||||
s64 desc_size) {
|
||||
LOG_INFO(Service_FS,
|
||||
"called, process_id={}, program_id={}, storage_id={}, data_size={}, desc_size = {}",
|
||||
process_id, program_id, storage_id, data_size, desc_size);
|
||||
R_RETURN(registry.RegisterProgram(process_id, program_id, storage_id, data, data_size, desc,
|
||||
desc_size));
|
||||
}
|
||||
|
||||
Result IProgramRegistry::UnregisterProgram(u64 process_id) {
|
||||
LOG_INFO(Service_FS, "called, process_id={}", process_id);
|
||||
R_RETURN(registry.UnregisterProgram(process_id));
|
||||
}
|
||||
|
||||
Result IProgramRegistry::SetCurrentProcess(const ClientProcessId& client_pid) {
|
||||
LOG_INFO(Service_FS, "called, client_pid={}", client_pid.pid);
|
||||
R_RETURN(registry.SetCurrentProcess(client_pid));
|
||||
}
|
||||
|
||||
Result IProgramRegistry::SetEnabledProgramVerification(bool enabled) {
|
||||
LOG_INFO(Service_FS, "called, enabled={}", enabled);
|
||||
R_RETURN(registry.SetEnabledProgramVerification(enabled));
|
||||
}
|
||||
|
||||
} // namespace Service::FileSystem
|
36
src/core/hle/service/filesystem/fsp/fs_i_program_registry.h
Normal file
36
src/core/hle/service/filesystem/fsp/fs_i_program_registry.h
Normal file
@ -0,0 +1,36 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/file_sys/fssrv/fssrv_program_registry_impl.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::FileSystem {
|
||||
|
||||
class IProgramRegistry final : public ServiceFramework<IProgramRegistry> {
|
||||
public:
|
||||
explicit IProgramRegistry(Core::System& system_);
|
||||
~IProgramRegistry() override;
|
||||
|
||||
Result RegisterProgram(u8 storage_id, u64 process_id, u64 program_id,
|
||||
const InBuffer<BufferAttr_HipcMapAlias> data, s64 data_size,
|
||||
const InBuffer<BufferAttr_HipcMapAlias> desc, s64 desc_size);
|
||||
|
||||
Result UnregisterProgram(u64 process_id);
|
||||
|
||||
Result SetCurrentProcess(const ClientProcessId& client_pid);
|
||||
|
||||
Result SetEnabledProgramVerification(bool enabled);
|
||||
|
||||
private:
|
||||
FileSys::FsSrv::ProgramRegistryImpl registry;
|
||||
};
|
||||
|
||||
} // namespace Service::FileSystem
|
@ -1,23 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/filesystem/fsp/fsp_pr.h"
|
||||
|
||||
namespace Service::FileSystem {
|
||||
|
||||
FSP_PR::FSP_PR(Core::System& system_) : ServiceFramework{system_, "fsp:pr"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RegisterProgram"},
|
||||
{1, nullptr, "UnregisterProgram"},
|
||||
{2, nullptr, "SetCurrentProcess"},
|
||||
{256, nullptr, "SetEnabledProgramVerification"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
FSP_PR::~FSP_PR() = default;
|
||||
|
||||
} // namespace Service::FileSystem
|
@ -1,20 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::FileSystem {
|
||||
|
||||
class FSP_PR final : public ServiceFramework<FSP_PR> {
|
||||
public:
|
||||
explicit FSP_PR(Core::System& system_);
|
||||
~FSP_PR() override;
|
||||
};
|
||||
|
||||
} // namespace Service::FileSystem
|
Loading…
Reference in New Issue
Block a user