diff options
Diffstat (limited to 'Private/KernelKit')
| -rw-r--r-- | Private/KernelKit/DebugOutput.hpp | 2 | ||||
| -rw-r--r-- | Private/KernelKit/DeviceManager.hpp (renamed from Private/KernelKit/Device.hpp) | 0 | ||||
| -rw-r--r-- | Private/KernelKit/DriveManager.hpp | 2 | ||||
| -rw-r--r-- | Private/KernelKit/PCI/Dma.hpp | 91 |
4 files changed, 46 insertions, 49 deletions
diff --git a/Private/KernelKit/DebugOutput.hpp b/Private/KernelKit/DebugOutput.hpp index dd34df8e..6e651924 100644 --- a/Private/KernelKit/DebugOutput.hpp +++ b/Private/KernelKit/DebugOutput.hpp @@ -9,7 +9,7 @@ #pragma once -#include <KernelKit/Device.hpp> +#include <KernelKit/DeviceManager.hpp> #include <NewKit/OwnPtr.hpp> #include <NewKit/Stream.hpp> diff --git a/Private/KernelKit/Device.hpp b/Private/KernelKit/DeviceManager.hpp index 9a689b26..9a689b26 100644 --- a/Private/KernelKit/Device.hpp +++ b/Private/KernelKit/DeviceManager.hpp diff --git a/Private/KernelKit/DriveManager.hpp b/Private/KernelKit/DriveManager.hpp index ac39c177..8e6aaefd 100644 --- a/Private/KernelKit/DriveManager.hpp +++ b/Private/KernelKit/DriveManager.hpp @@ -11,7 +11,7 @@ #define __DRIVE_MANAGER__ #include <CompilerKit/CompilerKit.hpp> -#include <KernelKit/Device.hpp> +#include <KernelKit/DeviceManager.hpp> #include <NewKit/Defines.hpp> #include <NewKit/String.hpp> diff --git a/Private/KernelKit/PCI/Dma.hpp b/Private/KernelKit/PCI/Dma.hpp index 8e027179..0b4b55b8 100644 --- a/Private/KernelKit/PCI/Dma.hpp +++ b/Private/KernelKit/PCI/Dma.hpp @@ -9,73 +9,70 @@ #pragma once -#include <KernelKit/Device.hpp> +#include <KernelKit/DeviceManager.hpp> #include <KernelKit/PCI/Device.hpp> #include <NewKit/Array.hpp> #include <NewKit/OwnPtr.hpp> #include <NewKit/Ref.hpp> -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, +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: - explicit DMAWrapper() = delete; +class DMAWrapper final { + public: + explicit DMAWrapper() = delete; - public: - explicit DMAWrapper(nullPtr) = delete; - explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) : m_Address(Ptr), m_Kind(Kind) - { - } + public: + explicit DMAWrapper(nullPtr) = delete; + explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) + : m_Address(Ptr), m_Kind(Kind) {} - public: - DMAWrapper &operator=(voidPtr Ptr); + public: + DMAWrapper &operator=(voidPtr Ptr); - public: - DMAWrapper &operator=(const DMAWrapper &) = default; - DMAWrapper(const DMAWrapper &) = default; + public: + DMAWrapper &operator=(const DMAWrapper &) = default; + DMAWrapper(const DMAWrapper &) = default; - public: - ~DMAWrapper() = default; + public: + ~DMAWrapper() = default; - template <class T> T *operator->(); + template <class T> + T *operator->(); - template <class T> T *Get(const UIntPtr off = 0); + template <class T> + T *Get(const UIntPtr off = 0); - public: - operator bool(); - bool operator!(); + public: + operator bool(); + bool operator!(); - public: - bool Write(const UIntPtr &bit, const UIntPtr &offset); - UIntPtr Read(const UIntPtr &offset); - Boolean Check(UIntPtr offset) const; + public: + bool Write(const UIntPtr &bit, const UIntPtr &offset); + UIntPtr Read(const UIntPtr &offset); + Boolean Check(UIntPtr offset) const; - public: - UIntPtr operator[](const UIntPtr &offset); + public: + UIntPtr operator[](const UIntPtr &offset); - private: - voidPtr m_Address{nullptr}; - DmaKind m_Kind{DmaKind::Invalid}; + private: + voidPtr m_Address{nullptr}; + DmaKind m_Kind{DmaKind::Invalid}; - private: - friend class DMAFactory; + private: + friend class DMAFactory; }; -class DMAFactory final -{ - public: - static OwnPtr<IOBuf<Char *>> Construct(OwnPtr<DMAWrapper> &dma); +class DMAFactory final { + public: + static OwnPtr<IOBuf<Char *>> Construct(OwnPtr<DMAWrapper> &dma); }; -} // namespace HCore +} // namespace HCore #include <KernelKit/PCI/Dma.inl> |
