Prechádzať zdrojové kódy

Kernel: Rename SysFS related classes in BIOS code

Give them names that sound related to SysFS.
Andreas Kling 4 rokov pred
rodič
commit
358a7cc448
3 zmenil súbory, kde vykonal 26 pridanie a 26 odobranie
  1. 19 19
      Kernel/Arch/PC/BIOS.cpp
  2. 6 6
      Kernel/Arch/PC/BIOS.h
  3. 1 1
      Kernel/init.cpp

+ 19 - 19
Kernel/Arch/PC/BIOS.cpp

@@ -24,12 +24,12 @@ UNMAP_AFTER_INIT NonnullRefPtr<DMIEntryPointExposedBlob> 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<size_t> BIOSExposedComponent::read_bytes(off_t offset, size_t count, UserOrKernelBuffer& buffer, FileDescription*) const
+KResultOr<size_t> 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<size_t> 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> 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<KBuffer> SMBIOSExposedTable::try_to_generate_buffer() const
     return KBuffer::try_create_with_bytes(Span<u8> { 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<SMBIOS::EntryPoint64bit>(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<SMBIOS::EntryPoint32bit>(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<KBuffer> BIOSExposedDirectory::smbios_structure_table() const
+OwnPtr<KBuffer> BIOSSysFSDirectory::smbios_structure_table() const
 {
     auto dmi_blob = map_typed<u8>(m_smbios_structure_table, m_smbios_structure_table_length);
     return KBuffer::try_create_with_bytes(Span<u8> { 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<PhysicalAddress> BIOSExposedDirectory::find_dmi_entry64bit_point()
+UNMAP_AFTER_INIT Optional<PhysicalAddress> BIOSSysFSDirectory::find_dmi_entry64bit_point()
 {
     return map_bios().find_chunk_starting_with("_SM3_", 16);
 }
 
-UNMAP_AFTER_INIT Optional<PhysicalAddress> BIOSExposedDirectory::find_dmi_entry32bit_point()
+UNMAP_AFTER_INIT Optional<PhysicalAddress> BIOSSysFSDirectory::find_dmi_entry32bit_point()
 {
     return map_bios().find_chunk_starting_with("_SM_", 16);
 }

+ 6 - 6
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<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, FileDescription*) const override;
 
 protected:
     virtual OwnPtr<KBuffer> 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<DMIEntryPointExposedBlob> 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<SMBIOSExposedTable> 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();

+ 1 - 1
Kernel/init.cpp

@@ -236,7 +236,7 @@ void init_stage2(void*)
 
     USB::UHCIController::detect();
 
-    BIOSExposedDirectory::initialize();
+    BIOSSysFSDirectory::initialize();
     ACPI::ACPISysFSDirectory::initialize();
 
     VirtIO::detect();