summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-07Kernel: TCPSocket always has a scratch bufferAndreas Kling
Let's encode this in the constructor signature.
2021-09-07Kernel/Net: Add a special SOCKET_TRY() and use it in socket codeAndreas Kling
Sockets remember their last error code in the SO_ERROR field, so we need to take special care to remember this when returning an error. This patch adds a SOCKET_TRY() that works like TRY() but also calls set_so_error() on the failure path. There's probably a lot more code that should be using this, but that's outside the scope of this patch.
2021-09-07Kernel: Use TRY() some more in SocketAndreas Kling
2021-09-07Kernel: Use KResultOr and TRY() for ThreadTracerAndreas Kling
Also make the constructor private, since it's only called by the static factory function.
2021-09-07Kernel: Make TCPSocket client construction use KResultOr and TRY()Andreas Kling
We don't really have anywhere to propagate the error in NetworkTask at the moment, since it runs in its own kernel thread and has no direct userspace caller.
2021-09-07Kernel: Use KResultOr and TRY() for FIFOAndreas Kling
2021-09-07Kernel: Use KResultOr and TRY() for MasterPTYAndreas Kling
2021-09-07Kernel: Make DoubleBuffer::try() return KResultOrAndreas Kling
This tidies up error propagation in a number of places.
2021-09-07Kernel: Rename file_description(fd) => open_file_description(fd)Andreas Kling
To go with the class rename.
2021-09-07Kernel: Rename FileDescription => OpenFileDescriptionAndreas Kling
Dr. POSIX really calls these "open file description", not just "file description", so let's call them exactly that. :^)
2021-09-07Kernel: Convert much of sys$execve() to using KStringAndreas Kling
Make use of the new FileDescription::try_serialize_absolute_path() to avoid String in favor of KString throughout much of sys$execve() and its helpers.
2021-09-07LibELF: Use StringView to carry temporary strings in auxiliary vectorAndreas Kling
Let's not force clients to provide a String.
2021-09-07Kernel: Add FileDescription::try_serialize_absolute_path()Andreas Kling
Unlike FileDescription::absolute_path(), this knows that failures can happen and will propagate them to the caller.
2021-09-07Kernel: Avoid unnecessary String allocation in sys$statvfs()Andreas Kling
2021-09-07Everywhere: Behaviour => BehaviorAndreas Kling
2021-09-07Kernel: Store process names as KStringAndreas Kling
2021-09-07Kernel: Tidy up ProcessProcFSTraits construction a bit moreAndreas Kling
Let the constructor take a Process& instead of a WeakPtr<Process> and avoid a bunch of WeakPtr copying.
2021-09-07Kernel: Make UserOrKernelBuffer return KResult from read/write/memsetAndreas Kling
This allows us to simplify a whole bunch of call sites with TRY(). :^)
2021-09-07Kernel/PCI: Turn on memory access by defaultLiav A
This will allow the Kernel to utilize memory access to the PCI configuration space if such method is available.
2021-09-07Kernel/PCI: Simplify the entire subsystemLiav A
A couple of things were changed: 1. Semantic changes - PCI segments are now called PCI domains, to better match what they are really. It's also the name that Linux gave, and it seems that Wikipedia also uses this name. We also remove PCI::ChangeableAddress, because it was used in the past but now it's no longer being used. 2. There are no WindowedMMIOAccess or MMIOAccess classes anymore, as they made a bunch of unnecessary complexity. Instead, Windowed access is removed entirely (this was tested, but never was benchmarked), so we are left with IO access and memory access options. The memory access option is essentially mapping the PCI bus (from the chosen PCI domain), to virtual memory as-is. This means that unless needed, at any time, there is only one PCI bus being mapped, and this is changed if access to another PCI bus in the same PCI domain is needed. For now, we don't support mapping of different PCI buses from different PCI domains at the same time, because basically it's still a non-issue for most machines out there. 2. OOM-safety is increased, especially when constructing the Access object. It means that we pre-allocating any needed resources, and we try to find PCI domains (if requested to initialize memory access) after we attempt to construct the Access object, so it's possible to fail at this point "gracefully". 3. All PCI API functions are now separated into a different header file, which means only "clients" of the PCI subsystem API will need to include that header file. 4. Functional changes - we only allow now to enumerate the bus after a hardware scan. This means that the old method "enumerate_hardware" is removed, so, when initializing an Access object, the initializing function must call rescan on it to force it to find devices. This makes it possible to fail rescan, and also to defer it after construction from both OOM-safety terms and hotplug capabilities.
2021-09-07Kernel: Avoid string creation for simple string comparisonBrian Gianforcaro
2021-09-07Kernel: Specify a lock rank for s_mm_lockBrian Gianforcaro
2021-09-07Kernel: Specify a lock rank for Thread::m_lockBrian Gianforcaro
2021-09-07Kernel/Locking: Add lock rank tracking to Spinlock/RecursiveSpinlockBrian Gianforcaro
2021-09-07Kernel/Locking: Add lock rank tracking per thread to find deadlocksBrian Gianforcaro
This change adds a static lock hierarchy / ranking to the Kernel with the goal of reducing / finding deadlocks when running with SMP enabled. We have seen quite a few lock ordering deadlocks (locks taken in a different order, on two different code paths). As we properly annotate locks in the system, then these facilities will find these locking protocol violations automatically The `LockRank` enum documents the various locks in the system and their rank. The implementation guarantees that a thread holding one or more locks of a lower rank cannot acquire an additional lock with rank that is greater or equal to any of the currently held locks.
2021-09-07Kernel: Track when a thread is in the middle of crashingBrian Gianforcaro
There are certain checks that we should skip if the system is crashing. The system can avoid stack overflow during crash, or even triple faulting while while handling issues that can causes recursive panics or aborts.
2021-09-07Meta: Don't immediately continue in serenity.sh's gdb optionIdan Horowitz
This allows us to step through the initial boot instructions.
2021-09-07Toolchain: Build aarch64-gdb for cross-debugging on x86Idan Horowitz
2021-09-07Kernel: Add a comment explaining an alternate path in Process::exec()Andreas Kling
I had to look at this for a moment before I realized that sys$execve() and the spawning of /bin/SystemServer at boot are taking two different paths out of exec(). Add a comment to help the next person looking at it. :^)
2021-09-07Kernel: Fix file description leak in sys$execve()Andreas Kling
Before this patch, we were leaking a ref on the open file description used for the interpreter (the dynamic loader) in sys$execve(). This surfaced when adapting the syscall to use TRY(), since we were now correctly transferring ownership of the interpreter to Process::exec() and no longer holding on to a local copy of it (in `elf_result`). Fixing the leak uncovered another problem. The interpreter description would now get destroyed when returning from do_exec(), which led to a kernel panic when attempting to acquire a mutex. This happens because we're in a particularly delicate state when returning from do_exec(). Everything is primed for the upcoming context switch into the new executable image, and trying to block the thread at this point will panic the kernel. We fix this by destroying the interpreter description earlier in do_exec(), at the point where we no longer need it.
2021-09-07Kernel: Don't seek the program executable description in sys$execve()Andreas Kling
The dynamic loader doesn't care if the kernel has moved the file cursor around before it gains control.
2021-09-07Kernel: Hoist allocation of main program FD in sys$execve()Andreas Kling
When executing a dynamically linked program, we need to pass the main program executable via a file descriptor to the dynamic loader. Before this patch, we were allocating an FD for this purpose long after it was safe to do anything fallible. If we were unable to allocate an FD we would simply panic the kernel(!) We now hoist the allocation so it can fail before we've committed to a new executable.
2021-09-07Kernel: Reorganize ELF loading so it can use TRY()Andreas Kling
Due to the use of ELF::Image::for_each_program_header(), we were previously unable to use TRY() in the ELF loading code (since the return statement inside TRY() would only return from the iteration callback.)
2021-09-07Kernel: Remove redundant [[nodiscard]] on KResult return valuesAndreas Kling
Both KResult and KResultOr are [[nodiscard]] at the class level, so there's no need to have functions return `[[nodiscard]] KResult`.
2021-09-07Kernel: Make copy_time_from_user() helpers use KResultOr<Time>Andreas Kling
...and use TRY() for smooth error propagation everywhere.
2021-09-06LibJS: Implement Intl.ListFormat.prototype.resolvedOptionsTimothy Flynn
2021-09-06LibJS: Implement Intl.ListFormat.prototype.formatToPartsTimothy Flynn
2021-09-06LibJS: Implement Intl.ListFormat.prototype.formatTimothy Flynn
2021-09-06LibJS: Implement Intl.ListFormat.supportedLocalesOfTimothy Flynn
2021-09-06LibJS: Implement the Intl.ListFormat constructorTimothy Flynn
2021-09-06js: Implement pretty-printing of Intl.ListFormatTimothy Flynn
2021-09-06LibJS: Implement a nearly empty Intl.ListFormat objectTimothy Flynn
This adds plumbing for the Intl.ListFormat object, constructor, and prototype.
2021-09-06LibUnicode: Remove Unicode locale variants from CLDR path namesTimothy Flynn
There's only a couple of cases like this, but there are some locale paths in the CLDR that contain variants. For example, there isn't a en-US path, but there is a en-US-POSIX path. This interferes with the operation to search for locales by name. The algorithm is such that searching for en-US will not result in en-US-POSIX being found. To resolve this, we should remove variants from the locale name.
2021-09-06LibUnicode: Parse and generate the Unicode locale list patterns datasetTimothy Flynn
This data informs consumers how to join lists of values. For example, in en-US, the list ["a", "b", "c"] formatted to a string should become "a, b, and c".
2021-09-06LibUnicode: Extract cldr-misc dataset from CLDR databaseTimothy Flynn
2021-09-07PixelPaint: Fix layer dragging bugMustafa Quraish
A previous commit I made broke layer dragging since the hole_index was always being computed with respect to the top of the layer list widget, however we were now drawing layers from the bottom. When you didn't have enough layers to fill up the full height, dragging them around would be weird. This patch computes the hole index correctly using the same offset we start drawing from, and fixes the behavior.
2021-09-06js: Include calendar in pretty-printing output of more Temporal objectsLinus Groh
We were only showing it for ZonedDateTime so far.
2021-09-06js: Implement pretty-printing of Temporal.PlainMonthDay objectsLinus Groh
2021-09-06js: Implement pretty-printing of Temporal.PlainYearMonth objectsLinus Groh
2021-09-06PixelPaint: Add `Crop to Selection` ActionMustafa Quraish
In addition to adding the action, this commit also makes the `did_change_rect()` method take in an optional rect, which represents the new rect position. By default it is the same as `rect()`. When we are cropping an image, we don't want to move the whole cropped section to the top-left of the original image in the ImageEditor widget, so this allows us to keep the cropped image's position fixed.