summaryrefslogtreecommitdiff
path: root/Kernel/PCI/Access.h
AgeCommit message (Collapse)Author
2021-01-31Kernel: Fix PCI bridge enumerationJean-Baptiste Boric
The enumeration code is already enumerating all buses, recursively enumerating bridges (which are buses) makes devices on bridges being enumerated multiple times. Also, the PCI code was incorrectly mixing up terminology; let's settle down on bus, device and function because ever since PCIe came along "slots" isn't really a thing anymore.
2020-12-21Kernel: Add a method to retrieve the Physical ID for a PCI addressLiav A
2020-11-01Kernel: Map PCI devices only once during bootLiav A
Instead of mapping a 4KB region to access device configuration space each time we call one of the PCI helpers, just map them once during the boot process. Then, if we request to access one of those devices, we can ask the PCI subsystem to give us the virtual address where the device's configuration space is mapped.
2020-04-11Kernel: Keep records of PCI::Address & PCI::ID pairs for enumerationLiav A
2020-04-08Kernel: Simplify PCI::initialize()Andreas Kling
Choosing between I/O and MMIO is not as difficult as we were making it.
2020-04-08Kernel: Fix up various PCI-related function signaturesAndreas Kling
- Make things const when they don't need to be non-const. - Don't return AK::String when it's always a string literal anyway. - Remove excessive get_ prefixes per coding style.
2020-04-08Kernel: Remove an unnecessary layer of indirection in the PCI codeAndreas Kling
The PCI access layer was composed of a bunch of virtual functions that did nothing but call other virtual functions. The first layer was never overridden so there was no need for them to be virtual. This patch removes the indirection and moves logic from PCI::Access down into the various PCI::get_foo() helpers that were the sole users.
2020-03-09Kernel: Allow to reboot in ACPI via PCI or MMIO accessLiav A
Also, we determine if ACPI reboot is supported by checking the FADT flags' field.
2020-03-06Meta: Claim copyright on `PCI` filesLiav A
2020-02-24Kernel: Add PCI helpers to enable and disable the interrupt lineLiav A
2020-02-16Kernel: Move all code into the Kernel namespaceAndreas Kling
2020-02-02Kernel: Detect devices when enumerating the PCI busLiav A
Instead of making each driver to enumerate the PCI bus itself, PCI::Initializer will call detect_devices() to do one enumeration of the bus.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2020-01-14Kernel: Remove problematic memory mapping methodsLiav A
mmap() & mmap_region() methods are removed from ACPI & DMI components, and we replace them with the new MM.allocate_kernel_region() helper. Instead of doing a raw calculation for each VM address, from now on we can use helper functions to do perform those calculations in a neat, reusable and readable way.
2020-01-02Kernel: Create support for PCI ECAMLiav A
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.