summaryrefslogtreecommitdiffhomepage
path: root/Kernel/KernelKit/HError.hpp
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-05-11 06:43:54 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-05-11 06:43:54 +0000
commitca675beb41dba8d7d16c5793b55d1672f38be3b4 (patch)
treec995ada42729ac2059a0ed87a4539d1a7e10b14a /Kernel/KernelKit/HError.hpp
parent2b4a4792abf51487ab4a16106f9376f43acf381a (diff)
parentbc57a29a24b98b00ba17710ba84ec2188ab73504 (diff)
Merged in MHR-23 (pull request #12)
MHR-23: Merge work.
Diffstat (limited to 'Kernel/KernelKit/HError.hpp')
-rw-r--r--Kernel/KernelKit/HError.hpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/Kernel/KernelKit/HError.hpp b/Kernel/KernelKit/HError.hpp
new file mode 100644
index 00000000..f4285afb
--- /dev/null
+++ b/Kernel/KernelKit/HError.hpp
@@ -0,0 +1,49 @@
+/* -------------------------------------------
+
+ Copyright SoftwareLabs
+
+------------------------------------------- */
+
+#pragma once
+
+#include <NewKit/Defines.hpp>
+
+namespace NewOS
+{
+ typedef Int32 HError;
+
+ inline constexpr HError kErrorSuccess = 0;
+ inline constexpr HError kErrorExecutable = 33;
+ inline constexpr HError kErrorExecutableLib = 34; // no such library!!!
+ inline constexpr HError kErrorFileNotFound = 35;
+ inline constexpr HError kErrorDirectoryNotFound = 36;
+ inline constexpr HError kErrorDiskReadOnly = 37;
+ inline constexpr HError kErrorDiskIsFull = 38;
+ inline constexpr HError kErrorProcessFault = 39;
+ inline constexpr HError kErrorSocketHangUp = 40;
+ inline constexpr HError kErrorThreadLocalStorage = 41;
+ inline constexpr HError kErrorMath = 42;
+ inline constexpr HError kErrorNoNetwork = 43;
+ inline constexpr HError kErrorHeapOutOfMemory = 44;
+ inline constexpr HError kErrorNoSuchDisk = 45;
+ inline constexpr HError kErrorFileExists = 46;
+ inline constexpr HError kErrorFormatFailed = 47;
+ inline constexpr HError kErrorNetworkTimeout = 48;
+ inline constexpr HError kErrorInternal = 49;
+ inline constexpr HError kErrorForkAlreadyExists = 50;
+ inline constexpr HError kErrorOutOfTeamSlot = 51;
+ inline constexpr HError kErrorHeapNotPresent = 52;
+ inline constexpr HError kErrorNoEntrypoint = 53;
+ inline constexpr HError kErrorDiskIsCorrupted = 54;
+ inline constexpr HError kErrorDisk = 55;
+ inline constexpr HError kErrorInvalidData = 56;
+ inline constexpr HError kErrorUnimplemented = 0;
+
+ Boolean ke_bug_check(void) noexcept;
+} // namespace NewOS
+
+#define DbgOk() (kLastError == NewOS::kErrorSuccess)
+#define DbgFailed() (kLastError != NewOS::kErrorSuccess)
+#define DbgLastError() kLastError
+
+inline NewOS::HError kLastError = 0;