summaryrefslogtreecommitdiffhomepage
path: root/Private/StorageKit/PRDT.hpp
blob: d269ee3a901fa3b1d383168bf5c67f4301b3315b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 *	========================================================
 *
 *	HCore
 * 	Copyright Mahrouss Logic, all rights reserved.
 *
 * 	========================================================
 */
#pragma once

#include <KernelKit/PCI/Dma.hpp>
#include <KernelKit/PCI/Iterator.hpp>

#define PRDT_TRANSFER_SIZE (sizeof(HCore::UShort))

namespace HCore {
class PRDT final {
 public:
  PRDT() = delete;
  explicit PRDT(const UIntPtr &physAddr);
  ~PRDT();

  PRDT &operator=(const PRDT &) = default;
  PRDT(const PRDT &) = default;

 public:
  const UInt &Low();
  const UShort &High();
  const UIntPtr &PhysicalAddress();

 public:
  PRDT &operator=(const UIntPtr &prdtAddress);

 public:
  operator bool() { return m_PrdtAddr != 0; }

 private:
  union {
    UInt m_Low;
    UShort m_High;
  };

  UIntPtr m_PrdtAddr;
};

using PhysicalAddress = PRDT;  // here
}  // namespace HCore