2020-01-18 08:38:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 08:38:21 +00:00
|
|
|
*/
|
|
|
|
|
2018-10-14 00:59:22 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-04-03 10:36:40 +00:00
|
|
|
#include <Kernel/Devices/Device.h>
|
2018-10-14 00:59:22 +00:00
|
|
|
|
2020-02-16 00:27:42 +00:00
|
|
|
namespace Kernel {
|
|
|
|
|
2019-02-15 23:47:20 +00:00
|
|
|
class CharacterDevice : public Device {
|
2018-10-14 00:59:22 +00:00
|
|
|
public:
|
2019-02-15 23:47:20 +00:00
|
|
|
virtual ~CharacterDevice() override;
|
2019-01-31 04:55:30 +00:00
|
|
|
|
2018-10-14 00:59:22 +00:00
|
|
|
protected:
|
2021-12-23 18:08:18 +00:00
|
|
|
CharacterDevice(MajorNumber major, MinorNumber minor)
|
2020-01-22 21:23:50 +00:00
|
|
|
: Device(major, minor)
|
2019-05-28 09:53:16 +00:00
|
|
|
{
|
|
|
|
}
|
2019-02-16 08:57:42 +00:00
|
|
|
|
2022-07-16 07:39:57 +00:00
|
|
|
virtual void after_inserting_add_symlink_to_device_identifier_directory() override final;
|
|
|
|
virtual void before_will_be_destroyed_remove_symlink_from_device_identifier_directory() override final;
|
|
|
|
|
2019-02-16 08:57:42 +00:00
|
|
|
private:
|
|
|
|
virtual bool is_character_device() const final { return true; }
|
2022-07-16 07:39:57 +00:00
|
|
|
|
|
|
|
// FIXME: These methods will be eventually removed after all nodes in /sys/dev/char/ are symlinks
|
|
|
|
virtual void after_inserting_add_to_device_identifier_directory() override final;
|
|
|
|
virtual void before_will_be_destroyed_remove_from_device_identifier_directory() override final;
|
2018-10-14 00:59:22 +00:00
|
|
|
};
|
2020-02-16 00:27:42 +00:00
|
|
|
|
|
|
|
}
|