summaryrefslogtreecommitdiff
path: root/Kernel/Interrupts
AgeCommit message (Collapse)Author
2020-05-23Kernel: Use TypedMapping for accessing IOAPIC registersAndreas Kling
2020-05-23Kernel: Oops, we need to use map_typed_writable() for write access :^)Andreas Kling
2020-05-23Kernel: Use TypedMappings when looking for APIC informationAndreas Kling
2020-05-23Kernel: Use TypedMappings in the very unfinished APIC codeAndreas Kling
2020-05-23Kernel: Tweak some suspicious casts in InterruptManagementAndreas Kling
This code needs a closer looking-into at some point. It doesn't seem entirely safe to be casting u32's to pointers like it does.
2020-05-22Kernel: Simplify scanning BIOS/EBDA and MP parser initializationAndreas Kling
Add a MappedROM::find_chunk_starting_with() helper since that's a very common usage pattern in clients of this code. Also convert MultiProcessorParser from a persistent singleton object to a temporary object constructed via a failable factory function.
2020-05-16Kernel: Absorb LibBareMetal back into the kernelAndreas Kling
This was supposed to be the foundation for some kind of pre-kernel environment, but nobody is working on it right now, so let's move everything back into the kernel and remove all the confusion.
2020-05-16Kernel: Let's say that IO::delay(N) delays for N microsecondsAndreas Kling
Supposedly that's how much delay you get when doing I/O on port 0x80.
2020-05-16Kernel: Annotate UnhandledInterruptHandler::eoi with [[noreturn]]Shannon Booth
2020-05-08Kernel: Remove ref-counting from interrupt override metadataAndreas Kling
I don't see a reason for these to be reference-counted, and removing it simplifies a bunch of surrounding data structures.
2020-04-09Interrupts: Simplify initialization a bit moreLiav A
2020-04-09Interrupts: Remove irrelevant FIXME commentLiav A
2020-04-09Interrupts: Make the MultiProcessorParser functional againLiav A
2020-04-09Kernel: Simplify the Interrupt management initializationLiav A
2020-04-09Kernel: Use StringView for ACPI table signaturesAndreas Kling
2020-04-09Kernel: Add typed_map<T>(PhysicalAddress) and use it in ACPI parsingAndreas Kling
There was a frequently occurring pattern of "map this physical address into kernel VM, then read from it, then unmap it again". This new typed_map() encapsulates that logic by giving you back a typed pointer to the kind of structure you're interested in accessing. It returns a TypedMapping<T> that can be used mostly like a pointer. When destroyed, the TypedMapping object will unmap the memory. :^)
2020-03-24Interrupts: Handle spurious IRQs from eoi() methodLiav A
2020-03-24Interrupts: Use Optional container in IOAPICLiav A
We return the Optional container in find_redirection_entry_by_vector() method instead of a raw integer. This makes the code more readable and correct.
2020-03-24Interrupts: Simplify IRQ disabling & enabling in IRQController(s)Liav A
Instead of blindly setting masks, if we want to disable an IRQ and it's already masked, we just return. The same happens if we want to enable an IRQ and it's unmasked.
2020-03-24Interrupts: Remove unused methodsLiav A
2020-03-24Kernel: Simplify disable_irq() and enable_irq() methods in IRQHandlerLiav A
Setting the m_enabled variable to true or false can help with monitoring the IRQHandler object(s) later, and there's no good reason to have an if-else statement in those methods anyway.
2020-03-24Interrupts: Do a specific EOI when using the PICLiav A
Before this change, we did a non-specific EOI, which could lead to problems with other IRQs that are handled in the PIC. Since the original 8259A datasheet permits such functionality and we are not losing any functionality, this change is acceptable even though we don't experience problems with the EOI currently.
2020-03-24Interrupts: Assert if trying to install an handler on syscall vectorLiav A
Installing an interrupt handler on the syscall IDT vector can lead to fatal results, so we must assert if that happens.
2020-03-24Kernel: Abstract IRQ controller handling from Interrupt handlersLiav A
Now we don't send raw numbers, but we let the IRQController object to figure out the correct IRQ number. This helps in a situation when we have 2 or more IOAPICs, so if IOAPIC 1 is assigned for IRQs 0-23 and IOAPIC 2 is assigned for IRQs 24-47, if an IRQHandler of IRQ 25 invokes disable() for example, it will call his responsible IRQController (IOAPIC 2), and the IRQController will subtract the IRQ number with his assigned offset, and the result is that the second redirection entry in IOAPIC 2 will be masked.
2020-03-24Kernel: Correct Spurious Interrupt handlers' controller model() methodLiav A
We don't return blindly the IRQ controller's model(), if the Spurious IRQ handler is installed in IOAPIC environment, it's misleading to return "IOAPIC" string since IOAPIC doesn't really handle Spurious IRQs, therefore we return a "" string.
2020-03-24Kernel: Create an interface for conversion between IRQs and interruptsLiav A
2020-03-24Kernel: Ensure that we don't use a hard-disabled IRQControllerLiav A
2020-03-24Kernel: Change the Spurious Interrupt Handler offset in the APICLiav A
The Spurious Interrupt Handler number that is written to APIC_REG_SIV is correct now.
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-19Interrupts: Add an interface to determine if SMP is enabledLiav A
2020-03-19Kernel: Use a const reference to RegisterState in IRQ handlingLiav A
2020-03-09LibBareMetal: Return FlatPtr from PhysicalAddress::offset_in_page()Liav A
2020-03-06Kernel: Simplify a bunch of dbg() and klog() callsAndreas Kling
LogStream can handle VirtualAddress and PhysicalAddress directly.
2020-03-06Kernel: Shorten the model name of i8529 PIC classLiav A
2020-03-06Kernel: Change data in /proc/interrupts to be more richerLiav A
Also, during interrupt handlers' enumeration, we call all interrupts handlers that are not UnhandledInterruptHandler.
2020-03-06Kernel: Change HandlerPurpose to HandlerTypeLiav A
Also, GenericInterruptHandler class requires to implement two new methods.
2020-03-06Kernel: Simplify APIC::enable()Liav A
We install a SpuriousInterruptHandler when calling APIC::enable(), and we don't enable local interrupts for now.
2020-03-06Kernel: Acquire ISA interrupt overrides from Interrupt ManagementLiav A
Also, InterruptDisabler were added to prevent critical function from being interrupted. In addition, the interrupt numbers are abstracted from IDT offsets, thus, allowing to create a better routing scheme when using IOAPICs for interrupt redirection.
2020-03-02Kernel: Run clang-format on various filesLiav A
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-29Kernel: Simplify interrupt managementLiav A
The IRQController object is RefCounted, and is shared between the InterruptManagement class & IRQ handlers' classes. IRQHandler, SharedIRQHandler & SpuriousInterruptHandler classes use a responsible IRQ controller directly instead of calling InterruptManagement for disable(), enable() or eoi(). Also, the initialization process of InterruptManagement is simplified, so it doesn't rely on an ACPI parser to be initialized.
2020-02-29Kernel: Initialize Spurious IRQ handlers in switch_to_pic_mode()Liav A
2020-02-29Kernel: Delete unnecessary register & unregister callsLiav A
2020-02-29Kernel: Add SpuriousInterruptHandler classLiav A
This type of interrupt handler should handle spurious IRQs.
2020-02-29Kernel: Add SpuriousInterruptHandler type into HandlerPurposeLiav A
2020-02-27IOAPIC: 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_sharing_devices_count() in GenericInterruptHandlerLiav A
The new method' name is sharing_devices_count(). The Serenity Coding Style tends to not accept the word "get" in methods' names if possible.
2020-02-24Kernel: Add the new APIC namespaceLiav A
Also, the enable() function is now correct and will use the right registers and values. In addition to that, write_register() and read_registers() are not relying on identity mapping anymore.