ladybird/Kernel/PCI/IOAccess.h
Liav A e5ffa960d7 Kernel: Create support for PCI ECAM
The new PCI subsystem is initialized during runtime.
PCI::Initializer is supposed to be called during early boot, to
perform a few tests, and initialize the proper configuration space
access mechanism. Kernel boot parameters can be specified by a user to
determine what tests will occur, to aid debugging on problematic
machines.
After that, PCI::Initializer should be dismissed.

PCI::IOAccess is a class that is derived from PCI::Access
class and implements PCI configuration space access mechanism via x86
IO ports.
PCI::MMIOAccess is a class that is derived from PCI::Access
and implements PCI configurtaion space access mechanism via memory
access.

The new PCI subsystem also supports determination of IO/MMIO space
needed by a device by checking a given BAR.
In addition, Every device or component that use the PCI subsystem has
changed to match the last changes.
2020-01-02 00:50:09 +01:00

25 lines
No EOL
931 B
C++

#pragma once
#include <Kernel/PCI/Access.h>
class PCI::IOAccess final : public PCI::Access {
public:
static void initialize();
virtual void enumerate_all(Function<void(Address, ID)>&) override final;
virtual String get_access_type() override final { return "IO-Access"; };
protected:
IOAccess();
private:
virtual u8 read8_field(Address address, u32) override final;
virtual u16 read16_field(Address address, u32) override final;
virtual u32 read32_field(Address address, u32) override final;
virtual void write8_field(Address address, u32, u8) override final;
virtual void write16_field(Address address, u32, u16) override final;
virtual void write32_field(Address address, u32, u32) override final;
virtual uint32_t get_segments_count() { return 1; };
virtual uint8_t get_segment_start_bus(u32) { return 0x0; };
virtual uint8_t get_segment_end_bus(u32) { return 0xFF; };
};