diff --git a/Kernel/Arch/PC/BIOS.cpp b/Kernel/Arch/PC/BIOS.cpp index 36de8f8c97..be3b68a8fe 100644 --- a/Kernel/Arch/PC/BIOS.cpp +++ b/Kernel/Arch/PC/BIOS.cpp @@ -24,12 +24,12 @@ UNMAP_AFTER_INIT NonnullRefPtr DMIEntryPointExposedBlo return adopt_ref(*new (nothrow) DMIEntryPointExposedBlob(dmi_entry_point, blob_size)); } -UNMAP_AFTER_INIT BIOSExposedComponent::BIOSExposedComponent(String name) +UNMAP_AFTER_INIT BIOSSysFSComponent::BIOSSysFSComponent(String name) : SysFSComponent(name) { } -KResultOr BIOSExposedComponent::read_bytes(off_t offset, size_t count, UserOrKernelBuffer& buffer, FileDescription*) const +KResultOr BIOSSysFSComponent::read_bytes(off_t offset, size_t count, UserOrKernelBuffer& buffer, FileDescription*) const { auto blob = try_to_generate_buffer(); if (!blob) @@ -45,7 +45,7 @@ KResultOr BIOSExposedComponent::read_bytes(off_t offset, size_t count, U } UNMAP_AFTER_INIT DMIEntryPointExposedBlob::DMIEntryPointExposedBlob(PhysicalAddress dmi_entry_point, size_t blob_size) - : BIOSExposedComponent("smbios_entry_point") + : BIOSSysFSComponent("smbios_entry_point") , m_dmi_entry_point(dmi_entry_point) , m_dmi_entry_point_length(blob_size) { @@ -63,7 +63,7 @@ UNMAP_AFTER_INIT NonnullRefPtr SMBIOSExposedTable::create(Ph } UNMAP_AFTER_INIT SMBIOSExposedTable::SMBIOSExposedTable(PhysicalAddress smbios_structure_table, size_t smbios_structure_table_length) - : BIOSExposedComponent("DMI") + : BIOSSysFSComponent("DMI") , m_smbios_structure_table(smbios_structure_table) , m_smbios_structure_table_length(smbios_structure_table_length) { @@ -75,32 +75,32 @@ OwnPtr SMBIOSExposedTable::try_to_generate_buffer() const return KBuffer::try_create_with_bytes(Span { dmi_blob.ptr(), m_smbios_structure_table_length }); } -UNMAP_AFTER_INIT void BIOSExposedDirectory::set_dmi_64_bit_entry_initialization_values() +UNMAP_AFTER_INIT void BIOSSysFSDirectory::set_dmi_64_bit_entry_initialization_values() { - dbgln("BIOSExposedDirectory: SMBIOS 64bit Entry point @ {}", m_dmi_entry_point); + dbgln("BIOSSysFSDirectory: SMBIOS 64bit Entry point @ {}", m_dmi_entry_point); auto smbios_entry = map_typed(m_dmi_entry_point, SMBIOS_SEARCH_AREA_SIZE); m_smbios_structure_table = PhysicalAddress(smbios_entry.ptr()->table_ptr); m_dmi_entry_point_length = smbios_entry.ptr()->length; m_smbios_structure_table_length = smbios_entry.ptr()->table_maximum_size; } -UNMAP_AFTER_INIT void BIOSExposedDirectory::set_dmi_32_bit_entry_initialization_values() +UNMAP_AFTER_INIT void BIOSSysFSDirectory::set_dmi_32_bit_entry_initialization_values() { - dbgln("BIOSExposedDirectory: SMBIOS 32bit Entry point @ {}", m_dmi_entry_point); + dbgln("BIOSSysFSDirectory: SMBIOS 32bit Entry point @ {}", m_dmi_entry_point); auto smbios_entry = map_typed(m_dmi_entry_point, SMBIOS_SEARCH_AREA_SIZE); m_smbios_structure_table = PhysicalAddress(smbios_entry.ptr()->legacy_structure.smbios_table_ptr); m_dmi_entry_point_length = smbios_entry.ptr()->length; m_smbios_structure_table_length = smbios_entry.ptr()->legacy_structure.smboios_table_length; } -UNMAP_AFTER_INIT void BIOSExposedDirectory::initialize() +UNMAP_AFTER_INIT void BIOSSysFSDirectory::initialize() { - auto bios_folder = adopt_ref(*new (nothrow) BIOSExposedDirectory()); + auto bios_folder = adopt_ref(*new (nothrow) BIOSSysFSDirectory()); SysFSComponentRegistry::the().register_new_component(bios_folder); bios_folder->create_components(); } -void BIOSExposedDirectory::create_components() +void BIOSSysFSDirectory::create_components() { auto dmi_entry_point = DMIEntryPointExposedBlob::create(m_dmi_entry_point, m_dmi_entry_point_length); m_components.append(dmi_entry_point); @@ -108,16 +108,16 @@ void BIOSExposedDirectory::create_components() m_components.append(smbios_table); } -size_t BIOSExposedDirectory::dmi_entry_point_length() const +size_t BIOSSysFSDirectory::dmi_entry_point_length() const { return m_dmi_entry_point_length; } -size_t BIOSExposedDirectory::smbios_structure_table_length() const +size_t BIOSSysFSDirectory::smbios_structure_table_length() const { return m_smbios_structure_table_length; } -UNMAP_AFTER_INIT void BIOSExposedDirectory::initialize_dmi_exposer() +UNMAP_AFTER_INIT void BIOSSysFSDirectory::initialize_dmi_exposer() { VERIFY(!(m_dmi_entry_point.is_null())); if (m_using_64bit_dmi_entry_point) { @@ -125,16 +125,16 @@ UNMAP_AFTER_INIT void BIOSExposedDirectory::initialize_dmi_exposer() } else { set_dmi_32_bit_entry_initialization_values(); } - dbgln("BIOSExposedDirectory: Data table @ {}", m_smbios_structure_table); + dbgln("BIOSSysFSDirectory: Data table @ {}", m_smbios_structure_table); } -OwnPtr BIOSExposedDirectory::smbios_structure_table() const +OwnPtr BIOSSysFSDirectory::smbios_structure_table() const { auto dmi_blob = map_typed(m_smbios_structure_table, m_smbios_structure_table_length); return KBuffer::try_create_with_bytes(Span { dmi_blob.ptr(), m_smbios_structure_table_length }); } -UNMAP_AFTER_INIT BIOSExposedDirectory::BIOSExposedDirectory() +UNMAP_AFTER_INIT BIOSSysFSDirectory::BIOSSysFSDirectory() : SysFSDirectory("bios", SysFSComponentRegistry::the().root_folder()) { auto entry_32bit = find_dmi_entry32bit_point(); @@ -150,12 +150,12 @@ UNMAP_AFTER_INIT BIOSExposedDirectory::BIOSExposedDirectory() initialize_dmi_exposer(); } -UNMAP_AFTER_INIT Optional BIOSExposedDirectory::find_dmi_entry64bit_point() +UNMAP_AFTER_INIT Optional BIOSSysFSDirectory::find_dmi_entry64bit_point() { return map_bios().find_chunk_starting_with("_SM3_", 16); } -UNMAP_AFTER_INIT Optional BIOSExposedDirectory::find_dmi_entry32bit_point() +UNMAP_AFTER_INIT Optional BIOSSysFSDirectory::find_dmi_entry32bit_point() { return map_bios().find_chunk_starting_with("_SM_", 16); } diff --git a/Kernel/Arch/PC/BIOS.h b/Kernel/Arch/PC/BIOS.h index 80e943f805..e7e2f37afb 100644 --- a/Kernel/Arch/PC/BIOS.h +++ b/Kernel/Arch/PC/BIOS.h @@ -58,16 +58,16 @@ namespace Kernel { MappedROM map_bios(); MappedROM map_ebda(); -class BIOSExposedComponent : public SysFSComponent { +class BIOSSysFSComponent : public SysFSComponent { public: virtual KResultOr read_bytes(off_t, size_t, UserOrKernelBuffer&, FileDescription*) const override; protected: virtual OwnPtr try_to_generate_buffer() const = 0; - explicit BIOSExposedComponent(String name); + explicit BIOSSysFSComponent(String name); }; -class DMIEntryPointExposedBlob : public BIOSExposedComponent { +class DMIEntryPointExposedBlob : public BIOSSysFSComponent { public: static NonnullRefPtr create(PhysicalAddress dmi_entry_point, size_t blob_size); virtual size_t size() const override { return m_dmi_entry_point_length; } @@ -79,7 +79,7 @@ private: size_t m_dmi_entry_point_length; }; -class SMBIOSExposedTable : public BIOSExposedComponent { +class SMBIOSExposedTable : public BIOSSysFSComponent { public: static NonnullRefPtr create(PhysicalAddress, size_t blob_size); virtual size_t size() const override { return m_smbios_structure_table_length; } @@ -92,7 +92,7 @@ private: size_t m_smbios_structure_table_length; }; -class BIOSExposedDirectory : public SysFSDirectory { +class BIOSSysFSDirectory : public SysFSDirectory { public: static void initialize(); @@ -104,7 +104,7 @@ private: size_t dmi_entry_point_length() const; size_t smbios_structure_table_length() const; - BIOSExposedDirectory(); + BIOSSysFSDirectory(); void set_dmi_64_bit_entry_initialization_values(); void set_dmi_32_bit_entry_initialization_values(); diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 341f066f2b..93f43ec894 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -236,7 +236,7 @@ void init_stage2(void*) USB::UHCIController::detect(); - BIOSExposedDirectory::initialize(); + BIOSSysFSDirectory::initialize(); ACPI::ACPISysFSDirectory::initialize(); VirtIO::detect();