From ea5c0f0174df284c92893561611ea3bb92d31038 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 28 Mar 2019 14:22:50 -0700 Subject: [PATCH] libstrat: migrate result headers to library --- include/stratosphere.hpp | 4 +- include/stratosphere/results.hpp | 21 +++++++++ .../stratosphere/results/creport_results.hpp | 33 +++++++++++++ include/stratosphere/results/dmnt_results.hpp | 38 +++++++++++++++ include/stratosphere/results/fs_results.hpp | 47 +++++++++++++++++++ 5 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 include/stratosphere/results.hpp create mode 100644 include/stratosphere/results/creport_results.hpp create mode 100644 include/stratosphere/results/dmnt_results.hpp create mode 100644 include/stratosphere/results/fs_results.hpp diff --git a/include/stratosphere.hpp b/include/stratosphere.hpp index 58208711..91506899 100644 --- a/include/stratosphere.hpp +++ b/include/stratosphere.hpp @@ -33,4 +33,6 @@ #include "stratosphere/mitm.hpp" -#include "stratosphere/services.hpp" \ No newline at end of file +#include "stratosphere/services.hpp" + +#include "stratosphere/results.hpp" \ No newline at end of file diff --git a/include/stratosphere/results.hpp b/include/stratosphere/results.hpp new file mode 100644 index 00000000..d8e20a44 --- /dev/null +++ b/include/stratosphere/results.hpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2018 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "results/fs_results.hpp" +#include "results/dmnt_results.hpp" +#include "results/creport_results.hpp" \ No newline at end of file diff --git a/include/stratosphere/results/creport_results.hpp b/include/stratosphere/results/creport_results.hpp new file mode 100644 index 00000000..88a00af7 --- /dev/null +++ b/include/stratosphere/results/creport_results.hpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include + +static constexpr u32 Module_Creport = 168; + +static constexpr Result ResultCreportUndefinedInstruction = MAKERESULT(Module_Creport, 0); +static constexpr Result ResultCreportInstructionAbort = MAKERESULT(Module_Creport, 1); +static constexpr Result ResultCreportDataAbort = MAKERESULT(Module_Creport, 2); +static constexpr Result ResultCreportAlignmentFault = MAKERESULT(Module_Creport, 3); +static constexpr Result ResultCreportDebuggerAttached = MAKERESULT(Module_Creport, 4); +static constexpr Result ResultCreportBreakPoint = MAKERESULT(Module_Creport, 5); +static constexpr Result ResultCreportUserBreak = MAKERESULT(Module_Creport, 6); +static constexpr Result ResultCreportDebuggerBreak = MAKERESULT(Module_Creport, 7); +static constexpr Result ResultCreportBadSvc = MAKERESULT(Module_Creport, 8); +static constexpr Result ResultCreportSystemMemoryError = MAKERESULT(Module_Creport, 9); + +static constexpr Result ResultCreportIncompleteReport = MAKERESULT(Module_Creport, 99); diff --git a/include/stratosphere/results/dmnt_results.hpp b/include/stratosphere/results/dmnt_results.hpp new file mode 100644 index 00000000..8b30ef09 --- /dev/null +++ b/include/stratosphere/results/dmnt_results.hpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include + +static constexpr u32 Module_Dmnt = 13; + +static constexpr Result ResultDmntUnknown = MAKERESULT(Module_Dmnt, 1); +static constexpr Result ResultDmntDebuggingDisabled = MAKERESULT(Module_Dmnt, 2); + +static constexpr Result ResultDmntCheatNotAttached = MAKERESULT(Module_Dmnt, 6500); +static constexpr Result ResultDmntCheatNullBuffer = MAKERESULT(Module_Dmnt, 6501); +static constexpr Result ResultDmntCheatInvalidBuffer = MAKERESULT(Module_Dmnt, 6502); +static constexpr Result ResultDmntCheatUnknownChtId = MAKERESULT(Module_Dmnt, 6503); +static constexpr Result ResultDmntCheatOutOfCheats = MAKERESULT(Module_Dmnt, 6504); +static constexpr Result ResultDmntCheatInvalidCheat = MAKERESULT(Module_Dmnt, 6505); +static constexpr Result ResultDmntCheatCannotDisableMasterCheat = MAKERESULT(Module_Dmnt, 6505); + +static constexpr Result ResultDmntCheatInvalidFreezeWidth = MAKERESULT(Module_Dmnt, 6600); +static constexpr Result ResultDmntCheatAddressAlreadyFrozen = MAKERESULT(Module_Dmnt, 6601); +static constexpr Result ResultDmntCheatAddressNotFrozen = MAKERESULT(Module_Dmnt, 6602); +static constexpr Result ResultDmntCheatTooManyFrozenAddresses = MAKERESULT(Module_Dmnt, 6603); + +static constexpr Result ResultDmntCheatVmInvalidCondDepth = MAKERESULT(Module_Dmnt, 6700); \ No newline at end of file diff --git a/include/stratosphere/results/fs_results.hpp b/include/stratosphere/results/fs_results.hpp new file mode 100644 index 00000000..3bcf5d50 --- /dev/null +++ b/include/stratosphere/results/fs_results.hpp @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include + +static constexpr u32 Module_Fs = 2; + +static constexpr Result ResultFsPathNotFound = MAKERESULT(Module_Fs, 1); +static constexpr Result ResultFsPathAlreadyExists = MAKERESULT(Module_Fs, 2); + +static constexpr Result ResultFsTargetLocked = MAKERESULT(Module_Fs, 7); +static constexpr Result ResultFsDirectoryNotEmpty = MAKERESULT(Module_Fs, 8); + +static constexpr Result ResultFsNotImplemented = MAKERESULT(Module_Fs, 3001); +static constexpr Result ResultFsOutOfRange = MAKERESULT(Module_Fs, 3005); + +static constexpr Result ResultFsAllocationFailureInDirectorySaveDataFileSystem = MAKERESULT(Module_Fs, 3321); +static constexpr Result ResultFsAllocationFailureInSubDirectoryFileSystem = MAKERESULT(Module_Fs, 3355); + +static constexpr Result ResultFsPreconditionViolation = MAKERESULT(Module_Fs, 6000); +static constexpr Result ResultFsInvalidArgument = MAKERESULT(Module_Fs, 6001); +static constexpr Result ResultFsInvalidPath = MAKERESULT(Module_Fs, 6002); +static constexpr Result ResultFsTooLongPath = MAKERESULT(Module_Fs, 6003); +static constexpr Result ResultFsInvalidCharacter = MAKERESULT(Module_Fs, 6004); +static constexpr Result ResultFsInvalidPathFormat = MAKERESULT(Module_Fs, 6005); +static constexpr Result ResultFsDirectoryUnobtainable = MAKERESULT(Module_Fs, 6006); +static constexpr Result ResultFsNotNormalized = MAKERESULT(Module_Fs, 6007); + +static constexpr Result ResultFsInvalidOffset = MAKERESULT(Module_Fs, 6061); +static constexpr Result ResultFsInvalidSize = MAKERESULT(Module_Fs, 6062); +static constexpr Result ResultFsNullptrArgument = MAKERESULT(Module_Fs, 6063); + +static constexpr Result ResultFsUnsupportedOperation = MAKERESULT(Module_Fs, 6300);