diff --git a/libraries/libstratosphere/include/stratosphere/erpt/erpt_types.hpp b/libraries/libstratosphere/include/stratosphere/erpt/erpt_types.hpp index 9ae14fcef..899de49db 100644 --- a/libraries/libstratosphere/include/stratosphere/erpt/erpt_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/erpt/erpt_types.hpp @@ -246,24 +246,24 @@ namespace ams::erpt { constexpr inline u32 ErrorCodeSizeMax = 15; constexpr inline u32 ProgramIdSizeMax = 17; - struct RecentReportEntry { + struct NotifiableErrorCodeReportEntry { char error_code[ErrorCodeSizeMax]; char program_id[ProgramIdSizeMax]; u8 is_visible; u8 is_system_abort; u8 is_application_abort; }; - static_assert(sizeof(RecentReportEntry) == 35); + static_assert(sizeof(NotifiableErrorCodeReportEntry) == 35); - struct RecentReportSummary : public sf::LargeData, public sf::PrefersAutoSelectTransferMode { + struct NotifiableErrorCodesData : public sf::LargeData, public sf::PrefersAutoSelectTransferMode { u32 entry_count; - RecentReportEntry entries[50]; + NotifiableErrorCodeReportEntry entries[50]; char firmware_display_version[0x18]; char private_os_version[96]; char product_model[16]; char region_code[34]; }; - static_assert(sizeof(RecentReportSummary) == 0x784); + static_assert(sizeof(NotifiableErrorCodesData) == 0x784); struct SystemInfo { char os_version[0x18]; diff --git a/libraries/libstratosphere/include/stratosphere/erpt/sf/erpt_sf_i_manager.hpp b/libraries/libstratosphere/include/stratosphere/erpt/sf/erpt_sf_i_manager.hpp index b91ade849..5ce17515f 100644 --- a/libraries/libstratosphere/include/stratosphere/erpt/sf/erpt_sf_i_manager.hpp +++ b/libraries/libstratosphere/include/stratosphere/erpt/sf/erpt_sf_i_manager.hpp @@ -25,7 +25,7 @@ AMS_SF_METHOD_INFO(C, H, 4, Result, GetStorageUsageStatistics, (ams::sf::Out out), (out), hos::Version_5_0_0) \ AMS_SF_METHOD_INFO(C, H, 5, Result, GetAttachmentListDeprecated, (const ams::sf::OutBuffer &out_buf, const erpt::ReportId &report_id), (out_buf, report_id), hos::Version_8_0_0, hos::Version_19_0_1) \ AMS_SF_METHOD_INFO(C, H, 6, Result, GetAttachmentList, (ams::sf::Out out_count, const ams::sf::OutBuffer &out_buf, const erpt::ReportId &report_id), (out_count, out_buf, report_id), hos::Version_20_0_0) \ - AMS_SF_METHOD_INFO(C, H, 7, Result, GetRecentReportSummary, (ams::sf::Out out), (out), hos::Version_22_0_0) \ + AMS_SF_METHOD_INFO(C, H, 7, Result, PopNotifiableErrorCodes, (ams::sf::Out out), (out), hos::Version_22_0_0) \ AMS_SF_METHOD_INFO(C, H, 10, Result, GetReportSizeMax, (ams::sf::Out out), (out), hos::Version_20_0_0) diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_main.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_main.cpp index f6103820b..54754cee0 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_main.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_main.cpp @@ -21,7 +21,7 @@ #include "erpt_srv_journal.hpp" #include "erpt_srv_service.hpp" #include "erpt_srv_forced_shutdown.hpp" -#include "erpt_srv_recent_report.hpp" +#include "erpt_srv_notifiable_errors.hpp" namespace ams::erpt::srv { diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_manager_impl.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_manager_impl.cpp index 58c053678..b4843d3df 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_manager_impl.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_manager_impl.cpp @@ -16,7 +16,7 @@ #include #include "erpt_srv_manager_impl.hpp" #include "erpt_srv_journal.hpp" -#include "erpt_srv_recent_report.hpp" +#include "erpt_srv_notifiable_errors.hpp" namespace ams::erpt::srv { @@ -60,7 +60,7 @@ namespace ams::erpt::srv { Result ManagerImpl::CleanupReports() { Journal::CleanupReports(); Journal::CleanupAttachments(); - RecentReport::Clear(); + NotifiableErrorCodeReport::Clear(); R_RETURN(Journal::Commit()); } @@ -106,8 +106,8 @@ namespace ams::erpt::srv { R_SUCCEED(); } - Result ManagerImpl::GetRecentReportSummary(ams::sf::Out out) { - RecentReport::GetSummary(out.GetPointer()); + Result ManagerImpl::PopNotifiableErrorCodes(ams::sf::Out out) { + NotifiableErrorCodeReport::PopNotifiableErrorCodes(out.GetPointer()); R_SUCCEED(); } diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_manager_impl.hpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_manager_impl.hpp index 81b76ef82..e9d4a1093 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_manager_impl.hpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_manager_impl.hpp @@ -36,7 +36,7 @@ namespace ams::erpt::srv { Result GetStorageUsageStatistics(ams::sf::Out out); Result GetAttachmentListDeprecated(const ams::sf::OutBuffer &out_buf, const ReportId &report_id); Result GetAttachmentList(ams::sf::Out out_count, const ams::sf::OutBuffer &out_buf, const ReportId &report_id); - Result GetRecentReportSummary(ams::sf::Out out); + Result PopNotifiableErrorCodes(ams::sf::Out out); Result GetReportSizeMax(ams::sf::Out out); }; static_assert(erpt::sf::IsIManager); diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_recent_report.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_notifiable_errors.cpp similarity index 75% rename from libraries/libstratosphere/source/erpt/srv/erpt_srv_recent_report.cpp rename to libraries/libstratosphere/source/erpt/srv/erpt_srv_notifiable_errors.cpp index ac3815185..a0ac14c10 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_recent_report.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_notifiable_errors.cpp @@ -14,7 +14,7 @@ * along with this program. If not, see . */ #include -#include "erpt_srv_recent_report.hpp" +#include "erpt_srv_notifiable_errors.hpp" namespace ams::erpt::srv { @@ -22,14 +22,14 @@ namespace ams::erpt::srv { constexpr size_t MaxEntriesPerType = 25; - struct RecentReportState { + struct NotifiableErrorCodeReportState { u32 report_counts[ReportType_Count]; - RecentReportEntry report_entries[ReportType_Count][MaxEntriesPerType]; + NotifiableErrorCodeReportEntry report_entries[ReportType_Count][MaxEntriesPerType]; os::Tick last_tick; u32 consecutive_count; }; - constinit RecentReportState g_state = { + constinit NotifiableErrorCodeReportState g_state = { .report_counts = {}, .report_entries = {}, .last_tick = os::Tick{}, @@ -38,18 +38,18 @@ namespace ams::erpt::srv { } - void RecentReport::PushEntry(const char *error_code, const char *program_id, ReportType type, bool is_system_abort, bool is_application_abort) { + void NotifiableErrorCodeReport::PushEntry(const char *error_code, const char *program_id, ReportType type, bool is_system_abort, bool is_application_abort) { u32 &count = g_state.report_counts[type]; - RecentReportEntry *entries = g_state.report_entries[type]; + NotifiableErrorCodeReportEntry *entries = g_state.report_entries[type]; /* If we're full, shift the oldest entry out. */ if (count >= MaxEntriesPerType) { - std::memmove(entries, entries + 1, sizeof(RecentReportEntry) * (MaxEntriesPerType - 1)); + std::memmove(entries, entries + 1, sizeof(NotifiableErrorCodeReportEntry) * (MaxEntriesPerType - 1)); count = MaxEntriesPerType - 1; } /* Fill the new entry. */ - RecentReportEntry &entry = entries[count]; + NotifiableErrorCodeReportEntry &entry = entries[count]; util::Strlcpy(entry.error_code, error_code, sizeof(entry.error_code)); util::Strlcpy(entry.program_id, program_id, sizeof(entry.program_id)); entry.is_visible = (type == ReportType_Visible); @@ -59,7 +59,7 @@ namespace ams::erpt::srv { count++; } - void RecentReport::GetSummary(RecentReportSummary *out) { + void NotifiableErrorCodeReport::PopNotifiableErrorCodes(NotifiableErrorCodesData *out) { /* Fill basic info from lazily-initialized system info. */ const auto &sys_info = srv::GetSystemInfo(); util::Strlcpy(out->firmware_display_version, sys_info.os_version, sizeof(out->firmware_display_version)); @@ -74,7 +74,7 @@ namespace ams::erpt::srv { if (g_state.report_counts[i] == 0) { continue; } - std::memcpy(out->entries + total_count, g_state.report_entries[i], sizeof(RecentReportEntry) * g_state.report_counts[i]); + std::memcpy(out->entries + total_count, g_state.report_entries[i], sizeof(NotifiableErrorCodeReportEntry) * g_state.report_counts[i]); total_count += g_state.report_counts[i]; /* Reset count (destructive read). */ @@ -84,7 +84,7 @@ namespace ams::erpt::srv { out->entry_count = total_count; } - void RecentReport::Clear() { + void NotifiableErrorCodeReport::Clear() { for (u32 i = 0; i < ReportType_Count; i++) { g_state.report_counts[i] = 0; } diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_recent_report.hpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_notifiable_errors.hpp similarity index 88% rename from libraries/libstratosphere/source/erpt/srv/erpt_srv_recent_report.hpp rename to libraries/libstratosphere/source/erpt/srv/erpt_srv_notifiable_errors.hpp index 065f82250..50847aabf 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_recent_report.hpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_notifiable_errors.hpp @@ -18,10 +18,10 @@ namespace ams::erpt::srv { - class RecentReport { + class NotifiableErrorCodeReport { public: static void PushEntry(const char *error_code, const char *program_id, ReportType type, bool is_system_abort, bool is_application_abort); - static void GetSummary(RecentReportSummary *out); + static void PopNotifiableErrorCodes(NotifiableErrorCodesData *out); static void Clear(); }; diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp index 0ef5e2f61..a1314cc77 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp @@ -20,7 +20,7 @@ #include "erpt_srv_context_record.hpp" #include "erpt_srv_context.hpp" #include "erpt_srv_fs_info.hpp" -#include "erpt_srv_recent_report.hpp" +#include "erpt_srv_notifiable_errors.hpp" namespace ams::erpt::srv { @@ -536,7 +536,7 @@ namespace ams::erpt::srv { } } - RecentReport::PushEntry(error_code, program_id, type, is_system_abort, is_application_abort); + NotifiableErrorCodeReport::PushEntry(error_code, program_id, type, is_system_abort, is_application_abort); } /* Generate report id. */