summaryrefslogtreecommitdiff
path: root/Kernel/Assertions.h
AgeCommit message (Collapse)Author
2021-08-04AK+Kernel: Print TODO when a TODO() is executedsin-ack
Previously we would just print "ASSERTION FAILED: false", which was kinda cryptic and also didn't make it clear whether this was a TODO or an unreachable condition. Now, we actually print "ASSERTION FAILED: TODO", making it crystal clear.
2021-06-29Kernel: Add `[[unlikely]]` attribute to VERIFYDaniel Bertalan
This optimization has already been done in LibC's `assert.h`, which Userland `VERIFY()` calls resolve to. We now use it in the kernel, but with the nicer C++ *unlikely* attribute instead of `__builtin_expect`. This tells the compiler to arrange the generated machine code so that the error-free branches execute faster (e.g. fewer jumps, better cache locality).
2021-06-11Kernel: Enable VERIFY() checks even if the DEBUG macro is not definedGunnar Beutner
Fixes #7910.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-18Kernel+LibC: Clean up how assertions work in the kernel and LibCGunnar Beutner
This also brings LibC's abort() function closer to the spec.
2021-02-23Everywhere: Remove unused RELEASE_ASSERT macroAndreas Kling
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-21Everywhere: Switch from (void) to [[maybe_unused]] (#4473)Lenny Maiorani
Problem: - `(void)` simply casts the expression to void. This is understood to indicate that it is ignored, but this is really a compiler trick to get the compiler to not generate a warning. Solution: - Use the `[[maybe_unused]]` attribute to indicate the value is unused. Note: - Functions taking a `(void)` argument list have also been changed to `()` because this is not needed and shows up in the same grep command.
2020-07-01Kernel: List all CPUs in /proc/cpuinfoTom
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-05-30AK+LibC: Add TODO() as an alternative to ASSERT_NOT_REACHED()Andreas Kling
I've been using this in the new HTML parser and it makes it much easier to understand the state of unfinished code branches. TODO() is for places where it's okay to end up but we need to implement something there. ASSERT_NOT_REACHED() is for places where it's not okay to end up, and something has gone wrong.
2020-02-10Kernel: Remove more <LibBareMetal/Output/kstdio.h> includesAndreas Kling
2020-02-09Kernel: Apply changes to use LibBareMetal definitionsLiav A
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.
2019-06-07Kernel: Move i386.{cpp,h} => Arch/i386/CPU.{cpp,h}Andreas Kling
There's a ton of work that would need to be done before we could spin up on another architecture, but let's at least try to separate things out a bit.
2019-05-28Add clang-format fileRobin Burchell
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
2019-04-23Put assertions behind a DEBUG flag to make it easy to build without them.Andreas Kling
2019-04-10Kernel: Remove two unneeded headers.Andreas Kling
2019-04-03Kernel: Remove unneeded kassert.h.Andreas Kling
2018-10-16Add a simple IDEDiskDevice class that implements DiskDevice from VFS.Andreas Kling
2018-10-16Import the "gerbert" kernel I worked on earlier this year.Andreas Kling
It's a lot crappier than I remembered it. It's gonna need a lot of work.