mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +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));
|
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)
|
: 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();
|
auto blob = try_to_generate_buffer();
|
||||||
if (!blob)
|
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)
|
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(dmi_entry_point)
|
||||||
, m_dmi_entry_point_length(blob_size)
|
, 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)
|
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(smbios_structure_table)
|
||||||
, m_smbios_structure_table_length(smbios_structure_table_length)
|
, 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 });
|
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);
|
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_smbios_structure_table = PhysicalAddress(smbios_entry.ptr()->table_ptr);
|
||||||
m_dmi_entry_point_length = smbios_entry.ptr()->length;
|
m_dmi_entry_point_length = smbios_entry.ptr()->length;
|
||||||
m_smbios_structure_table_length = smbios_entry.ptr()->table_maximum_size;
|
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);
|
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_smbios_structure_table = PhysicalAddress(smbios_entry.ptr()->legacy_structure.smbios_table_ptr);
|
||||||
m_dmi_entry_point_length = smbios_entry.ptr()->length;
|
m_dmi_entry_point_length = smbios_entry.ptr()->length;
|
||||||
m_smbios_structure_table_length = smbios_entry.ptr()->legacy_structure.smboios_table_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);
|
SysFSComponentRegistry::the().register_new_component(bios_folder);
|
||||||
bios_folder->create_components();
|
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);
|
auto dmi_entry_point = DMIEntryPointExposedBlob::create(m_dmi_entry_point, m_dmi_entry_point_length);
|
||||||
m_components.append(dmi_entry_point);
|
m_components.append(dmi_entry_point);
|
||||||
|
@ -108,16 +108,16 @@ void BIOSExposedDirectory::create_components()
|
||||||
m_components.append(smbios_table);
|
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;
|
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;
|
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()));
|
VERIFY(!(m_dmi_entry_point.is_null()));
|
||||||
if (m_using_64bit_dmi_entry_point) {
|
if (m_using_64bit_dmi_entry_point) {
|
||||||
|
@ -125,16 +125,16 @@ UNMAP_AFTER_INIT void BIOSExposedDirectory::initialize_dmi_exposer()
|
||||||
} else {
|
} else {
|
||||||
set_dmi_32_bit_entry_initialization_values();
|
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);
|
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 });
|
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())
|
: SysFSDirectory("bios", SysFSComponentRegistry::the().root_folder())
|
||||||
{
|
{
|
||||||
auto entry_32bit = find_dmi_entry32bit_point();
|
auto entry_32bit = find_dmi_entry32bit_point();
|
||||||
|
@ -150,12 +150,12 @@ UNMAP_AFTER_INIT BIOSExposedDirectory::BIOSExposedDirectory()
|
||||||
initialize_dmi_exposer();
|
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);
|
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);
|
return map_bios().find_chunk_starting_with("_SM_", 16);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,16 +58,16 @@ namespace Kernel {
|
||||||
MappedROM map_bios();
|
MappedROM map_bios();
|
||||||
MappedROM map_ebda();
|
MappedROM map_ebda();
|
||||||
|
|
||||||
class BIOSExposedComponent : public SysFSComponent {
|
class BIOSSysFSComponent : public SysFSComponent {
|
||||||
public:
|
public:
|
||||||
virtual KResultOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, FileDescription*) const override;
|
virtual KResultOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, FileDescription*) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual OwnPtr<KBuffer> try_to_generate_buffer() const = 0;
|
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:
|
public:
|
||||||
static NonnullRefPtr<DMIEntryPointExposedBlob> create(PhysicalAddress dmi_entry_point, size_t blob_size);
|
static NonnullRefPtr<DMIEntryPointExposedBlob> create(PhysicalAddress dmi_entry_point, size_t blob_size);
|
||||||
virtual size_t size() const override { return m_dmi_entry_point_length; }
|
virtual size_t size() const override { return m_dmi_entry_point_length; }
|
||||||
|
@ -79,7 +79,7 @@ private:
|
||||||
size_t m_dmi_entry_point_length;
|
size_t m_dmi_entry_point_length;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SMBIOSExposedTable : public BIOSExposedComponent {
|
class SMBIOSExposedTable : public BIOSSysFSComponent {
|
||||||
public:
|
public:
|
||||||
static NonnullRefPtr<SMBIOSExposedTable> create(PhysicalAddress, size_t blob_size);
|
static NonnullRefPtr<SMBIOSExposedTable> create(PhysicalAddress, size_t blob_size);
|
||||||
virtual size_t size() const override { return m_smbios_structure_table_length; }
|
virtual size_t size() const override { return m_smbios_structure_table_length; }
|
||||||
|
@ -92,7 +92,7 @@ private:
|
||||||
size_t m_smbios_structure_table_length;
|
size_t m_smbios_structure_table_length;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BIOSExposedDirectory : public SysFSDirectory {
|
class BIOSSysFSDirectory : public SysFSDirectory {
|
||||||
public:
|
public:
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ private:
|
||||||
size_t dmi_entry_point_length() const;
|
size_t dmi_entry_point_length() const;
|
||||||
size_t smbios_structure_table_length() const;
|
size_t smbios_structure_table_length() const;
|
||||||
|
|
||||||
BIOSExposedDirectory();
|
BIOSSysFSDirectory();
|
||||||
|
|
||||||
void set_dmi_64_bit_entry_initialization_values();
|
void set_dmi_64_bit_entry_initialization_values();
|
||||||
void set_dmi_32_bit_entry_initialization_values();
|
void set_dmi_32_bit_entry_initialization_values();
|
||||||
|
|
|
@ -236,7 +236,7 @@ void init_stage2(void*)
|
||||||
|
|
||||||
USB::UHCIController::detect();
|
USB::UHCIController::detect();
|
||||||
|
|
||||||
BIOSExposedDirectory::initialize();
|
BIOSSysFSDirectory::initialize();
|
||||||
ACPI::ACPISysFSDirectory::initialize();
|
ACPI::ACPISysFSDirectory::initialize();
|
||||||
|
|
||||||
VirtIO::detect();
|
VirtIO::detect();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue