blob: d60cc406cdb4499d3ca98680524b120cc7d40978 (
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
|
#include <kapi/boot_modules/device.hpp>
#include <kapi/boot_modules/module.hpp>
#include <kapi/capabilities/facet_id.hpp>
#include <kapi/devices.hpp>
#include <kstd/format.hpp>
#include <cstddef>
#include <string_view>
namespace kapi::boot_modules
{
device::device(std::size_t index, kapi::boot_modules::module const & module)
: kapi::devices::device{kstd::format("device{}", index)}
, m_module(module)
{}
auto device::command_line() const -> std::string_view
{
return m_module.name;
}
auto device::module() const -> boot_modules::module const &
{
return m_module;
}
auto device::query_facet(kapi::capabilities::facet_id facet) -> void *
{
if (facet == boot_module_signature::id)
{
return static_cast<boot_module_signature *>(this);
}
return kapi::devices::device::query_facet(facet);
}
} // namespace kapi::boot_modules
|