aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/kapi/devices.cpp
blob: 7aa7090fd996f382073a698a95f615a72c3bb73c (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
#include "kapi/devices.hpp"

#include "arch/bus/isa.hpp"
#include "arch/devices/legacy_pit.hpp"

#include <kstd/memory>
#include <kstd/print>

#include <cstdint>
#include <utility>

namespace kapi::devices
{

  namespace
  {
    constexpr auto pit_frequency_in_hz = std::uint32_t{100u};
  }

  auto init_platform_devices() -> void
  {
    kstd::println("[x86_64:devices] Initializing ISA bus...");

    auto isa_bus = kstd::make_unique<arch::bus::isa>();

    auto pit = kstd::make_unique<arch::devices::legacy_pit>(pit_frequency_in_hz);
    isa_bus->add_child(std::move(pit));

    auto & root_bus = get_root_bus();
    root_bus.add_child(std::move(isa_bus));
  }

}  // namespace kapi::devices