summaryrefslogtreecommitdiffhomepage
path: root/Private/KernelKit/PCI
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/KernelKit/PCI
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/KernelKit/PCI')
-rw-r--r--Private/KernelKit/PCI/Dma.hpp95
1 files changed, 47 insertions, 48 deletions
diff --git a/Private/KernelKit/PCI/Dma.hpp b/Private/KernelKit/PCI/Dma.hpp
index 025192f0..87cd78cf 100644
--- a/Private/KernelKit/PCI/Dma.hpp
+++ b/Private/KernelKit/PCI/Dma.hpp
@@ -17,66 +17,65 @@
namespace hCore
{
- enum class DmaKind
- {
- PCI, // Bus mastering is required to be turned on. Basiaclly a request
- // control system. 64-Bit access depends on the PAE bit and the device
- // (if Double Address Cycle is available)
- ISA, // Four DMA channels 0-3; 8 bit transfers and only a megabyte of RAM.
- Invalid,
- };
-
- class DMAWrapper final
- {
- public:
- DMAWrapper() = delete;
-
- public:
- DMAWrapper(nullPtr) = delete;
- DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) : m_Address(Ptr), m_Kind(Kind) {}
+enum class DmaKind
+{
+ PCI, // Bus mastering is required to be turned on. Basiaclly a request
+ // control system. 64-Bit access depends on the PAE bit and the device
+ // (if Double Address Cycle is available)
+ ISA, // Four DMA channels 0-3; 8 bit transfers and only a megabyte of RAM.
+ Invalid,
+};
+
+class DMAWrapper final
+{
+ public:
+ explicit DMAWrapper() = delete;
- public:
- DMAWrapper &operator=(voidPtr Ptr);
+ public:
+ explicit DMAWrapper(nullPtr) = delete;
+ explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) : m_Address(Ptr), m_Kind(Kind)
+ {
+ }
- public:
- DMAWrapper &operator=(const DMAWrapper &) = default;
- DMAWrapper(const DMAWrapper &) = default;
+ public:
+ DMAWrapper &operator=(voidPtr Ptr);
- public:
- ~DMAWrapper() = default;
+ public:
+ DMAWrapper &operator=(const DMAWrapper &) = default;
+ DMAWrapper(const DMAWrapper &) = default;
- template<class T>
- T *operator->();
+ public:
+ ~DMAWrapper() = default;
- template<class T>
- T *Get(const UIntPtr off = 0);
+ template <class T> T *operator->();
- public:
- operator bool();
- bool operator!();
+ template <class T> T *Get(const UIntPtr off = 0);
- public:
- bool Write(const UIntPtr &bit, const UIntPtr &offset);
- UIntPtr Read(const UIntPtr &offset);
- Boolean Check(UIntPtr offset) const;
+ public:
+ operator bool();
+ bool operator!();
- public:
- UIntPtr operator[](const UIntPtr &offset);
+ public:
+ bool Write(const UIntPtr &bit, const UIntPtr &offset);
+ UIntPtr Read(const UIntPtr &offset);
+ Boolean Check(UIntPtr offset) const;
- private:
- voidPtr m_Address{nullptr};
- DmaKind m_Kind{DmaKind::Invalid};
+ public:
+ UIntPtr operator[](const UIntPtr &offset);
- private:
- friend class DMAFactory;
- };
+ private:
+ voidPtr m_Address{nullptr};
+ DmaKind m_Kind{DmaKind::Invalid};
- class DMAFactory final
- {
- public:
- static OwnPtr<IOBuf<Char*>> Construct(OwnPtr <DMAWrapper> &dma);
+ private:
+ friend class DMAFactory;
+};
- };
+class DMAFactory final
+{
+ public:
+ static OwnPtr<IOBuf<Char *>> Construct(OwnPtr<DMAWrapper> &dma);
+};
} // namespace hCore
#include <KernelKit/PCI/Dma.inl>