summaryrefslogtreecommitdiff
path: root/Kernel/SpinLock.h
AgeCommit message (Collapse)Author
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2020-12-27Kernel: Tag more methods and types as [[nodiscard]]Brian Gianforcaro
Tag methods at where not obvserving the return value is an obvious error with [[nodiscard]] to catch potential future bugs.
2020-11-11Kernel: Minor SpinLock improvementsTom
2020-08-19Kernel: Do not wait before first attempt at locking SpinLock (#3212)Muhammad Zahalqa
2020-07-30Kernel: Simplify the ScopedSpinLock templateAndreas Kling
We can just templatize the LockType here. This makes my Qt Creator syntax highlighting work again. :^)
2020-07-06Kernel: Add SMP IPI supportTom
We can now properly initialize all processors without crashing by sending SMP IPI messages to synchronize memory between processors. We now initialize the APs once we have the scheduler running. This is so that we can process IPI messages from the other cores. Also rework interrupt handling a bit so that it's more of a 1:1 mapping. We need to allocate non-sharable interrupts for IPIs. This also fixes the occasional hang/crash because all CPUs now synchronize memory with each other.
2020-07-06Kernel: Tidy up SpinLock and related classes a little bitAndreas Kling
2020-07-06Kernel: Various context switch fixesTom
These changes solve a number of problems with the software context swithcing: * The scheduler lock really should be held throughout context switches * Transitioning from the initial (idle) thread to another needs to hold the scheduler lock * Transitioning from a dying thread to another also needs to hold the scheduler lock * Dying threads cannot necessarily be finalized if they haven't switched out of it yet, so flag them as active while a processor is running it (the Running state may be switched to Dying while it still is actually running)
2020-07-03Kernel: Fix signal deliveryTom
When delivering urgent signals to the current thread we need to check if we should be unblocked, and if not we need to yield to another process. We also need to make sure that we suppress context switches during Process::exec() so that we don't clobber the registers that it sets up (eip mainly) by a context switch. To be able to do that we add the concept of a critical section, which are similar to Process::m_in_irq but different in that they can be requested at any time. Calls to Scheduler::yield and Scheduler::donate_to will return instantly without triggering a context switch, but the processor will then asynchronously trigger a context switch once the critical section is left.
2020-07-03Kernel: Change kmalloc lock to be recursiveTom
If the heap code dumps a stack trace (e.g. out of memory) then it may recursively call into it. Rather than deadlocking, allow recursion.
2020-07-01Kernel: Implement software context switching and Processor structureTom
Moving certain globals into a new Processor structure for each CPU allows us to eventually run an instance of the scheduler on each CPU.
2020-07-01Kernel: Serialize debug outputTom