NeKernel dev
Loading...
Searching...
No Matches
KPC.h
Go to the documentation of this file.
1/* ========================================
2
3 Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
4
5======================================== */
6
7#pragma once
8
9#include <NeKit/Config.h>
10
13
14#define err_local_ok() \
15 (Kernel::UserProcessScheduler::The().TheCurrentProcess().Leak().GetLocalCode() == \
16 Kernel::kErrorSuccess)
17#define err_local_fail() \
18 (Kernel::UserProcessScheduler::The().TheCurrentProcess().Leak().GetLocalCode() != \
19 Kernel::kErrorSuccess)
20#define err_local_get() \
21 (Kernel::UserProcessScheduler::The().TheCurrentProcess().Leak().GetLocalCode())
22
23#define err_global_ok() (Kernel::kErrorLocalNumber == Kernel::kErrorSuccess)
24#define err_global_fail() (Kernel::kErrorLocalNumber != Kernel::kErrorSuccess)
25#define err_global_get() (Kernel::kErrorLocalNumber)
26
27namespace Kernel {
29
31
32inline constexpr KPCError kErrorSuccess = 0;
33inline constexpr KPCError kErrorExecutable = 33;
34inline constexpr KPCError kErrorExecutableLib = 34;
35inline constexpr KPCError kErrorFileNotFound = 35;
36inline constexpr KPCError kErrorDirectoryNotFound = 36;
37inline constexpr KPCError kErrorDiskReadOnly = 37;
38inline constexpr KPCError kErrorDiskIsFull = 38;
39inline constexpr KPCError kErrorProcessFault = 39;
40inline constexpr KPCError kErrorSocketHangUp = 40;
41inline constexpr KPCError kErrorThreadLocalStorage = 41;
42inline constexpr KPCError kErrorMath = 42;
43inline constexpr KPCError kErrorNoNetwork = 43;
44inline constexpr KPCError kErrorHeapOutOfMemory = 44;
45inline constexpr KPCError kErrorNoSuchDisk = 45;
46inline constexpr KPCError kErrorFileExists = 46;
47inline constexpr KPCError kErrorFormatFailed = 47;
48inline constexpr KPCError kErrorNetworkTimeout = 48;
49inline constexpr KPCError kErrorInternal = 49;
50inline constexpr KPCError kErrorForkAlreadyExists = 50;
51inline constexpr KPCError kErrorOutOfTeamSlot = 51;
52inline constexpr KPCError kErrorHeapNotPresent = 52;
53inline constexpr KPCError kErrorNoEntrypoint = 53;
54inline constexpr KPCError kErrorDiskIsCorrupted = 54;
55inline constexpr KPCError kErrorDisk = 55;
56inline constexpr KPCError kErrorInvalidData = 56;
57inline constexpr KPCError kErrorAsync = 57;
58inline constexpr KPCError kErrorNonBlocking = 58;
59inline constexpr KPCError kErrorIPC = 59;
60inline constexpr KPCError kErrorSign = 60;
61inline constexpr KPCError kErrorInvalidCreds = 61;
62inline constexpr KPCError kErrorCDTrayBroken = 62;
63inline constexpr KPCError kErrorUnrecoverableDisk = 63;
64inline constexpr KPCError kErrorFileLocked = 64;
65inline constexpr KPCError kErrorDiskIsTooTiny = 65;
66inline constexpr KPCError kErrorDmaExhausted = 66;
67inline constexpr KPCError kErrorOutOfBitMapMemory = 67;
68inline constexpr KPCError kErrorTimeout = 68;
69inline constexpr KPCError kErrorAccessDenied = 69;
70inline constexpr KPCError kErrorUnavailable = 70;
72inline constexpr KPCError kErrorUnimplemented = -1;
73
78} // namespace Kernel
UPS inline definitions.
Definition Device.h:12
constexpr KPCError kErrorDiskIsCorrupted
Definition KPC.h:54
constexpr KPCError kErrorProcessFault
Definition KPC.h:39
void Void
Definition Config.h:87
constexpr KPCError kErrorHeapOutOfMemory
Definition KPC.h:44
constexpr KPCError kErrorSign
Definition KPC.h:60
constexpr KPCError kErrorDirectoryNotFound
Definition KPC.h:36
constexpr KPCError kErrorSuccess
Definition KPC.h:32
constexpr KPCError kErrorOutOfTeamSlot
Definition KPC.h:51
constexpr KPCError kErrorAsync
Definition KPC.h:57
constexpr KPCError kErrorNonBlocking
Definition KPC.h:58
constexpr KPCError kErrorNoEntrypoint
Definition KPC.h:53
constexpr KPCError kErrorNoSuchDisk
Definition KPC.h:45
constexpr KPCError kErrorDiskReadOnly
Definition KPC.h:37
constexpr KPCError kErrorDiskIsFull
Definition KPC.h:38
constexpr KPCError kErrorIPC
Definition KPC.h:59
constexpr KPCError kErrorUnavailable
Definition KPC.h:70
constexpr KPCError kErrorThreadLocalStorage
Definition KPC.h:41
constexpr KPCError kErrorInternal
Definition KPC.h:49
constexpr KPCError kErrorMath
Definition KPC.h:42
constexpr KPCError kErrorNetworkTimeout
Definition KPC.h:48
constexpr KPCError kErrorCDTrayBroken
Definition KPC.h:62
constexpr KPCError kErrorExecutable
Definition KPC.h:33
constexpr KPCError kErrorDmaExhausted
Definition KPC.h:66
constexpr KPCError kErrorInvalidCreds
Definition KPC.h:61
constexpr KPCError kErrorHeapNotPresent
Definition KPC.h:52
constexpr KPCError kErrorFileLocked
Definition KPC.h:64
constexpr KPCError kErrorInvalidData
Definition KPC.h:56
__INT32_TYPE__ Int32
Definition Config.h:38
constexpr KPCError kErrorDiskIsTooTiny
Definition KPC.h:65
constexpr KPCError kErrorUnrecoverableDisk
Definition KPC.h:63
constexpr KPCError kErrorSocketHangUp
Definition KPC.h:40
constexpr KPCError kErrorUnimplemented
Generic errors.
Definition KPC.h:72
constexpr KPCError kErrorFormatFailed
Definition KPC.h:47
Int32 KPCError
Definition KPC.h:28
constexpr KPCError kErrorDisk
Definition KPC.h:55
constexpr KPCError kErrorOutOfBitMapMemory
Definition KPC.h:67
bool Boolean
Definition Config.h:49
constexpr KPCError kErrorNoNetwork
Definition KPC.h:43
constexpr KPCError kErrorExecutableLib
Definition KPC.h:34
constexpr KPCError kErrorAccessDenied
Definition KPC.h:69
constexpr KPCError kErrorTimeout
Definition KPC.h:68
Boolean err_bug_check_raise(Void)
Does a system wide bug check.
Definition KPC.cc:17
constexpr KPCError kErrorForkAlreadyExists
Definition KPC.h:50
KPCError kErrorLocalNumber
Definition KPC.h:30
constexpr KPCError kErrorFileNotFound
Definition KPC.h:35
constexpr KPCError kErrorFileExists
Definition KPC.h:46