diff options
| author | Amlal <amlalelmahrouss@icloud.com> | 2024-12-21 21:59:13 +0100 |
|---|---|---|
| committer | Amlal <amlalelmahrouss@icloud.com> | 2024-12-21 21:59:45 +0100 |
| commit | 610f91d87152cbe48d3054fcf437d8239da6ef35 (patch) | |
| tree | a386f7047ab73d088169ab2371ddc6ffe8020f1c /dev/BootLoader/BootKit/HW/SATA.h | |
| parent | 509fcca5986651c8ba712fb395f8498f2dea4109 (diff) | |
IMP: :boom: Breaking changes some checks are needed to be done.
Signed-off-by: Amlal <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/BootLoader/BootKit/HW/SATA.h')
| -rw-r--r-- | dev/BootLoader/BootKit/HW/SATA.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/dev/BootLoader/BootKit/HW/SATA.h b/dev/BootLoader/BootKit/HW/SATA.h new file mode 100644 index 00000000..ffb903f4 --- /dev/null +++ b/dev/BootLoader/BootKit/HW/SATA.h @@ -0,0 +1,46 @@ +/* ------------------------------------------- + + Copyright (C) 2024, TQ B.V, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include <CompilerKit/CompilerKit.h> +#include <Modules/AHCI/AHCI.h> + +class BootDeviceSATA final +{ +public: + explicit BootDeviceSATA() noexcept; + ~BootDeviceSATA() = default; + + ZKA_COPY_DEFAULT(BootDeviceSATA); + + struct SATATrait final + { + Kernel::SizeT mBase{1024}; + Kernel::Boolean mErr{false}; + Kernel::Boolean mDetected{false}; + + operator bool() + { + return !this->mErr; + } + }; + + operator bool() + { + return this->Leak().mDetected; + } + + BootDeviceSATA& Read(Kernel::WideChar* Buf, const Kernel::SizeT& SecCount); + BootDeviceSATA& Write(Kernel::WideChar* Buf, const Kernel::SizeT& SecCount); + + SATATrait& Leak(); + +private: + SATATrait mTrait; +}; + +#define kAHCISectorSz 4096 |
