1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:57:35 +00:00

Kernel: Simplify PCI::MMIOAccess segment storage

Instead of nesting a bunch of heap allocations, just store them in
a simple HashMap<u16, MMIOSegment>.

Also fix a bunch of double hash lookups like this:

    ASSERT(map.contains(key));
    auto thing = map.get(key).value();

They now look like this instead:

    auto thing = map.get(key);
    ASSERT(thing.has_value());
This commit is contained in:
Andreas Kling 2020-04-08 17:23:20 +02:00
parent 0de368e36c
commit c8b309a3b5
2 changed files with 11 additions and 10 deletions

View file

@ -63,7 +63,7 @@ private:
virtual u8 segment_end_bus(u32) const override;
PhysicalAddress m_mcfg;
HashMap<u16, MMIOSegment*>& m_segments;
HashMap<u16, MMIOSegment> m_segments;
OwnPtr<Region> m_mmio_window_region;
ChangeableAddress m_mapped_address;
};