summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-08LibC: Move stack canary initialization before the global constructorsTim Schumacher
Once again, QEMU creates threads while running its constructors, which is a recipe for disaster if we switch out the stack guard while that is already running in the background. To solve that, move initialization to our LibC initialization stage, which is before any actual external initialization code runs.
2022-07-08Kernel: Implement `sigsuspend` using a SignalBlockerTim Schumacher
`sigsuspend` was previously implemented using a poll on an empty set of file descriptors. However, this broke quite a few assumptions in `SelectBlocker`, as it verifies at least one file descriptor to be ready after waking up and as it relies on being notified by the file descriptor. A bare-bones `sigsuspend` may also be implemented by relying on any of the `sigwait` functions, but as `sigsuspend` features several (currently unimplemented) restrictions on how returns work, it is a syscall on its own.
2022-07-08Kernel: Unblock SignalBlocker if a signal was just unmarked as pendingTim Schumacher
When updating the signal mask, there is a small frame where we might set up the receiving process for handing the signal and therefore remove that signal from the list of pending signals before SignalBlocker has a chance to block. In turn, this might cause SignalBlocker to never notice that the signal arrives and it will never unblock once blocked. Track the currently handled signal separately and include it when determining if SignalBlocker should be unblocking.
2022-07-08Kernel: Don't let locks of the same owner conflict with each otherTim Schumacher
Documentation on POSIX locks seems sparse, but this is how the Linux kernel implementation handles it.
2022-07-08Kernel: Don't fail on unlocking nonexistent file locksTim Schumacher
I haven't found any POSIX specification on this, but the Linux kernel appears to handle it like that. This is required by QEMU, as it just bulk-unlocks all its file locking bytes without checking first if they are held.
2022-07-08Kernel: Do not disable userland access to the RDTSC instructionTim Schumacher
Access to RDTSC is occasionally restricted to give malware one less option to accurately time attacks (side-channels, etc.). However, QEMU requires access to the timestamp counter for the exact same reason (which is accurately timing its CPU ticks), so lets just enable it for now.
2022-07-08Tests: Remove the RDTSC kernel crash testTim Schumacher
We will remove the RDTSC instruction restriction to allow QEMU to read an accurate time, so this will no longer crash and therefore fail the test.
2022-07-08Kernel: Implement an `axallowed` mount optionTim Schumacher
Similar to `W^X` and `wxallowed`, this allows for anonymous executable mappings.
2022-07-08LibM: Implement fmaTim Schumacher
2022-07-08LibC: Add stubs for glob and globfreeTim Schumacher
2022-07-08LibUnicode: Remove now-unused Unicode::select_pattern_with_pluralityTimothy Flynn
2022-07-08LibJS: Use Intl.PluralRules within Intl.NumberFormatTimothy Flynn
This also allows removing a bit of a BigInt hack to resolve plurality of BigInt numbers (because the AOs used in ResolvePlural support BigInt, wherease the naive Unicode::select_pattern_with_plurality did not). We use cardinal form here; the number format patterns in the CLDR align with the cardinal form of the plural rules.
2022-07-08LibJS: Add an overload of ResolvePlural for use without PluralRulesTimothy Flynn
The NumberFormat spec casually indicates the need for a PluralRules object without explicity saying so, with text such as: "which may depend on x in languages having different plural forms." Other implementations actually do create a PluralRules object to resolve those cases with ResolvePlural. However, ResolvePlural doesn't need much from PluralRules to operate, so this can be abstracted out for use in NumberFormat without the need to allocate a PluralRules instance.
2022-07-08LibJS: Use Intl.PluralRules within Intl.DurationFormatTimothy Flynn
2022-07-08LibUnicode: Replace NumberFormat::Plurality with Unicode::PluralCategoryTimothy Flynn
To prepare for using plural rules within number & duration format, this removes the NumberFormat::Plurality enumeration. This also adds PluralCategory::ExactlyZero & PluralCategory::ExactlyOne. These are used in locales like French, where PluralCategory::One really means any value from 0.00 to 1.99. PluralCategory::ExactlyOne means only the value 1, as the name implies. These exact rules are not known by the general plural rules, they are explicitly for number / currency format.
2022-07-08LibJS+LibUnicode: Do not generate the PluralCategory enumTimothy Flynn
The PluralCategory enum is currently generated for plural rules. Instead of generating it, this moves the enum to the public LibUnicode header. While it was nice to auto-discover these values, they are well defined by TR-35, and we will need their values from within the number format code generator (which can't rely on the plural rules generator having run yet). Further, number format will require additional values in the enum that plural rules doesn't know about.
2022-07-08LibGUI: Unindent selected text on shift+tab presshuttongrabiel
Selected text is unindented when Shift+Tab is pressed. Select text, indent it with Tab, then unindent with Shift+Tab.
2022-07-08LibGUI: Indent selected text on tab presshuttongrabiel
If selected text is less than a whole line, usual delete/replace takes place. Otherwise, if the selected text is a whole line or spans multiple lines, the selection will be indented.
2022-07-08mount: Allow extending `fstab` via drop-in files in `fstab.d`Tim Schumacher
2022-07-08mount: Separate mounting by line into a new functionTim Schumacher
2022-07-08LibGUI: Support typing to search for ComboBoxzzLinus
LibGUI: Fixup missing one charactor issue
2022-07-08LibWeb: Add URLSearchParams as part of union type for XHR::send()Kenneth Myhra
This patch adds support for URLSearchParams to XHR::send() and introduces the union type XMLHttpRequestBodyInit. XHR::send() now has support for String and URLSearchParams.
2022-07-08HackStudio: Add the "Copy Full Path" TreeView context menu optionYuval
This commit adds support for the option described above. The option can be seen after a right click on a TreeView item, and it puts the item's full path in the clipboard.
2022-07-08HackStudio: Add the "Copy Relative Path" TreeView context menu optionYuval
This commit adds support for the option described above. The option can be seen after a right click on a TreeView item, and it puts the item's relative path in the clipboard (relative to the project's root directory).
2022-07-08Meta: Don't disable custom Toolchain on SerenityOSTim Schumacher
Parts of our build system and scripts rely on the fact that we are cross-compiling. For now, remove the "try to build natively" part to get the build running and leave a TODO for later.
2022-07-08Meta: Provide the correct path for `e2fsck` on SerenityOSTim Schumacher
2022-07-08Meta: Use `pls` instead of `sudo` on SerenityOSTim Schumacher
2022-07-08Userland: Add `/usr/local/sbin` to `PATH` by defaultTim Schumacher
`e2fsprogs` adds its tools there.
2022-07-08Ports: Add QOI converter and QOI benchmark utilityLiav A
2022-07-08Ports: Add stb header filesLiav A
2022-07-08LibJS: Use Intl.PluralRules within Intl.RelativeFormatTimothy Flynn
The Polish test cases added here cover previous failures from test262, due to the way that 0 is specified to be "many" in Polish.
2022-07-08LibJS: Implement Intl.PluralRules.prototype.selectTimothy Flynn
2022-07-08LibJS: Populate pluralCategories in Intl.PluralRules.resolvedOptionsTimothy Flynn
2022-07-08LibJS: Replace JS::Intl::PluralRules::Type with Unicode::PluralFormTimothy Flynn
The JS::Intl enum was added when implementing the PluralRules constructor. Now that LibUnicode has a plural rules implementation, replace the JS::Intl enum with the analagous Unicode enum.
2022-07-08LibJS: Mark the NumberFormat parameter of FormatNumericToString as constTimothy Flynn
Not critical, but in subsequent commits this will be invoked from a constant context.
2022-07-08LibUnicode: Generate a list of available plural categories per localeTimothy Flynn
Separate lists are generated for cardinal and ordinal form.
2022-07-08LibUnicode: Parse and generate per-locale plural rules from the CLDRTimothy Flynn
Plural rules in the CLDR are of the form: "cs": { "pluralRule-count-one": "i = 1 and v = 0 @integer 1", "pluralRule-count-few": "i = 2..4 and v = 0 @integer 2~4", "pluralRule-count-many": "v != 0 @decimal 0.0~1.5, 10.0, 100.0 ...", "pluralRule-count-other": "@integer 0, 5~19, 100, 1000, 10000 ..." } The syntax is described here: https://unicode.org/reports/tr35/tr35-numbers.html#Plural_rules_syntax There are up to 2 sets of rules for each locale, a cardinal set and an ordinal set. The approach here is to generate a C++ function for each set of rules. Each condition in the rules (e.g. "i = 1 and v = 0") is transpiled to a C++ if-statement within its function. Then lookup tables are generated to match locales to their generated functions. NOTE: -Wno-parentheses-equality is added to the LibUnicodeData compile flags because the generated plural rules have lots of extra parentheses (because e.g. we need to selectively negate and combine rules). The code to generate only exactly the right number of parentheses is quite hairy, so this just tells the compiler to ignore the extras.
2022-07-08Kernel/Storage: Do proper locking & reset in the AHCIController codeLiav A
The initialize_hba method now calls the reset method to reset the HBA and initialize each AHCIPort. Also, after full HBA reset we need to turn on the AHCI functionality of the HBA and global interrupts since they are cleared to 0 according to the specification in the GHC register.
2022-07-08Kernel/Storage: Move Identify page allocation to the AHCIPort classLiav A
Instead of doing this in a parent class like the AHCIController, let's do that directly in the AHCIPort class as that class is the only user of these sort of physical pages. While it seems like we waste an entire 4KB of physical RAM for each allocation, this could serve us later on if we want to fetch other types of logs from the ATA device.
2022-07-08Kernel/Storage: Rename AHCIPortHandler => AHCIInterruptHandlerLiav A
This reflects better what this object is all about - handling interrupts of AHCI ports, and nothing more than that.
2022-07-08Kernel/Storage: Simplify AHCIPortHandler classLiav A
The way AHCIPortHandler held AHCIPorts and even provided them with physical pages for the ATA identify buffer just felt wrong. To fix this, AHCIPortHandler is not a ref-counted object anymore. This solves the big part of the problem, because AHCIPorts can't hold a reference to this object anymore, only the AHCIController can do that. Then, most of the responsibilities are shifted to the AHCIController, making the AHCIPortHandler a handler of port interrupts only.
2022-07-08Kernel/Storage: Remove 3 stale methods in AHCIPortHandler classLiav A
2022-07-08Kernel/AHCI: Don't use UNMAP_AFTER_INIT in header filesLiav A
Instead, declare such methods and functions in the code itself.
2022-07-08Kernel: Clean up the AHCI code a bitLiav A
The AHCI code is not very good at OOM conditions, so this is a first step towards OOM correctness. We should not allocate things inside C++ constructors because we can't catch OOM failures, so most allocation code inside constructors is exported to a different function. Also, don't use a HashMap for holding RefPtr of AHCIPort objects in AHCIPortHandler because this structure is not very OOM-friendly. Instead use a fixed Array of 32 RefPtrs, as at most we can have 32 AHCI ports per AHCI controller.
2022-07-07Meta: Don't overwrite newer files when building the root filesystemTim Schumacher
2022-07-07Ports: Don't create ccache symlinks for tools we don't haveTim Schumacher
2022-07-07WebSocket: Change target name to deconflict with LibWebSocket on LagomAndrew Kaster
When compiling with Lagom, we give both LibWebSocket and the WebSocket IPC service the Lagom:: prefix as an alias, but strip the Lib from all library target names before applying the prefix. This creates a conflict when external projects used the aliased name between the server and the library. Give WebSocket a name that deconflicts it, but keep the binary name the same, /bin/WebSocket.
2022-07-07Ports: Update OpenSSL to 1.1.1qLuke Wilde
2022-07-06LibWeb: Use correct margin & padding values in anonymous wrapper boxesAndreas Kling
Anonymous wrappers get their non-inherited properties from the initial state of a new CSS::ComputedValues object. Before this patch, all the values in their margin and padding LengthBox would be "auto".
2022-07-06LibWeb: Cache a pointer to the IFC root in InlineLevelIteratorAndreas Kling