diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-26 10:08:33 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-26 10:08:33 +0100 |
| commit | 9e746d42d2e3faa526f12ba222f5ee6924dd30f9 (patch) | |
| tree | 7f1a83f69562a2725bb9cda27c31d120640d2c1c /src/kernel/KernelKit | |
| parent | 731758b271233b9c11052001ffc20a5a2ca1f365 (diff) | |
feat! breaking API changes, use header guards and libSystem fixes.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/kernel/KernelKit')
| -rw-r--r-- | src/kernel/KernelKit/BinaryMutex.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/CodeMgr.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/Config.h | 7 | ||||
| -rw-r--r-- | src/kernel/KernelKit/CoreProcessScheduler.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/DebugOutput.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/DeviceMgr.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/IDylibObject.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/IFS.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/ILoader.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/KPC.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/KernelTaskScheduler.h | 7 | ||||
| -rw-r--r-- | src/kernel/KernelKit/LockDelegate.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PCI/DMA.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PCI/Database.h | 7 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PCI/Device.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PCI/Express.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PCI/IO.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PCI/PCI.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PE32CodeMgr.h | 7 | ||||
| -rw-r--r-- | src/kernel/KernelKit/ProcessScheduler.h | 5 | ||||
| -rw-r--r-- | src/kernel/KernelKit/ZXD.h | 5 |
21 files changed, 88 insertions, 25 deletions
diff --git a/src/kernel/KernelKit/BinaryMutex.h b/src/kernel/KernelKit/BinaryMutex.h index 0609ca9c..48dc6e50 100644 --- a/src/kernel/KernelKit/BinaryMutex.h +++ b/src/kernel/KernelKit/BinaryMutex.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_BINARYMUTEX_H +#define KERNELKIT_BINARYMUTEX_H #include <CompilerKit/CompilerKit.h> #include <KernelKit/Timer.h> @@ -39,3 +40,5 @@ class BinaryMutex final { LockedPtr fLockingProcess{nullptr}; }; } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/CodeMgr.h b/src/kernel/KernelKit/CodeMgr.h index dc08fc99..8d8bce25 100644 --- a/src/kernel/KernelKit/CodeMgr.h +++ b/src/kernel/KernelKit/CodeMgr.h @@ -12,7 +12,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_CODEMGR_H +#define KERNELKIT_CODEMGR_H #include <KernelKit/CoreProcessScheduler.h> #include <KernelKit/IPEFDylibObject.h> @@ -47,3 +48,5 @@ BOOL rtl_create_kernel_task(HAL::StackFramePtr main, const KID kid); /// @return The team's process id. ProcessID rtl_create_user_process(rtl_start_kind main, const Char* process_name); } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/Config.h b/src/kernel/KernelKit/Config.h index f0d1e106..3b185a35 100644 --- a/src/kernel/KernelKit/Config.h +++ b/src/kernel/KernelKit/Config.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_CONFIG_H +#define KERNELKIT_CONFIG_H #include <NeKit/Config.h> @@ -16,4 +17,6 @@ class UserProcessScheduler; class IDylibObject; class UserProcess; class KernelTask; -} // namespace Kernel
\ No newline at end of file +} // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/CoreProcessScheduler.h b/src/kernel/KernelKit/CoreProcessScheduler.h index efb879f8..80651905 100644 --- a/src/kernel/KernelKit/CoreProcessScheduler.h +++ b/src/kernel/KernelKit/CoreProcessScheduler.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_COREPROCESSSCHEDULER_H +#define KERNELKIT_COREPROCESSSCHEDULER_H #include <NeKit/Config.h> #include <NeKit/ErrorOr.h> @@ -248,3 +249,5 @@ struct ProcessImage final { } }; } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/DebugOutput.h b/src/kernel/KernelKit/DebugOutput.h index 0818a712..54599e95 100644 --- a/src/kernel/KernelKit/DebugOutput.h +++ b/src/kernel/KernelKit/DebugOutput.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_DEBUGOUTPUT_H +#define KERNELKIT_DEBUGOUTPUT_H #include <CompilerKit/CompilerKit.h> #include <KernelKit/DeviceMgr.h> @@ -204,3 +205,5 @@ inline TerminalDevice& operator<<(TerminalDevice& src, const Long& num) { #endif // ifdef kendl8 #define kendl8 utf_end_line() + +#endif diff --git a/src/kernel/KernelKit/DeviceMgr.h b/src/kernel/KernelKit/DeviceMgr.h index 56208140..45c5e50a 100644 --- a/src/kernel/KernelKit/DeviceMgr.h +++ b/src/kernel/KernelKit/DeviceMgr.h @@ -13,7 +13,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_DEVICEMGR_H +#define KERNELKIT_DEVICEMGR_H /* @note Device Mgr. */ /* @file KernelKit/DeviceMgr.h */ @@ -131,3 +132,5 @@ enum { kDeviceTypeCount, }; } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/IDylibObject.h b/src/kernel/KernelKit/IDylibObject.h index d834b8db..f0cb00c4 100644 --- a/src/kernel/KernelKit/IDylibObject.h +++ b/src/kernel/KernelKit/IDylibObject.h @@ -7,7 +7,8 @@ * ======================================================== */ -#pragma once +#ifndef KERNELKIT_IDYLIBOBJECT_H +#define KERNELKIT_IDYLIBOBJECT_H #include <CompilerKit/CompilerKit.h> #include <NeKit/Config.h> @@ -43,3 +44,5 @@ class IDylibObject { /// @brief Pure implementation, missing method/function handler. EXTERN_C void __ne_pure_call(void); } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/IFS.h b/src/kernel/KernelKit/IFS.h index c885d350..f62718d4 100644 --- a/src/kernel/KernelKit/IFS.h +++ b/src/kernel/KernelKit/IFS.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_IFS_H +#define KERNELKIT_IFS_H #include <KernelKit/DriveMgr.h> @@ -23,3 +24,5 @@ Int32 fs_ifs_read(IMountpoint* mnt, DriveTrait& drvTrait, Int32 drvIndex); /// @return Status code Int32 fs_ifs_write(IMountpoint* mnt, DriveTrait& drvTrait, Int32 drvIndex); } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/ILoader.h b/src/kernel/KernelKit/ILoader.h index 8a6b8bfa..dedff7ad 100644 --- a/src/kernel/KernelKit/ILoader.h +++ b/src/kernel/KernelKit/ILoader.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_ILOADER_H +#define KERNELKIT_ILOADER_H #include <CompilerKit/CompilerKit.h> #include <NeKit/Config.h> @@ -30,3 +31,5 @@ class ILoader { virtual _Output ErrorOr<VoidPtr> FindSymbol(_Input const Char*, _Input Int32) { return ErrorOr<VoidPtr>{}; } }; } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/KPC.h b/src/kernel/KernelKit/KPC.h index 4809f19f..63531f14 100644 --- a/src/kernel/KernelKit/KPC.h +++ b/src/kernel/KernelKit/KPC.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_KPC_H +#define KERNELKIT_KPC_H #include <NeKit/Config.h> @@ -77,3 +78,5 @@ inline constexpr KPCError kErrorUnimplemented = -1; /// @return if error-free: false, otherwise true. Boolean err_bug_check_raise(Void); } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/KernelTaskScheduler.h b/src/kernel/KernelKit/KernelTaskScheduler.h index a3fba2af..8564b043 100644 --- a/src/kernel/KernelKit/KernelTaskScheduler.h +++ b/src/kernel/KernelKit/KernelTaskScheduler.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_KERNELTASKSCHEDULER_H +#define KERNELKIT_KERNELTASKSCHEDULER_H /// @file KernelTaskScheduler.h /// @brief Kernel Task Scheduler backend file. @@ -46,4 +47,6 @@ class KernelTaskHelper final { STATIC ErrorOr<KID> TheCurrentKID(); STATIC SizeT StartScheduling(); }; -} // namespace Kernel
\ No newline at end of file +} // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/LockDelegate.h b/src/kernel/KernelKit/LockDelegate.h index 51f86780..c3778e19 100644 --- a/src/kernel/KernelKit/LockDelegate.h +++ b/src/kernel/KernelKit/LockDelegate.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_LOCKDELEGATE_H +#define KERNELKIT_LOCKDELEGATE_H #include <NeKit/Atom.h> #include <NeKit/Config.h> @@ -56,3 +57,5 @@ class LockDelegate final { Atom<UInt> fLockStatus; }; } // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/PCI/DMA.h b/src/kernel/KernelKit/PCI/DMA.h index d965a3c9..6ca34e0d 100644 --- a/src/kernel/KernelKit/PCI/DMA.h +++ b/src/kernel/KernelKit/PCI/DMA.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_DMA_H +#define KERNELKIT_DMA_H #include <KernelKit/DeviceMgr.h> #include <KernelKit/PCI/Device.h> @@ -73,3 +74,5 @@ class DMAFactory final { } // namespace Kernel #include <KernelKit/PCI/DMA.inl> + +#endif diff --git a/src/kernel/KernelKit/PCI/Database.h b/src/kernel/KernelKit/PCI/Database.h index 35740fdc..adde60b6 100644 --- a/src/kernel/KernelKit/PCI/Database.h +++ b/src/kernel/KernelKit/PCI/Database.h @@ -3,7 +3,8 @@ Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. ======================================== */ -#pragma once +#ifndef KERNELKIT_DATABASE_H +#define KERNELKIT_DATABASE_H #include <KernelKit/PCI/Device.h> #include <NeKit/Config.h> @@ -48,4 +49,6 @@ inline BOOL operator!=(Kernel::UChar lhs, const Kernel::Types::PciDeviceKind& rh inline BOOL operator==(Kernel::UChar lhs, const Kernel::Types::PciDeviceKind& rhs) { return lhs == (Kernel::UChar) rhs; -}
\ No newline at end of file +} + +#endif diff --git a/src/kernel/KernelKit/PCI/Device.h b/src/kernel/KernelKit/PCI/Device.h index 3e7284de..e585029d 100644 --- a/src/kernel/KernelKit/PCI/Device.h +++ b/src/kernel/KernelKit/PCI/Device.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_DEVICE_H +#define KERNELKIT_DEVICE_H #include <NeKit/Config.h> #include <NeKit/KernelPanic.h> @@ -73,3 +74,5 @@ class Device final { UInt32 fBar; }; } // namespace Kernel::PCI + +#endif diff --git a/src/kernel/KernelKit/PCI/Express.h b/src/kernel/KernelKit/PCI/Express.h index b3411938..e33f9a5d 100644 --- a/src/kernel/KernelKit/PCI/Express.h +++ b/src/kernel/KernelKit/PCI/Express.h @@ -4,9 +4,12 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_EXPRESS_H +#define KERNELKIT_EXPRESS_H #include <KernelKit/PCI/PCI.h> #include <NeKit/Config.h> #define PCI_EXPRESS_BUS_COUNT (4096) + +#endif diff --git a/src/kernel/KernelKit/PCI/IO.h b/src/kernel/KernelKit/PCI/IO.h index dc9f9aa1..65cbf28e 100644 --- a/src/kernel/KernelKit/PCI/IO.h +++ b/src/kernel/KernelKit/PCI/IO.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_IO_H +#define KERNELKIT_IO_H #include <ArchKit/ArchKit.h> #include <NeKit/Array.h> @@ -61,3 +62,5 @@ inline Array<UShort, Sz> make_ports(UShort base) { #else #error Please provide platform specific code for the I/O #endif // ifdef __NE_AMD64__ + +#endif diff --git a/src/kernel/KernelKit/PCI/PCI.h b/src/kernel/KernelKit/PCI/PCI.h index a60145fd..d57478e8 100644 --- a/src/kernel/KernelKit/PCI/PCI.h +++ b/src/kernel/KernelKit/PCI/PCI.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_PCI_H +#define KERNELKIT_PCI_H #include <NeKit/Config.h> @@ -52,3 +53,5 @@ class BAR { Detail::BAR BAR5; }; } // namespace Kernel::PCI + +#endif diff --git a/src/kernel/KernelKit/PE32CodeMgr.h b/src/kernel/KernelKit/PE32CodeMgr.h index 3e359a7c..d5af331c 100644 --- a/src/kernel/KernelKit/PE32CodeMgr.h +++ b/src/kernel/KernelKit/PE32CodeMgr.h @@ -11,7 +11,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_PE32CODEMGR_H +#define KERNELKIT_PE32CODEMGR_H //////////////////////////////////////////////////// @@ -85,4 +86,6 @@ using PE_SECTION_INFO = LDR_SECTION_HEADER; ProcessID rtl_create_user_process(PE32Loader& exec, const UserProcess::ExecutableKind& process_kind); -} // namespace Kernel
\ No newline at end of file +} // namespace Kernel + +#endif diff --git a/src/kernel/KernelKit/ProcessScheduler.h b/src/kernel/KernelKit/ProcessScheduler.h index 74a238f1..d093871b 100644 --- a/src/kernel/KernelKit/ProcessScheduler.h +++ b/src/kernel/KernelKit/ProcessScheduler.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_PROCESSSCHEDULER_H +#define KERNELKIT_PROCESSSCHEDULER_H #include <KernelKit/KernelTaskScheduler.h> #include <KernelKit/UserProcessScheduler.h> @@ -16,4 +17,6 @@ inline UserProcessTeam kHighUserTeam; inline UserProcessTeam kMidUserTeam; inline UserProcessTeam kRTUserTeam; } // namespace Kernel +#endif + #endif
\ No newline at end of file diff --git a/src/kernel/KernelKit/ZXD.h b/src/kernel/KernelKit/ZXD.h index 1ead7b1f..b7d723d6 100644 --- a/src/kernel/KernelKit/ZXD.h +++ b/src/kernel/KernelKit/ZXD.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef KERNELKIT_ZXD_H +#define KERNELKIT_ZXD_H #include <NeKit/Config.h> @@ -57,3 +58,5 @@ inline constexpr auto kProsanName = ".pros"; using ZxdExecPtr = ZxdExec*; using ZxdStubPtr = ZxdStub*; } // namespace Kernel + +#endif |
