serenity/Kernel/Devices/HID/Device.h
Liav A. 16244c490a Kernel: Allocate all device major numbers within one known header file
We used to allocate major numbers quite randomly, with no common place
to look them up if needed.
This commit is changing that by placing all major number allocations
under a new C++ namespace, in the API/MajorNumberAllocation.h file.

We also add the foundations of what is needed before we can publish this
information (allocated numbers for block and char devices) to userspace.
2024-07-06 21:42:32 +02:00

30 lines
659 B
C++

/*
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <Kernel/API/MajorNumberAllocation.h>
#include <Kernel/Devices/CharacterDevice.h>
#include <Kernel/Security/Random.h>
namespace Kernel {
class HIDManagement;
class HIDDevice : public CharacterDevice {
friend class HIDManagement;
protected:
HIDDevice(MajorAllocation::CharacterDeviceFamily character_device_family, MinorNumber minor)
: CharacterDevice(character_device_family, minor)
{
}
EntropySource m_entropy_source;
IntrusiveListNode<HIDDevice, NonnullRefPtr<HIDDevice>> m_list_node;
};
}