aboutsummaryrefslogtreecommitdiff
path: root/kernel/kapi/devices/cpu.cpp
blob: daba34a8e5020c7a9686d69de1d04520c092d640 (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
#include <kapi/devices/cpu.hpp>

#include <kapi/devices.hpp>

#include <kstd/format.hpp>

#include <cstdint>

namespace kapi::devices
{

  cpu::core::core(std::uint64_t index, std::uint64_t hardware_id, bool is_bsp)
      : kapi::devices::bus{kstd::format("cpu_core{}", index)}
      , m_index{index}
      , m_hardware_id{hardware_id}
      , m_is_bsp{is_bsp}
  {}

  auto cpu::core::index() const noexcept -> std::uint64_t
  {
    return m_index;
  }

  auto cpu::core::hardware_id() const -> std::uint64_t
  {
    return m_hardware_id;
  }

  auto cpu::core::is_bsp() const -> bool
  {
    return m_is_bsp;
  }

  cpu::cpu()
      : kapi::devices::bus{"cpu"}
  {}

}  // namespace kapi::devices