mesosphere: hard enforcement of TODOs

This commit is contained in:
Michael Scire
2020-02-08 03:18:08 -08:00
parent 919b8124dc
commit 4b6b06fcaa
14 changed files with 57 additions and 53 deletions

View File

@@ -15,8 +15,6 @@
*/
#pragma once
#include <vapours.hpp>
#include <mesosphere/kern_panic.hpp>
#include <mesosphere/svc/kern_svc_results.hpp>
namespace ams::kern {
@@ -36,3 +34,5 @@ namespace ams::kern {
#define MESOSPHERE_ENABLE_ASSERTIONS
#define MESOSPHERE_ENABLE_DEBUG_PRINT
#endif
#include <mesosphere/svc/kern_svc_results.hpp>

View File

@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <mesosphere/kern_common.hpp>
#include <mesosphere/kern_select_cpu.hpp>
#include <mesosphere/kern_slab_helpers.hpp>
#include <mesosphere/kern_k_synchronization_object.hpp>
@@ -27,12 +28,12 @@ namespace ams::kern {
MESOSPHERE_AUTOOBJECT_TRAITS(KProcess, KSynchronizationObject);
/* TODO: This is a placeholder definition. */
public:
constexpr ALWAYS_INLINE u64 GetCoreMask() const { /* TODO */ return 0; }
constexpr ALWAYS_INLINE u64 GetPriorityMask() const { /* TODO */ return 0; }
u64 GetCoreMask() const { MESOSPHERE_TODO_IMPLEMENT(); }
u64 GetPriorityMask() const { MESOSPHERE_TODO_IMPLEMENT();}
constexpr ALWAYS_INLINE bool Is64Bit() const { /* TODO */ return true; }
bool Is64Bit() const { MESOSPHERE_TODO_IMPLEMENT(); }
ALWAYS_INLINE KThread *GetPreemptionStatePinnedThread(s32 core_id) { /* TODO */ return nullptr; }
KThread *GetPreemptionStatePinnedThread(s32 core_id) { MESOSPHERE_TODO_IMPLEMENT(); }
void SetPreemptionState();
};

View File

@@ -52,6 +52,9 @@ namespace ams::kern {
#define MESOSPHERE_ASSERT_THIS()
#endif
#define MESOSPHERE_TODO(arg) ({ constexpr const char *__mesosphere_todo = arg; MESOSPHERE_PANIC("TODO (%s): %s", __PRETTY_FUNCTION__, __mesosphere_todo); })
#define MESOSPHERE_TODO_IMPLEMENT() MESOSPHERE_TODO("Implement")
#define MESOSPHERE_ABORT() MESOSPHERE_PANIC("Abort()");
#define MESOSPHERE_INIT_ABORT() do { /* ... */ } while (true)

View File

@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <mesosphere/kern_common.hpp>
#ifdef ATMOSPHERE_ARCH_ARM64
#include <mesosphere/arch/arm64/kern_cpu.hpp>