summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/KernelKit/LPC.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:13:48 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:15:17 +0100
commita13e1c0911c0627184bc38f18c7fdda64447b3ad (patch)
tree073a62c09bf216e85a3f310376640fa1805147f9 /dev/kernel/KernelKit/LPC.h
parent149fa096eb306d03686b3b67e813cf1a78e08cd0 (diff)
meta(kernel): Reworked repository's filesystem structure.
Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/kernel/KernelKit/LPC.h')
-rw-r--r--dev/kernel/KernelKit/LPC.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/dev/kernel/KernelKit/LPC.h b/dev/kernel/KernelKit/LPC.h
new file mode 100644
index 00000000..d76eeff1
--- /dev/null
+++ b/dev/kernel/KernelKit/LPC.h
@@ -0,0 +1,70 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+
+------------------------------------------- */
+
+#pragma once
+
+#include <NewKit/Defines.h>
+
+/// @file LPC.h
+/// @brief Local Process Codes.
+
+#define err_local_ok() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() == NeOS::kErrorSuccess)
+#define err_local_fail() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() != NeOS::kErrorSuccess)
+#define err_local_get() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode())
+
+#define err_global_ok() (NeOS::kErrorLocalNumber == NeOS::kErrorSuccess)
+#define err_global_fail() (NeOS::kErrorLocalNumber != NeOS::kErrorSuccess)
+#define err_global_get() (NeOS::kErrorLocalNumber)
+
+namespace NeOS
+{
+ typedef Int32 HError;
+
+ inline HError kErrorLocalNumber = 0UL;
+
+ inline constexpr HError kErrorSuccess = 0;
+ inline constexpr HError kErrorExecutable = 33;
+ inline constexpr HError kErrorExecutableLib = 34;
+ 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 kErrorAsync = 57;
+ inline constexpr HError kErrorNonBlocking = 58;
+ inline constexpr HError kErrorIPC = 59;
+ inline constexpr HError kErrorSign = 60;
+ inline constexpr HError kErrorInvalidCreds = 61;
+ inline constexpr HError kErrorCDTrayBroken = 62;
+ inline constexpr HError kErrorUnrecoverableDisk = 63;
+ inline constexpr HError kErrorFileLocked = 64;
+ inline constexpr HError kErrorUnimplemented = -1;
+
+ /// @brief Raises a bug check stop code.
+ Void err_bug_check_raise(Void) noexcept;
+
+ /// @brief Does a system wide bug check.
+ /// @param void no params are needed.
+ /// @return if error-free: false, otherwise true.
+ Boolean err_bug_check(Void) noexcept;
+} // namespace NeOS