
Until now, our kernel has reimplemented a number of AK classes to provide automatic internal locking: - RefPtr - NonnullRefPtr - WeakPtr - Weakable This patch renames the Kernel classes so that they can coexist with the original AK classes: - RefPtr => LockRefPtr - NonnullRefPtr => NonnullLockRefPtr - WeakPtr => LockWeakPtr - Weakable => LockWeakable The goal here is to eventually get rid of the Lock* classes in favor of using external locking.
42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Kernel/FileSystem/SysFS/Component.h>
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/Devices/Graphics/DisplayConnector/DeviceDirectory.h>
|
|
#include <Kernel/Graphics/DisplayConnector.h>
|
|
#include <Kernel/KBuffer.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class DisplayConnectorAttributeSysFSComponent : public SysFSComponent {
|
|
public:
|
|
enum class Type {
|
|
MutableModeSettingCapable,
|
|
DoubleFrameBufferingCapable,
|
|
FlushSupport,
|
|
PartialFlushSupport,
|
|
RefreshRateSupport,
|
|
EDID,
|
|
};
|
|
|
|
public:
|
|
static NonnullLockRefPtr<DisplayConnectorAttributeSysFSComponent> must_create(DisplayConnectorSysFSDirectory const& device_directory, Type);
|
|
|
|
virtual ErrorOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override;
|
|
virtual ~DisplayConnectorAttributeSysFSComponent() {};
|
|
|
|
virtual StringView name() const override;
|
|
|
|
protected:
|
|
ErrorOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const;
|
|
DisplayConnectorAttributeSysFSComponent(DisplayConnectorSysFSDirectory const& device, Type);
|
|
NonnullLockRefPtr<DisplayConnector> m_device;
|
|
Type const m_type { Type::MutableModeSettingCapable };
|
|
};
|
|
|
|
}
|