fssrv: flesh out the program registry

This commit is contained in:
Michael Scire 2021-12-07 12:17:34 -08:00 committed by SciresM
parent e8d14eb77d
commit 28ea6555f8
7 changed files with 209 additions and 5 deletions

View file

@ -15,17 +15,40 @@
*/
#include <stratosphere.hpp>
#include "impl/fssrv_program_info.hpp"
#include "impl/fssrv_program_registry_manager.hpp"
namespace ams::fssrv {
Result ProgramRegistryServiceImpl::RegisterProgramInfo(u64 process_id, u64 program_id, u8 storage_id, const void *data, s64 data_size, const void *desc, s64 desc_size) {
AMS_ABORT("TODO");
AMS_UNUSED(process_id, program_id, storage_id, data, data_size, desc, desc_size);
return m_registry_manager->RegisterProgram(process_id, program_id, storage_id, data, data_size, desc, desc_size);
}
Result ProgramRegistryServiceImpl::UnregisterProgramInfo(u64 process_id) {
AMS_ABORT("TODO");
AMS_UNUSED(process_id);
return m_registry_manager->UnregisterProgram(process_id);
}
Result ProgramRegistryServiceImpl::ResetProgramIndexMapInfo(const fs::ProgramIndexMapInfo *infos, int count) {
return m_index_map_info_manager->Reset(infos, count);
}
Result ProgramRegistryServiceImpl::GetProgramInfo(std::shared_ptr<impl::ProgramInfo> *out, u64 process_id) {
return m_registry_manager->GetProgramInfo(out, process_id);
}
Result ProgramRegistryServiceImpl::GetProgramInfoByProgramId(std::shared_ptr<impl::ProgramInfo> *out, u64 program_id) {
return m_registry_manager->GetProgramInfoByProgramId(out, program_id);
}
size_t ProgramRegistryServiceImpl::GetProgramIndexMapInfoCount() {
return m_index_map_info_manager->GetProgramCount();
}
util::optional<fs::ProgramIndexMapInfo> ProgramRegistryServiceImpl::GetProgramIndexMapInfo(const ncm::ProgramId &program_id) {
return m_index_map_info_manager->Get(program_id);
}
ncm::ProgramId ProgramRegistryServiceImpl::GetProgramIdByIndex(const ncm::ProgramId &program_id, u8 index) {
return m_index_map_info_manager->GetProgramId(program_id, index);
}
}