mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
Kernel: Don't use references or pointers to physical addresses
Now the ACPI & PCI code is more safer, because we don't use raw pointers or references to objects or data that are located in the physical address space, so an accidental dereference cannot happen easily. Instead, we use the PhysicalAddress class to represent those addresses.
This commit is contained in:
parent
43d570a1e3
commit
85307dd26e
13 changed files with 91 additions and 102 deletions
|
@ -33,34 +33,33 @@ namespace Kernel {
|
|||
|
||||
class ACPIStaticParser : ACPIParser {
|
||||
public:
|
||||
static void initialize(ACPI_RAW::RSDPDescriptor20& rsdp);
|
||||
static void initialize(PhysicalAddress rsdp);
|
||||
static void initialize_without_rsdp();
|
||||
static bool is_initialized();
|
||||
|
||||
virtual ACPI_RAW::SDTHeader* find_table(const char* sig) override;
|
||||
virtual PhysicalAddress find_table(const char* sig) override;
|
||||
virtual void do_acpi_reboot() override;
|
||||
virtual void do_acpi_shutdown() override;
|
||||
virtual bool is_operable() override { return m_operable; }
|
||||
|
||||
protected:
|
||||
ACPIStaticParser();
|
||||
explicit ACPIStaticParser(ACPI_RAW::RSDPDescriptor20&);
|
||||
explicit ACPIStaticParser(PhysicalAddress);
|
||||
|
||||
private:
|
||||
void locate_static_data();
|
||||
void locate_all_aml_tables();
|
||||
void locate_main_system_description_table();
|
||||
void initialize_main_system_description_table();
|
||||
size_t get_table_size(ACPI_RAW::SDTHeader&);
|
||||
u8 get_table_revision(ACPI_RAW::SDTHeader&);
|
||||
size_t get_table_size(PhysicalAddress);
|
||||
u8 get_table_revision(PhysicalAddress);
|
||||
void init_fadt();
|
||||
ACPI_RAW::RSDPDescriptor20* search_rsdp_in_ebda(u16 ebda_segment);
|
||||
ACPI_RAW::RSDPDescriptor20* search_rsdp_in_bios_area();
|
||||
ACPI_RAW::RSDPDescriptor20* search_rsdp();
|
||||
PhysicalAddress search_rsdp_in_ebda(u16 ebda_segment);
|
||||
PhysicalAddress search_rsdp_in_bios_area();
|
||||
PhysicalAddress search_rsdp();
|
||||
|
||||
// Early pointers that are needed really for initializtion only...
|
||||
ACPI_RAW::RSDPDescriptor20* m_rsdp;
|
||||
ACPI_RAW::SDTHeader* m_main_system_description_table;
|
||||
PhysicalAddress m_rsdp;
|
||||
PhysicalAddress m_main_system_description_table;
|
||||
|
||||
OwnPtr<ACPI::MainSystemDescriptionTable> m_main_sdt;
|
||||
OwnPtr<ACPI::FixedACPIData> m_fadt;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue