aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/test_support/simulated_memory.cpp
blob: d23350b9ccea5b40b04b770824439bd6b5e61e2b (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
#include "kernel/tests/simulated_memory.hpp"

#include <kstd/units>

#include <cstddef>
#include <vector>

namespace kernel::tests
{

  simulated_memory::simulated_memory(kstd::units::bytes size)
      : m_memory{size / kstd::units::bytes{1}}
  {}

  auto simulated_memory::ram_base() noexcept -> std::byte *
  {
    return m_memory.data();
  }

  auto simulated_memory::ram_base() const noexcept -> std::byte const *
  {
    return m_memory.data();
  }

  auto simulated_memory::clear() -> void
  {
    m_memory.clear();
  }

}  // namespace kernel::tests