summaryrefslogtreecommitdiff
path: root/Kernel/PCI
AgeCommit message (Collapse)Author
2020-03-23AK: Reduce header dependency graph of String.hAndreas Kling
String.h no longer pulls in StringView.h. We do this by moving a bunch of String functions out-of-line.
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-09LibBareMetal: Return FlatPtr from PhysicalAddress::offset_in_page()Liav A
2020-03-06Meta: Claim copyright on `PCI` filesLiav A
2020-03-06Kernel: Simplify a bunch of dbg() and klog() callsAndreas Kling
LogStream can handle VirtualAddress and PhysicalAddress directly.
2020-03-02Kernel: Use klog() instead of kprintf()Liav A
Also, duplicate data in dbg() and klog() calls were removed. In addition, leakage of virtual address to kernel log is prevented. This is done by replacing kprintf() calls to dbg() calls with the leaked data instead. Also, other kprintf() calls were replaced with klog().
2020-02-29PCI: Adopt changes in ACPI definitions fileLiav A
2020-02-27Kernel: Run clang-format on PCI definitions fileLiav A
2020-02-27PCI MMIOAccess: Use dbg() instead of dbgprintf()Liav A
2020-02-24Kernel: Don't use references or pointers to physical addressesLiav A
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.
2020-02-24Kernel: Change get_pci_address() to pci_address() in PCI::Device classLiav A
The Serenity Coding Style tends to not accept the word "get" in methods' names if possible.
2020-02-24Kernel: Update PCI::Device class to use the new IRQHandler classLiav 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-09Kernel: Apply changes to use LibBareMetal definitionsLiav A
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: Move DMI decoder initialization method to init_stage2Liav A
Also, PCI Initializer dismiss() now deletes the object correctly, and the PCI initialization process no longer use the DMI decoder to determine if PCI is supported. grub configuration files include an entry to boot the OS without ACPI support.
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.