summaryrefslogtreecommitdiffhomepage
path: root/Private/Source
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-29 15:14:37 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-29 15:14:37 +0100
commitb89b9bc8ec4955f3eef3d34a4c917ace0a5cf2d9 (patch)
tree4d82f613f7e2fbb306fb9ab8b86506b4334ebeee /Private/Source
parente8af9b5cdc8efd7eee7a53c6fd78918fa2b0a810 (diff)
Bootloader: Add support for Boot Services.
Kernel: Did refactor to code in Drive Manager, XPM has become EPM. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Source')
-rw-r--r--Private/Source/DriveManager.cxx76
1 files changed, 38 insertions, 38 deletions
diff --git a/Private/Source/DriveManager.cxx b/Private/Source/DriveManager.cxx
index fa3deec1..be35e275 100644
--- a/Private/Source/DriveManager.cxx
+++ b/Private/Source/DriveManager.cxx
@@ -12,51 +12,51 @@
namespace hCore
{
- DriveSelector::DriveSelector() : fDrive(nullptr) {}
-
- DriveSelector::~DriveSelector()
- {
- if (fDrive)
- {
- this->Unmount();
- }
- }
-
- DriveTraits& DriveSelector::GetMounted()
+DriveSelector::DriveSelector() : fDrive(nullptr)
+{
+}
+
+DriveSelector::~DriveSelector()
+{
+ if (fDrive)
{
- MUST_PASS(fDrive != nullptr);
- return *fDrive;
+ this->Unmount();
}
-
- bool DriveSelector::Mount(DriveTraits* drive)
+}
+
+DriveTraits &DriveSelector::GetMounted()
+{
+ MUST_PASS(fDrive != nullptr);
+ return *fDrive;
+}
+
+bool DriveSelector::Mount(DriveTraits *drive)
+{
+ if (drive && drive->fReady() && fDrive == nullptr)
{
- if (drive &&
- drive->fReady() &&
- fDrive == nullptr)
- {
- fDrive = drive;
- fDrive->fMount();
-
- kcout << "[Mount] Mount drive: " << fDrive->fName << "\n";
-
- return true;
- }
-
- return false;
+ fDrive = drive;
+ fDrive->fMount();
+
+ kcout << "[Mount] drive: " << fDrive->fName << "\n";
+
+ return true;
}
- DriveTraits* DriveSelector::Unmount()
- {
- if (!fDrive)
- return nullptr;
+ return false;
+}
- auto drivePointer = fDrive;
+DriveTraits *DriveSelector::Unmount()
+{
+ if (!fDrive)
+ return nullptr;
- fDrive->fUnmount();
- fDrive = nullptr;
+ auto drivePointer = fDrive;
- kcout << "[Unmount] Mount drive: " << drivePointer->fName << "\n";
+ fDrive->fUnmount();
+ fDrive = nullptr;
- return drivePointer;
- }
+ kcout << "[Unmount] drive: " << drivePointer->fName << "\n";
+
+ return drivePointer;
+}
} // namespace hCore