summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/KernelKit/PCI/DMA.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:13:48 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:15:17 +0100
commita13e1c0911c0627184bc38f18c7fdda64447b3ad (patch)
tree073a62c09bf216e85a3f310376640fa1805147f9 /dev/Kernel/KernelKit/PCI/DMA.h
parent149fa096eb306d03686b3b67e813cf1a78e08cd0 (diff)
meta(kernel): Reworked repository's filesystem structure.
Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/KernelKit/PCI/DMA.h')
-rw-r--r--dev/Kernel/KernelKit/PCI/DMA.h81
1 files changed, 0 insertions, 81 deletions
diff --git a/dev/Kernel/KernelKit/PCI/DMA.h b/dev/Kernel/KernelKit/PCI/DMA.h
deleted file mode 100644
index 68f3fa37..00000000
--- a/dev/Kernel/KernelKit/PCI/DMA.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -------------------------------------------
-
- Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <KernelKit/DeviceMgr.h>
-#include <KernelKit/PCI/Device.h>
-#include <NewKit/Array.h>
-#include <NewKit/OwnPtr.h>
-#include <NewKit/Ref.h>
-
-namespace NeOS
-{
- 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:
- explicit DMAWrapper(nullPtr) = delete;
- explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI)
- : fAddress(Ptr), fKind(Kind)
- {
- }
-
- public:
- DMAWrapper& operator=(voidPtr Ptr);
-
- public:
- DMAWrapper& operator=(const DMAWrapper&) = default;
- DMAWrapper(const DMAWrapper&) = default;
-
- public:
- ~DMAWrapper() = default;
-
- template <class T>
- T* operator->();
-
- template <class T>
- T* Get(const UIntPtr off = 0);
-
- public:
- operator bool();
- bool operator!();
-
- public:
- bool Write(const UIntPtr& bit, const UInt32& offset);
- UIntPtr Read(const UInt32& offset);
- Boolean Check(UIntPtr offset) const;
-
- public:
- UIntPtr operator[](const UIntPtr& offset);
-
- private:
- voidPtr fAddress{nullptr};
- DmaKind fKind{DmaKind::Invalid};
-
- private:
- friend class DMAFactory;
- };
-
- class DMAFactory final
- {
- public:
- static OwnPtr<IOBuf<Char*>> Construct(OwnPtr<DMAWrapper>& dma);
- };
-} // namespace NeOS
-
-#include <KernelKit/PCI/DMA.inl>