From 1f28bee86a2ac4c327fcecf04e6095d48bc5a80d Mon Sep 17 00:00:00 2001 From: Eladash Date: Sun, 27 Sep 2020 19:11:10 +0300 Subject: [PATCH] cellSpurs: Add error codes formatting (unused) --- rpcs3/Emu/Cell/Modules/cellSpurs.cpp | 118 +++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp index e3f5ba919b..6202348115 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp @@ -18,6 +18,124 @@ LOG_CHANNEL(cellSpurs); +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + format_enum(out, arg, [](auto error) + { + switch (error) + { + STR_CASE(CELL_SPURS_CORE_ERROR_AGAIN); + STR_CASE(CELL_SPURS_CORE_ERROR_INVAL); + STR_CASE(CELL_SPURS_CORE_ERROR_NOMEM); + STR_CASE(CELL_SPURS_CORE_ERROR_SRCH); + STR_CASE(CELL_SPURS_CORE_ERROR_PERM); + STR_CASE(CELL_SPURS_CORE_ERROR_BUSY); + STR_CASE(CELL_SPURS_CORE_ERROR_STAT); + STR_CASE(CELL_SPURS_CORE_ERROR_ALIGN); + STR_CASE(CELL_SPURS_CORE_ERROR_NULL_POINTER); + } + + return unknown; + }); +} + +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + format_enum(out, arg, [](auto error) + { + switch (error) + { + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_AGAIN); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_INVAL); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_NOSYS); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_NOMEM); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_SRCH); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_NOENT); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_NOEXEC); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_DEADLK); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_PERM); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_BUSY); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_ABORT); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_FAULT); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_CHILD); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_STAT); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_ALIGN); + STR_CASE(CELL_SPURS_POLICY_MODULE_ERROR_NULL_POINTER); + } + + return unknown; + }); +} + +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + format_enum(out, arg, [](auto error) + { + switch (error) + { + STR_CASE(CELL_SPURS_TASK_ERROR_AGAIN); + STR_CASE(CELL_SPURS_TASK_ERROR_INVAL); + STR_CASE(CELL_SPURS_TASK_ERROR_NOSYS); + STR_CASE(CELL_SPURS_TASK_ERROR_NOMEM); + STR_CASE(CELL_SPURS_TASK_ERROR_SRCH); + STR_CASE(CELL_SPURS_TASK_ERROR_NOEXEC); + STR_CASE(CELL_SPURS_TASK_ERROR_PERM); + STR_CASE(CELL_SPURS_TASK_ERROR_BUSY); + STR_CASE(CELL_SPURS_TASK_ERROR_FAULT); + STR_CASE(CELL_SPURS_TASK_ERROR_ALIGN); + STR_CASE(CELL_SPURS_TASK_ERROR_STAT); + STR_CASE(CELL_SPURS_TASK_ERROR_NULL_POINTER); + STR_CASE(CELL_SPURS_TASK_ERROR_FATAL); + STR_CASE(CELL_SPURS_TASK_ERROR_SHUTDOWN); + } + + return unknown; + }); +} + +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + format_enum(out, arg, [](auto error) + { + switch (error) + { + STR_CASE(CELL_SPURS_JOB_ERROR_AGAIN); + STR_CASE(CELL_SPURS_JOB_ERROR_INVAL); + STR_CASE(CELL_SPURS_JOB_ERROR_NOSYS); + STR_CASE(CELL_SPURS_JOB_ERROR_NOMEM); + STR_CASE(CELL_SPURS_JOB_ERROR_SRCH); + STR_CASE(CELL_SPURS_JOB_ERROR_NOENT); + STR_CASE(CELL_SPURS_JOB_ERROR_NOEXEC); + STR_CASE(CELL_SPURS_JOB_ERROR_DEADLK); + STR_CASE(CELL_SPURS_JOB_ERROR_PERM); + STR_CASE(CELL_SPURS_JOB_ERROR_BUSY); + STR_CASE(CELL_SPURS_JOB_ERROR_JOB_DESCRIPTOR); + STR_CASE(CELL_SPURS_JOB_ERROR_JOB_DESCRIPTOR_SIZE); + STR_CASE(CELL_SPURS_JOB_ERROR_FAULT); + STR_CASE(CELL_SPURS_JOB_ERROR_CHILD); + STR_CASE(CELL_SPURS_JOB_ERROR_STAT); + STR_CASE(CELL_SPURS_JOB_ERROR_ALIGN); + STR_CASE(CELL_SPURS_JOB_ERROR_NULL_POINTER); + STR_CASE(CELL_SPURS_JOB_ERROR_MEMORY_CORRUPTED); + STR_CASE(CELL_SPURS_JOB_ERROR_MEMORY_SIZE); + STR_CASE(CELL_SPURS_JOB_ERROR_UNKNOWN_COMMAND); + STR_CASE(CELL_SPURS_JOB_ERROR_JOBLIST_ALIGNMENT); + STR_CASE(CELL_SPURS_JOB_ERROR_JOB_ALIGNMENT); + STR_CASE(CELL_SPURS_JOB_ERROR_CALL_OVERFLOW); + STR_CASE(CELL_SPURS_JOB_ERROR_ABORT); + STR_CASE(CELL_SPURS_JOB_ERROR_DMALIST_ELEMENT); + STR_CASE(CELL_SPURS_JOB_ERROR_NUM_CACHE); + STR_CASE(CELL_SPURS_JOB_ERROR_INVALID_BINARY); + } + + return unknown; + }); +} + extern u64 ppu_ldarx(ppu_thread&, u32); extern u32 ppu_lwarx(ppu_thread&, u32); extern bool ppu_stwcx(ppu_thread&, u32, u32);