blob: 84a43c1c12fafa977456bdf4bdf317cc544b6ab4 (
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
|
#include <kapi/boot_modules/device.hpp>
#include <kapi/boot_modules/module.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_interface(kapi::devices::interface_id interface) -> void *
{
if (interface == boot_module_signature::id)
{
return static_cast<boot_module_signature *>(this);
}
return kapi::devices::device::query_interface(interface);
}
} // namespace kapi::boot_modules
|