diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-23 02:58:39 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-23 02:58:39 +0100 |
| commit | 5563deabd8f7ce3fc713ea23f8cf5bbac33b4024 (patch) | |
| tree | f182700a0360ecf7319415915638e44a5d0074dc /Private/NewKit/KernelCheck.hpp | |
| parent | ab4eaababec7f870378ed64fbbf51b154b292a7b (diff) | |
Kernel: add heap information (allocator)
- Force use of itanium ABI even of MPCC.
- Revision of handover has been done. (it is not assuming any starting
address)
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewKit/KernelCheck.hpp')
| -rw-r--r-- | Private/NewKit/KernelCheck.hpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Private/NewKit/KernelCheck.hpp b/Private/NewKit/KernelCheck.hpp new file mode 100644 index 00000000..9f37eb8e --- /dev/null +++ b/Private/NewKit/KernelCheck.hpp @@ -0,0 +1,60 @@ + +/* + * ======================================================== + * + * HCore + * Copyright Mahrouss Logic, all rights reserved. + * + * ======================================================== + */ + +#pragma once + +#include <NewKit/Defines.hpp> + +namespace HCore { +void ke_runtime_check(bool bExpression, const char *file, const char *line); +} + +#define MUST_PASS_COMPILER(EXPR, MSG) static_assert(EXPR, MSG) +#define __MUST_PASS(EXPR, FILE, LINE) \ + HCore::ke_runtime_check(EXPR, FILE, STRINGIFY(LINE)) +#define MUST_PASS(EXPR) __MUST_PASS(EXPR, __FILE__, __LINE__) +#define assert(EXPR) MUST_PASS(EXPR, RUNTIME_CHECK_EXPRESSION) + +enum RUNTIME_CHECK { + RUNTIME_CHECK_FAILED = -1, + RUNTIME_CHECK_POINTER = 0, + RUNTIME_CHECK_EXPRESSION, + RUNTIME_CHECK_FILE, + RUNTIME_CHECK_IPC, + RUNTIME_CHECK_TLS, + RUNTIME_CHECK_LD, + RUNTIME_CHECK_HANDSHAKE, + RUNTIME_CHECK_ACPI, + RUNTIME_CHECK_INVALID_PRIVILEGE, + RUNTIME_CHECK_PROCESS, + RUNTIME_CHECK_BAD_BEHAVIOR, + RUNTIME_CHECK_COUNT, + RUNTIME_CHECK_BOOTSTRAP, +}; + +namespace HCore { +class DumpManager final { + public: + static void Dump(void) { + // TODO: + } +}; + +void ke_stop(const Int &id); +} // namespace HCore + +#ifdef TRY +#undef TRY +#endif + +#define TRY(FN) \ + if (!FN()) { \ + MUST_PASS(false); \ + } |
