summaryrefslogtreecommitdiff
path: root/Kernel/Firmware/BIOS.h
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-04-01 11:18:38 +0300
committerAndreas Kling <kling@serenityos.org>2022-04-01 11:27:19 +0200
commitae2ec45e789cb02db1b4e227c9c16c495a50f170 (patch)
tree9971eea7dedb0d5a4ff37b5b4078989889986adc /Kernel/Firmware/BIOS.h
parent66ff60db07c67384b870d6d1aadf1d1b6729b405 (diff)
downloadserenity-ae2ec45e789cb02db1b4e227c9c16c495a50f170.zip
Kernel: Allow SysFS components to have non-zero size
This is important for dmidecode because it does an fstat on the DMI blobs, trying to figure out their size. Because we already know the size of the blobs when creating the SysFS components, there's no performance penalty whatsoever, and this allows dmidecode to not use the /dev/mem device as a fallback.
Diffstat (limited to 'Kernel/Firmware/BIOS.h')
-rw-r--r--Kernel/Firmware/BIOS.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/Firmware/BIOS.h b/Kernel/Firmware/BIOS.h
index a881b80344..0be5ad40aa 100644
--- a/Kernel/Firmware/BIOS.h
+++ b/Kernel/Firmware/BIOS.h
@@ -77,6 +77,9 @@ public:
private:
DMIEntryPointExposedBlob(PhysicalAddress dmi_entry_point, size_t blob_size);
virtual ErrorOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const override;
+
+ virtual size_t size() const override { return m_dmi_entry_point_length; }
+
PhysicalAddress m_dmi_entry_point;
size_t const m_dmi_entry_point_length { 0 };
};
@@ -90,6 +93,8 @@ private:
SMBIOSExposedTable(PhysicalAddress dmi_entry_point, size_t blob_size);
virtual ErrorOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const override;
+ virtual size_t size() const override { return m_smbios_structure_table_length; }
+
PhysicalAddress m_smbios_structure_table;
size_t const m_smbios_structure_table_length { 0 };
};