2019-04-29 04:55:54 +02:00
|
|
|
#include <Kernel/Devices/Device.h>
|
|
|
|
|
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
2019-02-16 00:47:20 +01:00
|
|
|
#include <LibC/errno_numbers.h>
|
|
|
|
|
|
2019-02-17 10:38:07 +01:00
|
|
|
Device::Device(unsigned major, unsigned minor)
|
|
|
|
|
: m_major(major)
|
|
|
|
|
, m_minor(minor)
|
|
|
|
|
{
|
2019-05-31 15:36:49 +02:00
|
|
|
VFS::the().register_device({}, *this);
|
2019-02-17 10:38:07 +01:00
|
|
|
}
|
|
|
|
|
|
2019-02-16 00:47:20 +01:00
|
|
|
Device::~Device()
|
|
|
|
|
{
|
2019-05-31 15:36:49 +02:00
|
|
|
VFS::the().unregister_device({}, *this);
|
2019-02-16 00:47:20 +01:00
|
|
|
}
|
|
|
|
|
|
2019-05-03 20:42:43 +02:00
|
|
|
String Device::absolute_path(FileDescriptor&) const
|
2019-02-16 00:47:20 +01:00
|
|
|
{
|
2019-04-28 15:02:55 +02:00
|
|
|
return String::format("device:%u,%u (%s)", m_major, m_minor, class_name());
|
2019-02-16 00:47:20 +01:00
|
|
|
}
|