summaryrefslogtreecommitdiff
path: root/Kernel/Interrupts
AgeCommit message (Collapse)Author
2022-01-13Kernel: Make map_typed() & map_typed_writable() fallible using ErrorOrIdan Horowitz
This mostly just moved the problem, as a lot of the callers are not capable of propagating the errors themselves, but it's a step in the right direction.
2022-01-07Everywhere: Fix many spelling errorsmjz19910
2022-01-05Kernel: Use MUST + Vector::try_empend instead of Vector::empendBrian Gianforcaro
In preparation for making Vector::empend unavailable during compilation of the Kernel.
2021-12-28Kernel: Propagate overflow errors from Memory::page_round_upGuilherme Goncalves
Fixes #11402.
2021-12-26Kernel: Encapsulate APIC initialization inside InterruptManagementPankaj Raghav
Currently the APIC class is constructed irrespective of whether it is used or not. So, move APIC initialization from init to the InterruptManagement class and construct the APIC class only when it is needed.
2021-12-23Kernel: Move Multi Processor Parser code to a separate directoryLiav A
2021-12-22Kernel: Initialize SupriousInterruptHandler::m_enabled on constructionBrian Gianforcaro
Found by PVS Studio Static Analysis
2021-12-22Kernel: Move userspace virtual address range base to 0x10000Idan Horowitz
Now that the shared bottom 2 MiB virtual address mappings are gone userspace can use lower virtual addresses.
2021-12-22Kernel: Setup APIC AP cores boot environment before init_stage2Idan Horowitz
Since this range is mapped in already in the kernel page directory, we can initialize it before jumping into the first kernel process which lets us avoid mapping in the range into init_stage2's address space. This brings us half-way to removing the shared bottom 2 MiB mapping in every process, leaving only the Prekernel.
2021-12-20Kernel: Ensure SMP mode is not enabled if IOAPIC mode is disabledLiav A
We need to use the IOAPIC in SMP mode, so if the user requested to disable it, we can't enable SMP mode either.
2021-12-14Kernel: Allow switching to IOAPIC mode even without enabling SMPLiav A
This small change allows to use the IOAPIC by default without to enable SMP mode, which emulates Uni-Processor setup with IOAPIC instead of using the PIC. This opens the opportunity to utilize other types of interrupts like MSI and MSI-X interrupts.
2021-12-14Kernel/Interrupts: Add ByteReaders to read possible unaligned MADT dataLiav A
The MADT data could be on unaligned boundary - for example, a GSI number (u32) on unaligned address which leads to a KUBSAN error and halting the system.
2021-12-11Kernel: Remove unused String.h includesHendiadyoin1
This makes searching for not yet OOM safe interfaces a bit easier.
2021-11-08Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>Andreas Kling
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace! This was a slightly tedious refactoring that took a long time, so it's not unlikely that some bugs crept in. Nevertheless, it does pass basic functionality testing, and it's just real nice to finally see the same pattern in all contexts. :^)
2021-10-15Kernel: Add cross platform RegisterState header and Aarch64 versionJames Mintram
A new RegisterState header includes the platform specific RegisterState header based on the platform being compiled. The Aarch64 RegisterState header contains stubs for Debug
2021-10-06Kernel: Don't retrieve possibly nonexistent APIC tableTim Schumacher
2021-10-03Kernel: Use `operator ""sv` in all purpose() implementationsBrian Gianforcaro
Previously there was a mix of returning plain strings and returning explicit string views using `operator ""sv`. This change switches them all to standardized on `operator ""sv` as it avoids a call to strlen.
2021-10-01Kernel: Move x86 IO instructions code into the x86 specific folderLiav A
2021-10-01Kernel: Remove IO.h include from a bunch of placesLiav A
2021-09-12Kernel: Move ACPI and BIOS code into the new Firmware directoryLiav A
This will somwhat help unify them also under the same SysFS directory in the commit. Also, it feels much more like this change reflects the reality that both ACPI and the BIOS are part of the firmware on x86 computers.
2021-09-10AK+Everywhere: Reduce the number of template parameters of IntrusiveListAli Mohammad Pur
This makes the user-facing type only take the node member pointer, and lets the compiler figure out the other needed types from that.
2021-09-08Kernel/ACPI: Return Optional container after table searchLiav A
This is a better pattern than returning a PhysicalAddress with a zero value, so the code is more understandable now.
2021-09-06Kernel: Make kernel region allocators return KResultOr<NOP<Region>>Andreas Kling
This expands the reach of error propagation greatly throughout the kernel. Sadly, it also exposes the fact that we're allocating (and doing other fallible things) in constructors all over the place. This patch doesn't attempt to address that of course. That's work for our future selves.
2021-09-04Kernel: Add x2APIC supportTom
This allows addressing all cores on more modern processors. For now, we still have a hardcoded limit of 64 due to s_processors being a static array.
2021-08-29Kernel: Rename Spinlock::is_owned_by_current_thread()Andreas Kling
...to is_owned_by_current_processor(). As Tom pointed out, this is much more accurate. :^)
2021-08-29Kernel: {Mutex,Spinlock}::own_lock() => is_locked_by_current_thread()Andreas Kling
Rename these API's to make it more clear what they are checking.
2021-08-23Kernel: Rename Processor::id() => current_id()Andreas Kling
And let id() be the non-static version that gives you the ID of a Processor object.
2021-08-15Kernel: Make Kernel::VMObject allocation functions return KResultOrsin-ack
This makes for nicer handling of errors compared to checking whether a RefPtr is null. Additionally, this will give way to return different types of errors in the future.
2021-08-08Everywhere: Replace AK::Singleton => SingletonAndreas Kling
2021-08-06Kernel: Add convenience values to the Memory::Region::Access enumAndreas Kling
Instead of `Memory::Region::Access::Read | Memory::Region::AccessWrite` you can now say `Memory::Region::Access::ReadWrite`.
2021-08-06Kernel: Rename a very long enum to ShouldDeallocateVirtualRangeAndreas Kling
ShouldDeallocateVirtualMemoryVirtualRange was a bit on the long side.
2021-08-06Kernel: Make identity mapping mechanism used during AP boot non-genericAndreas Kling
When booting AP's, we identity map a region at 0x8000 while doing the initial bringup sequence. This is the only thing in the kernel that requires an identity mapping, yet we had a bunch of generic API's and a dedicated VirtualRangeAllocator in every PageDirectory for this purpose. This patch simplifies the situation by moving the identity mapping logic to the AP boot code and removing the generic API's.
2021-08-06Kernel: Move Kernel/Memory/ code into Kernel::Memory namespaceAndreas Kling
2021-08-06Kernel: Rename Kernel/VM/ to Kernel/Memory/Andreas Kling
This directory isn't just about virtual memory, it's about all kinds of memory management.
2021-08-06Kernel: Make IRQController::model() return StringViewAndreas Kling
2021-08-01Kernel: Remove unused header includesBrian Gianforcaro
2021-07-21Kernel: Use IntrusiveList for keeping track of GenericInterruptHandlersAndreas Kling
2021-07-11Kernel: Remove unused header includes in Interrupts subtreeBrian Gianforcaro
2021-07-11Kernel: Make various T::class_name() and similar return StringViewAndreas Kling
Instead of returning char const*, we can also give you a StringView.
2021-07-04Kernel: Hide the implementation detail that MSRs use two registersGunnar Beutner
When retrieving and setting x86 MSRs two registers are required. The existing setter and getter for the MSR class made this implementation detail visible to the caller. This changes the setter and getter to use u64 instead.
2021-07-03Kernel: Add missing override specifiersDaniel Bertalan
The `#pragma GCC diagnostic` part is needed because the class has virtual methods with the same name but different arguments, and Clang tries to warn us that we are not actually overriding anything with these. Weirdly enough, GCC does not seem to care.
2021-06-24Kernel: Move special sections into Sections.hHendiadyoin1
This also removes a lot of CPU.h includes infavor for Sections.h
2021-06-24Kernel: Remove unused CPU.h includesHendiadyoin1
In most cases we did not need it at all, in other, we only needed one header from it
2021-06-24Kernel: Pull apart CPU.hHendiadyoin1
This does not add any functional changes
2021-06-17Kernel/Interrupts: Return boolean on whether we handled the interruptLiav A
If we are in a shared interrupt handler, the called handlers might indicate it was not their interrupt, so we should not increment the call counter of these handlers.
2021-06-17Kernel/Interrupts: Enumerate nested handlers in a shared handlerLiav A
When asked to enumerate all interrupt handlers, display all shared handlers within it instead of just returning the responsible handler of them.
2021-05-31AK+Kernel: Disallow implicitly lifting pointers to OwnPtr'sAli Mohammad Pur
This doesn't really _fix_ anything, it just gets rid of the API and instead makes the users explicitly use `adopt_own_if_non_null()`.
2021-05-27Kernel: Explicitly initialize bools in IOAPIC mappingAndrew Kaster
The compiler couldn't convince itself that these are always initialized when compiling with Og. They are always initialized before use, because the only branch where they weren't had VERIFY_NOT_REACHED.
2021-05-05Kernel: Add Processor::is_bootstrap_processor() function, and use it. (#6871)Brian Gianforcaro
The variety of checks for Processor::id() == 0 could use some assistance in the readability department. This change adds a new function to represent this check, and replaces the comparison everywhere it's used.
2021-05-03Kernel: Remove unused header includes from various files.Brian Gianforcaro
Found while browsing code with CLion.