Commit Graph

33609 Commits

Author SHA1 Message Date
Andreas Kling
cffcfca80a Kernel: Remove unused bool return values from scheduler functions
Turns out nobody actually cared whether the scheduler switched to a new
thread or not (which is what we were returning.)
2022-01-30 16:21:59 +01:00
Andreas Kling
a6b5065d94 Kernel: Simplify x86 IOPL sanity check
Move this architecture-specific sanity check (IOPL must be 0) out of
Scheduler and into the x86 enter_thread_context(). Also do this for
every thread and not just userspace ones.
2022-01-30 16:21:59 +01:00
Andreas Kling
684d5eed19 Kernel: VERIFY that Scheduler::context_switch() always has a from-thread
We always context_switch() from somewhere, so there's no need to handle
the case where from_thread is null.
2022-01-30 16:21:59 +01:00
Andreas Kling
09f0843716 Kernel: Enforce that Thread::unblock_from_mutex() doesn't happen in IRQ
Mutexes are not usable from IRQ handlers, so unblock_from_mutex()
can simply VERIFY() that the current processor is not in an IRQ.
2022-01-30 16:21:59 +01:00
Andreas Kling
b0e5406ae2 Kernel: Update terminology around Thread's "blocking mutex"
It's more accurate to say that we're blocking on a mutex, rather than
blocking on a lock. The previous terminology made sense when this code
was using something called Kernel::Lock, but since it was renamed to
Kernel::Mutex, this updates brings the language back in sync.
2022-01-30 16:21:59 +01:00
Andreas Kling
dca5fe69eb Kernel: Make Thread::State an enum class and use it consistently
It was annoyingly hard to spot these when we were using them with
different amounts of qualification everywhere.

This patch uses Thread::State::Foo everywhere instead of Thread::Foo
or just Foo.
2022-01-30 16:21:59 +01:00
Andreas Kling
7d89409618 Kernel: Don't dispatch signals in Thread::block_impl()
If the blocker is interrupted by a signal, that signal will be delivered
to the process when returning to userspace (at the syscall exit point.)
We don't have to perform the dispatch manually in Thread::block_impl().
2022-01-30 16:21:59 +01:00
Andreas Kling
677da0288c Kernel: Don't dispatch signals in Processor::enter_current()
Signal dispatch is already taken care of elsewhere, so there appears to
be no need for the hack in enter_current().

This also allows us to remove the Thread::m_in_block flag, simplifying
thread blocking logic somewhat.

Verified with the original repro for #4336 which this was meant to fix.
2022-01-30 16:21:59 +01:00
Andreas Kling
3845c90e08 Kernel: Remove unnecessary includes from Thread.h
...and deal with the fallout by adding missing includes everywhere.
2022-01-30 16:21:59 +01:00
Andreas Kling
f469fb47b8 Kernel: Move Thread::block<BlockerType>() out of the Thread.h header
This function is large and unwieldy and forces Thread.h to #include
a bunch of things. The only reason it was in the header is because we
need to instantiate a blocker based on the templated BlockerType.

We actually keep block<BlockerType>() in the header, but move the
bulk of the function body out of line into Thread::block_impl().

To preserve destructor ordering, we add Blocker::finalize() which is
called where we'd previously destroy the Blocker.
2022-01-30 16:21:59 +01:00
Andreas Kling
79ee846f3d AK: Disable the empty-string-vs-null-string test until we have a fix 2022-01-30 16:21:59 +01:00
networkException
f49948cc48 LibGUI: Collect menu and submenu actions for CommandPalette
We now not only collect actions that are children of windows but also
all actions that are part of a window's menus and submenus :^)
2022-01-30 15:24:35 +01:00
networkException
3a50ab3f4c LibGUI: Increase the width of a CommandPalette dialog 2022-01-30 15:24:35 +01:00
networkException
4af973fec6 LibGUI: Add Menu column to CommandPalette :^)
This patch adds a new column to CommandPalette showing the menu an
action is part of
2022-01-30 15:24:35 +01:00
networkException
1921a166e5 Tests: Add test for null string and empty string to be unequal
See #12213
2022-01-30 15:24:35 +01:00
Jelle Raaijmakers
98d666eab3 Kernel: Support PS/2 right super key
We currently support the left super key. This poses an issue on
keyboards that only have a right super key, such as my Steelseries 6G.

