summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-08Kernel: Remove two unused fields from sys$execve's LoadResultAndreas Kling
2021-02-08Kernel: Make the space lock a RecursiveSpinLockAndreas Kling
2021-02-08Kernel: Move ShouldAllocateTls enum from Process to execve.cppAndreas Kling
2021-02-08Kernel: Always hold space lock while calculating memory statisticsAndreas Kling
And put the locker at the top of the functions for clarity.
2021-02-08Kernel: Move memory statistics helpers from Process to SpaceAndreas Kling
2021-02-08Kernel: Skip generic region lookup in sys$futex and sys$get_stack_boundsAndreas Kling
Just ask the process space directly instead of using the generic region lookup that also checks for kernel regions.
2021-02-08LibCpp: Depend on LibSyntaxItamar
We need this now that the C++ syntax highlighter is in LibCpp.
2021-02-08ping: Replace two magic numbers with ICMP_* macrosLinus Groh
2021-02-08LibC: Define ICMP header type constants in netinet/ip_icmp.hLinus Groh
Let's get rid of some magic numbers soon. :^)
2021-02-08Revert "DynamicLoader: Remove unnecessary math functions"Andreas Kling
This reverts commit b1f1f5afcf8f3b8a3ca10bcb6aefa05fbb2b35be. Unfortunately this broke dbgln() in the dynamic loader. We need to figure out how to link libgcc into it properly.
2021-02-08Kernel: Reorganize ptrace implementation a bitAndreas Kling
The generic parts of ptrace now live in Kernel/Syscalls/ptrace.cpp and the i386 specific parts are moved to Arch/i386/CPU.cpp
2021-02-08Kernel: Set the dumpable flag before switching spaces in sys$execve()Andreas Kling
2021-02-08Kernel: Remove outdated code to dump memory layout after exec loadAndreas Kling
2021-02-08WindowServer: Cache rendered window frame in bitmapTom
This only renders the window frame once until the size of the window changes, or some other event requires re-rendering. It is rendered to a temporary bitmap, and then the top and bottom part is stored in one bitmap as well as the left and right part. This also adds an opacity setting, allowing it to be rendered with a different opacity. This makes it easier to enhance window themes and allows using arbitrary bitmaps with e.g. alpha channels for e.g. shadows.
2021-02-08WindowServer: Calculate transparent frame occlusionsTom
If a window frame has transparency, include these areas in the transparency rendering area so that we can render them flicker-free.
2021-02-08Kernel: Factor address space management out of the Process classAndreas Kling
This patch adds Space, a class representing a process's address space. - Each Process has a Space. - The Space owns the PageDirectory and all Regions in the Process. This allows us to reorganize sys$execve() so that it constructs and populates a new Space fully before committing to it. Previously, we would construct the new address space while still running in the old one, and encountering an error meant we had to do tedious and error-prone rollback. Those problems are now gone, replaced by what's hopefully a set of much smaller problems and missing cleanups. :^)
2021-02-08Kernel: Remove unused MemoryManager::validate_range()Andreas Kling
This is no longer used since we've switched to using the MMU to generate EFAULT errors.
2021-02-08Kernel: Remove unused Process::for_each_thread_in_coredump()Andreas Kling
2021-02-08Build: Allow setting DBGLN_NO_COMPILETIME_FORMAT_CHECK via CMake flagAndreas Kling
2021-02-08AK: Add dbgln() format checkingAnotherTest
This checks the following things: - No unclosed braces in format string `dbgln("a:{}}", a)` where the '}}' would be interpreted as a literal '}' `dbgln("a:{", a)` where someone with a faulty keyboard like mine could generate - No extra closed braces in format string `dbgln("a:{{}", a)` where the '{{' would interpreted as a literal '{' `dbgln("a:}", a)` where someone with a faulty keyboard could generate - No references to nonexistent arguments `dbgln("a:{} b:{}", a)` where the value of `b` is not in the arguments list - No unconsumed argument `dbgln("a:{1}", not_used, 1)` where `not_used` is extraneous
2021-02-08Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)AnotherTest
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
2021-02-08Kernel: Make Arch/i386/CPU.cpp safe to run through clang-formatAnotherTest
This file was far too messy, and touching it was a major pain. Also enable clang-format linting on it.
2021-02-08Everywhere: Fix obvious dbgln() bugsAnotherTest
This will allow compiletime dbgln() checks to pass
2021-02-08UserspaceEmulator: Use vdbgln() instead of dbgln() when reportingAnotherTest
This will avoid conflict with the upcoming compiletime checks.
2021-02-08AK: Add an iota_array() function that can generate an arrayAnotherTest
...of increasing values with an optional offset.
2021-02-08AK: Clean up includes around printf/vdbgprintfBen Wiederhake
2021-02-08Everywhere: Remove unnecessary headers 4/4Ben Wiederhake
Arbitrarily split up to make git bisect easier. These unnecessary #include's were found by combining an automated tool (which determined likely candidates) and some brain power (which decided whether the #include is also semantically superfluous).
2021-02-08Everywhere: Remove unnecessary headers 3/4Ben Wiederhake
Arbitrarily split up to make git bisect easier. These unnecessary #include's were found by combining an automated tool (which determined likely candidates) and some brain power (which decided whether the #include is also semantically superfluous).
2021-02-08Everywhere: Remove unnecessary headers 2/4Ben Wiederhake
Arbitrarily split up to make git bisect easier. These unnecessary #include's were found by combining an automated tool (which determined likely candidates) and some brain power (which decided whether the #include is also semantically superfluous).
2021-02-08Everywhere: Remove unnecessary headers 1/4Ben Wiederhake
Arbitrarily split up to make git bisect easier. These unnecessary #include's were found by combining an automated tool (which determined likely candidates) and some brain power (which decided whether the #include is also semantically superfluous). My favorite #include: #include "Applications/Piano/Music.h" // You can't have too much music in life!
2021-02-08Everywhere: Fix weird includesBen Wiederhake
2021-02-08Fuzz: Remove unused FuzziliJS headerBen Wiederhake
2021-02-08Everywhere: Add semantically-missing includesBen Wiederhake
For example, FindInFilesWidget.h mentions GUI::TableView, but did not include it. On the other hand, all source files that include FindInFilesWidget.h also include TableView.h, so the issue is only cosmetical.
2021-02-08AK: remove unused and uninteresting return valueBen Wiederhake
The return value is always be 'count', even in the case of 0. Note that the return value of TypedTransfer::copy() is likewise uninteresting, but apparently it is beig used. Hence this patch does not touch it.
2021-02-08Documentation: QtCreator and <syscall.h>Ben Wiederhake
2021-02-08Documentation: Update QtCreator includes for Debug.hBen Wiederhake
Including 'Build/' is unfortunate, but this seems to be what everyone does, short of creating a symlink/hardlink from /AK/Debug.h to /Build/AK/Debug.h. This feels like a crutch, but it's a better crutch than having a workaround that could easily break or corrupt commits (i.e., the symlinks).
2021-02-08LibTTF: Check if the given offset plus offset table size would overflowLuke
If it does overflow, it would think there was enough data to read in table information, when there isn't. This would cause read buffer overflows when reading in the table information. Found by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29338&sort=-opened&can=1&q=proj%3Aserenity
2021-02-08LibJS: Don't assume match for each capture group in RegExp.prototype.exec()Linus Groh
This was not implementing the following part of the spec correctly: 27. For each integer i such that i ≥ 1 and i ≤ n, do a. Let captureI be ith element of r's captures List. b. If captureI is undefined, let capturedValue be undefined. Expecting a capture group match to exist for each of the RegExp's capture groups would assert in Vector's operator[] if that's not the case, for example: /(foo)(bar)?/.exec("foo") Append undefined instead. Fixes #5256.
2021-02-08Kernel: KResultOr can use the same storage as the object for the errorTom
Since it can only hold either an object or an error code, we can share the same storage to hold either.
2021-02-08LibWeb: Implement Element.getElementsBy{Tag,Class}Name()Linus Groh
Just like the Document variants, but using the given Element as for_each_in_subtree_of_type() root.
2021-02-08LibWeb: Make getElementsByClassName() case-insensitive in quirks modeLinus Groh
From https://dom.spec.whatwg.org/#concept-getelementsbyclassname: The comparisons for the classes must be done in an ASCII case- insensitive manner if root’s node document’s mode is "quirks", and in an identical to manner otherwise.
2021-02-08LibWeb: Make getElementsByTagName() case-insensitive for HTML elementsLinus Groh
From https://dom.spec.whatwg.org/#concept-getelementsbytagname: 2. Otherwise, if root’s node document is an HTML document, return a HTMLCollection rooted at root, whose filter matches the following descendant elements: * Whose namespace is the HTML namespace and whose qualified name is qualifiedName, in ASCII lowercase. * Whose namespace is not the HTML namespace and whose qualified name is qualifiedName.
2021-02-07Kernel: Fix KResultOr copy-move from itself caseTom
If move-assigning from itself we shouldn't do anything.
2021-02-07Kernel: Use KResultOr::release_value in Process::create_kernel_threadTom
This should avoid an unneccessary reference bump.
2021-02-07Kernel: Change KResultOr::take_value to use move semanticsTom
This may be more light weight than copying the object.
2021-02-07Kernel: Remove ancient unused Scheduler::beep() declarationAndreas Kling
2021-02-07Kernel: Remove a handful of unused things from ThreadAndreas Kling
2021-02-07Kernel: Don't allocate kernel stack twice per thread :^)Andreas Kling
2021-02-07LibGUI: Add missing "final" in TextEditorAndreas Kling
2021-02-07Kernel: Make sure we can allocate kernel stack before creating threadAndreas Kling
Wrap thread creation in a Thread::try_create() helper that first allocates a kernel stack region. If that allocation fails, we propagate an ENOMEM error to the caller. This avoids the situation where a thread is half-constructed, without a valid kernel stack, and avoids having to do messy cleanup in that case.