summaryrefslogtreecommitdiff
path: root/Kernel/PCI/Definitions.h
AgeCommit message (Collapse)Author
2020-04-11Kernel: Keep records of PCI::Address & PCI::ID pairs for enumerationLiav A
2020-04-09Kernel: Simplify PCI messages on initializationLiav A
2020-04-08Kernel: Simplify PCI initialization logicAndreas Kling
- Get rid of the PCI::Initializer object which was not serving any real purpose or holding any data members. - Move command line parsing from init to PCI::initialize().
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-22Kernel: Run clang-format on filesShannon Booth
Let's rip off the band-aid
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-09PCI: Enable LogStream output for addressesLiav A
2020-03-06Meta: Claim copyright on `PCI` filesLiav A
2020-02-27Kernel: Run clang-format on PCI definitions fileLiav 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-22Kernel: Introduce IRQ sharing supportLiav A
The support is very basic - Each component that needs to handle IRQs inherits from InterruptHandler class. When the InterruptHandler constructor is called it registers itself in a SharedInterruptHandler. When an IRQ is fired, the SharedInterruptHandler is invoked, then it iterates through a list of the registered InterruptHandlers. Also, InterruptEnabler class was created to provide a way to enable IRQ handling temporarily, similar to InterruptDisabler (in CPU.h, which does the opposite). In addition to that a PCI::Device class has been added, that inherits from InterruptHandler.
2020-01-21Kernel: PCI MMIO no longer uses map_for_kernel()Liav A
PCI MMIO access is done by modifying the related PhysicalPage directly, then we request to remap the region to create the mapping.
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: Fixing PCI MMIO access mechanismLiav A
During initialization of PCI MMIO access mechanism we ensure that we have an allocation from the kernel virtual address space that cannot be taken by other components in the OS. Also, now we ensure that interrupts are disabled so mapping the region doesn't fail. In order to reduce overhead, map_device() will map the requested PCI address only if it's not mapped already. The run script has been changed so now we can boot a Q35 machine, that supports PCI ECAM. To ensure we will be able to load the machine, a PIIX3 IDE controller was added to the Q35 machine configuration in the run script. An AHCI controller was added to the i440fx machine configuration.
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.