The implementation mirrors the left/right shift key logic and
effectively considers the right super key identical to the left one.
2022-01-30 15:08:49 +01:00
bugreport0
c20f1e06c0 LibGUI: Flash menubar when using command palette 2022-01-30 01:32:20 +01:00
networkException
048ed64c26 LibGUI: Allow CommandPalette to distinguish radio buttons and checkboxes 2022-01-30 01:27:14 +01:00
Idan Horowitz
fe687412a6 LibJS: Visit m_async_from_sync_iterator_prototype in GlobalObject
This prevents random crashes in for async loops due to GC.
2022-01-29 22:35:43 +00:00
Timothy Flynn
3b2ec01038 LibJS: Update spec numbers for ECMA-402
Intl.Segmenter is now section 18; bump the "Locale Sensitive Functions".
2022-01-29 22:23:25 +00:00
Daniel Bertalan
5b64abe76e Shell: Use StringView instead of String const& where feasible 2022-01-29 23:08:27 +01:00
Daniel Bertalan
1a4aad9b7e AK: Implement String's comparison operators in terms of StringView's 2022-01-29 23:08:27 +01:00
Daniel Bertalan
5b3ba2d9ad AK: Implement FlyString's comparison operators in terms of StringView's 2022-01-29 23:08:27 +01:00
Daniel Bertalan
ca58c71faa AK: Implement all comparison operators for StringView 2022-01-29 23:08:27 +01:00
Idan Horowitz
2e5a9b4fab Kernel: Use HashCompatible HashMap lookups instead of specifying a hash 2022-01-29 23:01:23 +02:00
Idan Horowitz
c68609b27f Kernel: Make {Nonnull,}OwnPtr<KString> hash compatible with StringView
This will allow us to use KString as HashTable/HashMap keys more easily
2022-01-29 23:01:23 +02:00
Idan Horowitz
9b0d90a71d AK: Support using custom comparison operations for hash compatible keys 2022-01-29 23:01:23 +02:00
Timothy Flynn
4a99170cd2 LibJS: Implement Intl.Collator.prototype.resolvedOptions 2022-01-29 20:27:24 +00:00
Timothy Flynn
17306078b5 LibJS: Implement Intl.Collator.supportedLocalesOf 2022-01-29 20:27:24 +00:00
Timothy Flynn
5a1eefcc1d js: Implement pretty-printing of Intl.Collator 2022-01-29 20:27:24 +00:00
Timothy Flynn
06a6100b12 LibJS: Implement the Intl.Collator constructor 2022-01-29 20:27:24 +00:00
Timothy Flynn
1607a05d4c LibJS: Add co, kf, and kn Unicode locale keywords to ResolveLocale 2022-01-29 20:27:24 +00:00
Timothy Flynn
4a3e142d55 LibJS: Implement a nearly empty Intl.Collator object
This adds plumbing for the Intl.Collator object, constructor, and
prototype.
2022-01-29 20:27:24 +00:00
Timothy Flynn
4d43aeae30 LibUnicode: Fill in case-first and numeric BCP47 keywords
Unlike other BCP47 keywords that we are parsing, these only appear in
the BCP47 XML file itself within the CLDR. The values are very simple
though, so just hard code them until the Unicode org re-releases the
CLDR with BCP47: https://unicode-org.atlassian.net/browse/CLDR-15158
2022-01-29 20:27:24 +00:00
Lady Gegga
2ad38102f5 Base: Add Osage to font Katica Regular 10
104B0-104FB https://www.unicode.org/charts/PDF/U104B0.pdf
2022-01-29 19:57:45 +00:00
Dmitry Petrov
2616b61eee WebContent: Switch scroll direction on shift modifier 2022-01-29 21:48:57 +02:00
Lenny Maiorani
b0a54518d8 Everywhere: Remove redundant inline keyword
`constexpr` implies `inline` so when both are used it is redundant.
2022-01-29 21:45:17 +02:00
Idan Horowitz
e28af4a2fc Kernel: Stop using HashMap in Mutex
This commit removes the usage of HashMap in Mutex, thereby making Mutex
be allocation-free.

In order to achieve this several simplifications were made to Mutex,
removing unused code-paths and extra VERIFYs:
 * We no longer support 'upgrading' a shared lock holder to an
   exclusive holder when it is the only shared holder and it did not
   unlock the lock before relocking it as exclusive. NOTE: Unlike the
   rest of these changes, this scenario is not VERIFY-able in an
   allocation-free way, as a result the new LOCK_SHARED_UPGRADE_DEBUG
   debug flag was added, this flag lets Mutex allocate in order to
   detect such cases when debugging a deadlock.
 * We no longer support checking if a Mutex is locked by the current
   thread when the Mutex was not locked exclusively, the shared version
   of this check was not used anywhere.
 * We no longer support force unlocking/relocking a Mutex if the Mutex
   was not locked exclusively, the shared version of these functions
   was not used anywhere.
2022-01-29 16:45:39 +01:00
Pankaj Raghav
60aa4152e9 Kernel: Optimize StorageDevice read and write function
Use shift operator with log size instead of division while calculating
the index and len.
2022-01-29 17:41:06 +02:00
Pankaj Raghav
24c66b8442 AK: Fix log2 calculation for Integer
For a `N` bit integer X, the log2 calculation should be as follows:
(N - 1) - ctz(X)
2022-01-29 17:41:06 +02:00
Pankaj Raghav
0f010cee02 Kernel: Add block_size_log helper to BlockDevice
It is useful to have the log2 value of the block size while calculating
index for an IO.
2022-01-29 17:41:06 +02:00
Pankaj Raghav
61027e5303 AK: Add is_power_of_2 helper 2022-01-29 17:41:06 +02:00
Pankaj Raghav
3b27e28e67 Kernel: Cache blocks_per_page in StorageDevice class
Instead of calculating blocks_per_page in every IO, cache it to save
CPU cycles as that value will not change after initialization.
2022-01-29 17:41:06 +02:00
Pankaj Raghav
cf44d71edf Kernel: Remove the assumption of 512 block size in read/write_block
Devices such as NVMe can have blocks bigger that 512. Use the
m_block_size variable in read/write_block function instead of the
hardcoded 512 block size.
2022-01-29 17:41:06 +02:00
Dylan Katz
caecb6ba72 DisplaySettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
362df5b6dd MailSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
3ee32b6dbf MouseSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
90b371ef47 KeyboardSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
ca912a87f1 BrowserSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
1c18261f8b LibGUI: Allow Label icons to be set from GML
This is similar to dd17df76e9, which
did the same thing for the Button widget.
2022-01-29 13:45:34 +01:00