diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-10 22:38:24 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-10 22:38:24 +0100 |
| commit | 076c8378e96a9fac9864c9d02bb63fa7dd423e4a (patch) | |
| tree | f48cd96b3dd3026ab69bf78f9d7c599cd40cd0f8 | |
| parent | 8ea5c74d86db0b24326362d53a935cfbba455260 (diff) | |
chore: using more header guards than pragma once.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | docs/tex/binary_mutex.tex | 2 | ||||
| -rw-r--r-- | src/kernel/KernelKit/BinaryMutex.h | 2 | ||||
| -rw-r--r-- | src/kernel/KernelKit/KernelTaskScheduler.h | 2 | ||||
| -rw-r--r-- | src/kernel/KernelKit/MSDOS.h | 6 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PE32CodeMgr.h | 2 | ||||
| -rw-r--r-- | src/kernel/KernelKit/PEFCodeMgr.h | 2 | ||||
| -rw-r--r-- | src/kernel/KernelKit/ProcessScheduler.h | 1 | ||||
| -rw-r--r-- | src/kernel/KernelKit/Semaphore.h | 7 | ||||
| -rw-r--r-- | src/kernel/KernelKit/ThreadLocalStorage.h | 6 | ||||
| -rw-r--r-- | src/kernel/KernelKit/ThreadLocalStorage.inl | 2 | ||||
| -rw-r--r-- | src/kernel/KernelKit/Timer.h | 19 | ||||
| -rw-r--r-- | src/kernel/KernelKit/TraceSrv.h | 7 | ||||
| -rw-r--r-- | src/kernel/KernelKit/UserMgr.h | 6 | ||||
| -rw-r--r-- | src/kernel/KernelKit/UserProcessScheduler.h | 8 | ||||
| -rw-r--r-- | src/kernel/KernelKit/UserProcessScheduler.inl | 4 | ||||
| -rw-r--r-- | src/kernel/src/BinaryMutex.cc | 2 | ||||
| -rw-r--r-- | src/kernel/src/Timer.cc | 2 |
17 files changed, 45 insertions, 35 deletions
diff --git a/docs/tex/binary_mutex.tex b/docs/tex/binary_mutex.tex index b326f4b4..548f440f 100644 --- a/docs/tex/binary_mutex.tex +++ b/docs/tex/binary_mutex.tex @@ -51,7 +51,7 @@ class BinaryMutex final { public: bool Lock(UserProcess* process); - bool LockAndWait(UserProcess* process, TimerInterface* timer); + bool LockAndWait(UserProcess* process, ITimer* timer); public: NE_COPY_DEFAULT(BinaryMutex) diff --git a/src/kernel/KernelKit/BinaryMutex.h b/src/kernel/KernelKit/BinaryMutex.h index 12dc7d15..0609ca9c 100644 --- a/src/kernel/KernelKit/BinaryMutex.h +++ b/src/kernel/KernelKit/BinaryMutex.h @@ -30,7 +30,7 @@ class BinaryMutex final { public: bool Lock(LockedPtr process); - bool LockAndWait(LockedPtr process, TimerInterface* timer); + bool LockAndWait(LockedPtr process, ITimer* timer); public: NE_COPY_DEFAULT(BinaryMutex) diff --git a/src/kernel/KernelKit/KernelTaskScheduler.h b/src/kernel/KernelKit/KernelTaskScheduler.h index 714a4fa7..a7fd97e1 100644 --- a/src/kernel/KernelKit/KernelTaskScheduler.h +++ b/src/kernel/KernelKit/KernelTaskScheduler.h @@ -7,7 +7,7 @@ #pragma once /// @file KernelTaskScheduler.h -/// @brief Kernel Task Scheduler header file. +/// @brief Kernel Task Scheduler backend file. /// @author Amlal El Mahrouss (amlal@nekernel.org) #include <ArchKit/ArchKit.h> diff --git a/src/kernel/KernelKit/MSDOS.h b/src/kernel/KernelKit/MSDOS.h index 4413eb3e..bbc9e1d7 100644 --- a/src/kernel/KernelKit/MSDOS.h +++ b/src/kernel/KernelKit/MSDOS.h @@ -11,8 +11,8 @@ ======================================== */ -#ifndef __MSDOS_EXEC__ -#define __MSDOS_EXEC__ +#ifndef __KERNEL_KIT_MSDOS_H__ +#define __KERNEL_KIT_MSDOS_H__ #include <KernelKit/PE.h> #include <NeKit/Config.h> @@ -48,4 +48,4 @@ typedef struct _DosHeader { DosLong eLfanew; } DosHeader, *DosHeaderPtr; -#endif /* ifndef __MSDOS_EXEC__ */ +#endif /* ifndef __KERNEL_KIT_MSDOS_H__ */ diff --git a/src/kernel/KernelKit/PE32CodeMgr.h b/src/kernel/KernelKit/PE32CodeMgr.h index 38ebce72..03a68363 100644 --- a/src/kernel/KernelKit/PE32CodeMgr.h +++ b/src/kernel/KernelKit/PE32CodeMgr.h @@ -25,7 +25,7 @@ #include <NeKit/ErrorOr.h> #include <NeKit/KString.h> -#ifndef INC_PROCESS_SCHEDULER_H +#ifndef __KERNEL_KIT_USER_PROCESS_SCHEDULER_H__ #include <KernelKit/ProcessScheduler.h> #endif diff --git a/src/kernel/KernelKit/PEFCodeMgr.h b/src/kernel/KernelKit/PEFCodeMgr.h index d076adca..f7b6672a 100644 --- a/src/kernel/KernelKit/PEFCodeMgr.h +++ b/src/kernel/KernelKit/PEFCodeMgr.h @@ -16,7 +16,7 @@ #include <NeKit/ErrorOr.h> #include <NeKit/KString.h> -#ifndef INC_PROCESS_SCHEDULER_H +#ifndef __KERNEL_KIT_USER_PROCESS_SCHEDULER_H__ #include <KernelKit/ProcessScheduler.h> #endif diff --git a/src/kernel/KernelKit/ProcessScheduler.h b/src/kernel/KernelKit/ProcessScheduler.h index 7414e4fe..74a238f1 100644 --- a/src/kernel/KernelKit/ProcessScheduler.h +++ b/src/kernel/KernelKit/ProcessScheduler.h @@ -14,5 +14,6 @@ namespace Kernel { inline UserProcessTeam kLowUserTeam; inline UserProcessTeam kHighUserTeam; inline UserProcessTeam kMidUserTeam; +inline UserProcessTeam kRTUserTeam; } // namespace Kernel #endif
\ No newline at end of file diff --git a/src/kernel/KernelKit/Semaphore.h b/src/kernel/KernelKit/Semaphore.h index e10c1c2e..ecfdb6a9 100644 --- a/src/kernel/KernelKit/Semaphore.h +++ b/src/kernel/KernelKit/Semaphore.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef __KERNEL_KIT_TLS_H__ +#define __KERNEL_KIT_TLS_H__ /// @author Amlal El Mahrouss /// @file Semaphore.h @@ -107,4 +108,6 @@ inline BOOL rtl_sem_wait(SemaphoreArr& sem, UInt64 owner, UInt64 timeout, return FALSE; // Failed to acquire semaphore } -} // namespace Kernel
\ No newline at end of file +} // namespace Kernel + +#endif // !__KERNEL_KIT_TLS_H__
\ No newline at end of file diff --git a/src/kernel/KernelKit/ThreadLocalStorage.h b/src/kernel/KernelKit/ThreadLocalStorage.h index 38bcb54e..65baf8ee 100644 --- a/src/kernel/KernelKit/ThreadLocalStorage.h +++ b/src/kernel/KernelKit/ThreadLocalStorage.h @@ -4,8 +4,8 @@ ======================================== */ -#ifndef KERNELKIT_TLS_H -#define KERNELKIT_TLS_H +#ifndef __KERNEL_KIT_TLS_H__ +#define __KERNEL_KIT_TLS_H__ #include <NeKit/Config.h> #include <NeKit/ErrorOr.h> @@ -65,4 +65,4 @@ EXTERN_C Kernel::Bool tls_check_syscall_impl(Kernel::VoidPtr TIB); // last rev 7/7/24 -#endif /* ifndef KERNELKIT_TLS_H */ +#endif /* ifndef __KERNEL_KIT_TLS_H__ */ diff --git a/src/kernel/KernelKit/ThreadLocalStorage.inl b/src/kernel/KernelKit/ThreadLocalStorage.inl index c3c96c30..8e33cff3 100644 --- a/src/kernel/KernelKit/ThreadLocalStorage.inl +++ b/src/kernel/KernelKit/ThreadLocalStorage.inl @@ -7,7 +7,7 @@ //! @file ThreadLocalStorage.inl //! @brief Allocate resources from the process's heap storage. -#ifndef INC_PROCESS_SCHEDULER_H +#ifndef __KERNEL_KIT_USER_PROCESS_SCHEDULER_H__ #include <KernelKit/ProcessScheduler.h> #endif diff --git a/src/kernel/KernelKit/Timer.h b/src/kernel/KernelKit/Timer.h index 605cd0fa..97bc5891 100644 --- a/src/kernel/KernelKit/Timer.h +++ b/src/kernel/KernelKit/Timer.h @@ -4,31 +4,32 @@ ======================================== */ -#pragma once +#ifndef __KERNEL_KIT_TIMER_H__ +#define __KERNEL_KIT_TIMER_H__ #include <ArchKit/ArchKit.h> #include <KernelKit/KPC.h> namespace Kernel { class SoftwareTimer; -class TimerInterface; +class ITimer; inline constexpr Int16 kTimeUnit = 1000; -class TimerInterface { +class ITimer { public: /// @brief Default constructor - explicit TimerInterface() = default; - virtual ~TimerInterface() = default; + explicit ITimer() = default; + virtual ~ITimer() = default; public: - NE_COPY_DEFAULT(TimerInterface) + NE_COPY_DEFAULT(ITimer) public: virtual BOOL Wait(); }; -class SoftwareTimer final : public TimerInterface { +class SoftwareTimer final : public ITimer { public: explicit SoftwareTimer(Int64 seconds); ~SoftwareTimer() override; @@ -44,7 +45,7 @@ class SoftwareTimer final : public TimerInterface { Int64 fWaitFor{0}; }; -class HardwareTimer final : public TimerInterface { +class HardwareTimer final : public ITimer { public: explicit HardwareTimer(UInt64 seconds); ~HardwareTimer() override; @@ -73,3 +74,5 @@ inline UInt64 rtl_milliseconds(UInt64 time) { return time; } } // namespace Kernel + +#endif // !__KERNEL_KIT_TIMER_H__
\ No newline at end of file diff --git a/src/kernel/KernelKit/TraceSrv.h b/src/kernel/KernelKit/TraceSrv.h index a874cc39..6a4dbc97 100644 --- a/src/kernel/KernelKit/TraceSrv.h +++ b/src/kernel/KernelKit/TraceSrv.h @@ -5,7 +5,8 @@ ======================================== */ -#pragma once +#ifndef __KERNELKIT_TRACESRV_H__ +#define __KERNELKIT_TRACESRV_H__ #include <CompilerKit/CompilerKit.h> @@ -20,4 +21,6 @@ namespace Detail { using dk_socket_type = UInt64; } // namespace Detail -} // namespace Kernel
\ No newline at end of file +} // namespace Kernel + +#endif // !__KERNELKIT_TRACESRV_H__
\ No newline at end of file diff --git a/src/kernel/KernelKit/UserMgr.h b/src/kernel/KernelKit/UserMgr.h index 3b48f686..77356aae 100644 --- a/src/kernel/KernelKit/UserMgr.h +++ b/src/kernel/KernelKit/UserMgr.h @@ -4,8 +4,8 @@ ======================================== */ -#ifndef INC_USER_H -#define INC_USER_H +#ifndef __KERNEL_KIT_USER_MGR_H__ +#define __KERNEL_KIT_USER_MGR_H__ /* ======================================== @@ -92,4 +92,4 @@ inline User* kCurrentUser = nullptr; inline User* kRootUser = nullptr; } // namespace Kernel -#endif /* ifndef INC_USER_H */ +#endif /* ifndef __KERNEL_KIT_USER_MGR_H__ */ diff --git a/src/kernel/KernelKit/UserProcessScheduler.h b/src/kernel/KernelKit/UserProcessScheduler.h index 859dd9e5..6caf3167 100644 --- a/src/kernel/KernelKit/UserProcessScheduler.h +++ b/src/kernel/KernelKit/UserProcessScheduler.h @@ -4,11 +4,11 @@ ======================================== */ -#ifndef INC_PROCESS_SCHEDULER_H -#define INC_PROCESS_SCHEDULER_H +#ifndef __KERNEL_KIT_USER_PROCESS_SCHEDULER_H__ +#define __KERNEL_KIT_USER_PROCESS_SCHEDULER_H__ /// @file UserProcessScheduler.h -/// @brief User Process Scheduler header file. +/// @brief User Process Scheduler backend file. /// @author Amlal El Mahrouss (amlal@nekernel.org) #include <ArchKit/ArchKit.h> @@ -244,4 +244,4 @@ class UserProcessHelper final { // END //////////////////////////////////////////////////// -#endif /* ifndef INC_PROCESS_SCHEDULER_H */ +#endif /* ifndef __KERNEL_KIT_USER_PROCESS_SCHEDULER_H__ */ diff --git a/src/kernel/KernelKit/UserProcessScheduler.inl b/src/kernel/KernelKit/UserProcessScheduler.inl index 2ed960d5..625cadc8 100644 --- a/src/kernel/KernelKit/UserProcessScheduler.inl +++ b/src/kernel/KernelKit/UserProcessScheduler.inl @@ -11,9 +11,9 @@ /// @author Amlal El Mahrouss (amlal@nekernel.org) /// @date Tue Apr 22 22:01:07 CEST 2025 -#ifndef INC_PROCESS_SCHEDULER_H +#ifndef __KERNEL_KIT_USER_PROCESS_SCHEDULER_H__ #include <KernelKit/UserProcessScheduler.h> -#endif // INC_PROCESS_SCHEDULER_H +#endif // __KERNEL_KIT_USER_PROCESS_SCHEDULER_H__ namespace Kernel { /***********************************************************************************/ diff --git a/src/kernel/src/BinaryMutex.cc b/src/kernel/src/BinaryMutex.cc index bfecfb53..2d25ceea 100644 --- a/src/kernel/src/BinaryMutex.cc +++ b/src/kernel/src/BinaryMutex.cc @@ -46,7 +46,7 @@ Bool BinaryMutex::IsLocked() const { /// @brief Try lock or wait. /***********************************************************************************/ -Bool BinaryMutex::LockAndWait(UserProcess* process, TimerInterface* timer) { +Bool BinaryMutex::LockAndWait(UserProcess* process, ITimer* timer) { if (timer == nullptr) return No; this->Lock(process); diff --git a/src/kernel/src/Timer.cc b/src/kernel/src/Timer.cc index ecfc8e08..6f8cfc5a 100644 --- a/src/kernel/src/Timer.cc +++ b/src/kernel/src/Timer.cc @@ -14,6 +14,6 @@ using namespace Kernel; /// @brief Unimplemented as it is an interface. -BOOL TimerInterface::Wait() { +BOOL ITimer::Wait() { return NO; } |
