mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
Kernel: Rename SysFS related classes in BIOS code
Give them names that sound related to SysFS.
This commit is contained in:
parent
84ae2b6f00
commit
358a7cc448
3 changed files with 26 additions and 26 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue