mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
Kernel/SysFS: Remove derived BIOSSysFSComponent classes
These are not needed, because both do exactly the same thing, so we can move the code to the BIOSSysFSComponent class.
This commit is contained in:
parent
23c1c40e86
commit
30b58cd06c
8 changed files with 49 additions and 150 deletions
|
@ -15,13 +15,26 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
class BIOSSysFSComponent : public SysFSComponent {
|
||||
class BIOSSysFSComponent final : public SysFSComponent {
|
||||
public:
|
||||
enum class Type {
|
||||
DMIEntryPoint,
|
||||
SMBIOSTable,
|
||||
};
|
||||
|
||||
public:
|
||||
static NonnullRefPtr<BIOSSysFSComponent> must_create(Type, PhysicalAddress, size_t blob_size);
|
||||
virtual StringView name() const override;
|
||||
virtual ErrorOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override;
|
||||
|
||||
protected:
|
||||
virtual ErrorOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const = 0;
|
||||
BIOSSysFSComponent();
|
||||
};
|
||||
private:
|
||||
ErrorOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const;
|
||||
BIOSSysFSComponent(Type, PhysicalAddress, size_t blob_size);
|
||||
|
||||
virtual size_t size() const override { return m_blob_length; }
|
||||
|
||||
PhysicalAddress const m_blob_paddr;
|
||||
size_t const m_blob_length { 0 };
|
||||
Type const m_type { Type::DMIEntryPoint };
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue