From b3e76bf866b4223390585589786600475c9fdcae Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 15 Mar 2024 08:03:35 +0100 Subject: API: Inconsitency fix. Signed-off-by: Amlal El Mahrouss --- Private/KernelKit/DebugOutput.hpp | 2 +- Private/KernelKit/DriveManager.hpp | 9 +++++---- Private/KernelKit/FileManager.hpp | 2 +- Private/KernelKit/Loader.hpp | 29 ----------------------------- Private/KernelKit/LoaderInterface.hpp | 30 ++++++++++++++++++++++++++++++ Private/KernelKit/PEF.hpp | 4 ++-- Private/KernelKit/PEFCodeManager.hxx | 4 ++-- Private/KernelKit/PEFSharedObject.hxx | 2 +- Private/KernelKit/PermissionSelector.hxx | 2 +- Private/KernelKit/SMPManager.hpp | 2 +- Private/KernelKit/Semaphore.hpp | 2 +- Private/KernelKit/Timer.hpp | 2 +- 12 files changed, 46 insertions(+), 44 deletions(-) delete mode 100644 Private/KernelKit/Loader.hpp create mode 100644 Private/KernelKit/LoaderInterface.hpp (limited to 'Private/KernelKit') diff --git a/Private/KernelKit/DebugOutput.hpp b/Private/KernelKit/DebugOutput.hpp index 683c0903..75031687 100644 --- a/Private/KernelKit/DebugOutput.hpp +++ b/Private/KernelKit/DebugOutput.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include #include #include diff --git a/Private/KernelKit/DriveManager.hpp b/Private/KernelKit/DriveManager.hpp index 6cfb007b..027c9391 100644 --- a/Private/KernelKit/DriveManager.hpp +++ b/Private/KernelKit/DriveManager.hpp @@ -7,7 +7,7 @@ #ifndef __DRIVE_MANAGER__ #define __DRIVE_MANAGER__ -#include +#include #include #include #include @@ -37,7 +37,7 @@ typedef Int64 rt_drive_id_type; struct DriveTraits final { Char fName[kDriveNameLen]; // /System, /Boot, //./Devices/USB... Int32 fKind; // fMassStorage, fFloppy, fOpticalDisc. - rt_drive_id_type fId; // Drive id. + rt_drive_id_type fId; // Drive id. Int32 fFlags; // fReadOnly, fXPMDrive, fXPTDrive //! for StorageKit. @@ -61,7 +61,8 @@ typedef DriveDevice* DriveDevicePtr; /** * @brief Abstracted hard-drive container class. - * @note This class has all of it's drive set to nullptr, allocate them using GetAddressOf(index). + * @note This class has all of it's drive set to nullptr, allocate them using + * GetAddressOf(index). */ class Mountpoint final { public: @@ -91,7 +92,7 @@ class Mountpoint final { default: { DbgLastError() = kErrorNoSuchDisk; kcout << "HCoreKrnl\\Mountpoint: Check HError.\n"; - + break; } } diff --git a/Private/KernelKit/FileManager.hpp b/Private/KernelKit/FileManager.hpp index 4b4a63a4..22c229db 100644 --- a/Private/KernelKit/FileManager.hpp +++ b/Private/KernelKit/FileManager.hpp @@ -18,7 +18,7 @@ #include #endif // __FSKIT_NEWFS__ -#include +#include #include #include #include diff --git a/Private/KernelKit/Loader.hpp b/Private/KernelKit/Loader.hpp deleted file mode 100644 index fb97c3a4..00000000 --- a/Private/KernelKit/Loader.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace HCore { -/// This interface is used to make loader contracts (MSCOFF, PEF). -class Loader { - public: - explicit Loader() = default; - virtual ~Loader() = default; - - HCORE_COPY_DEFAULT(Loader); - - public: - virtual const char* Format() = 0; - virtual const char* MIME() = 0; - virtual const char* Path() = 0; - virtual ErrorOr LoadStart() = 0; - virtual VoidPtr FindSymbol(const char* name, Int32 kind) = 0; -}; -} // namespace HCore diff --git a/Private/KernelKit/LoaderInterface.hpp b/Private/KernelKit/LoaderInterface.hpp new file mode 100644 index 00000000..a19ba483 --- /dev/null +++ b/Private/KernelKit/LoaderInterface.hpp @@ -0,0 +1,30 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace HCore { +/// @brief This interface is used to make loader contracts (MSCOFF, PEF). +/// @author @Amlal-El-Mahrouss +class LoaderInterface { + public: + explicit LoaderInterface() = default; + virtual ~LoaderInterface() = default; + + HCORE_COPY_DEFAULT(LoaderInterface); + + public: + virtual const char* Format() = 0; + virtual const char* MIME() = 0; + virtual const char* Path() = 0; + virtual ErrorOr FindStart() = 0; + virtual VoidPtr FindSymbol(const char* name, Int32 kind) = 0; +}; +} // namespace HCore diff --git a/Private/KernelKit/PEF.hpp b/Private/KernelKit/PEF.hpp index 69919f93..e1750242 100644 --- a/Private/KernelKit/PEF.hpp +++ b/Private/KernelKit/PEF.hpp @@ -14,8 +14,8 @@ #ifndef __PEF__ #define __PEF__ -#include -#include +#include +#include #include #define kPefMagic "PEF" diff --git a/Private/KernelKit/PEFCodeManager.hxx b/Private/KernelKit/PEFCodeManager.hxx index 73bc8ea3..e952d40f 100644 --- a/Private/KernelKit/PEFCodeManager.hxx +++ b/Private/KernelKit/PEFCodeManager.hxx @@ -18,7 +18,7 @@ namespace HCore { /// \name PEFLoader /// \brief PEF loader class. /// -class PEFLoader : public Loader { +class PEFLoader : public LoaderInterface { private: explicit PEFLoader() = delete; @@ -39,7 +39,7 @@ class PEFLoader : public Loader { const char *MIME() override; public: - ErrorOr LoadStart() override; + ErrorOr FindStart() override; VoidPtr FindSymbol(const char *name, Int32 kind) override; public: diff --git a/Private/KernelKit/PEFSharedObject.hxx b/Private/KernelKit/PEFSharedObject.hxx index 263f08f4..becac43e 100644 --- a/Private/KernelKit/PEFSharedObject.hxx +++ b/Private/KernelKit/PEFSharedObject.hxx @@ -10,7 +10,7 @@ #ifndef __KERNELKIT_SHARED_OBJECT_HXX__ #define __KERNELKIT_SHARED_OBJECT_HXX__ -#include +#include #include #include #include diff --git a/Private/KernelKit/PermissionSelector.hxx b/Private/KernelKit/PermissionSelector.hxx index 477e0f0c..c5a55fee 100644 --- a/Private/KernelKit/PermissionSelector.hxx +++ b/Private/KernelKit/PermissionSelector.hxx @@ -7,7 +7,7 @@ #ifndef _INC_PERMISSION_SEL_HPP #define _INC_PERMISSION_SEL_HPP -#include +#include #include // kernel mode user. diff --git a/Private/KernelKit/SMPManager.hpp b/Private/KernelKit/SMPManager.hpp index 465ff1fc..49406f1b 100644 --- a/Private/KernelKit/SMPManager.hpp +++ b/Private/KernelKit/SMPManager.hpp @@ -8,7 +8,7 @@ #define _INC_SMP_MANAGER_HPP #include -#include +#include #include // Last Rev diff --git a/Private/KernelKit/Semaphore.hpp b/Private/KernelKit/Semaphore.hpp index 8897a135..6be56f21 100644 --- a/Private/KernelKit/Semaphore.hpp +++ b/Private/KernelKit/Semaphore.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace HCore { diff --git a/Private/KernelKit/Timer.hpp b/Private/KernelKit/Timer.hpp index ddfac06a..f60f6e0e 100644 --- a/Private/KernelKit/Timer.hpp +++ b/Private/KernelKit/Timer.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include #include -- cgit v1.2.3