Commit graph

33585 commits

Author SHA1 Message Date
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
Itamar
1aa8f73ddb IPCCompiler: Don't loop endlessly on nameless parameters
Previously, given a malformed IPC call declaration, where a parameter
does not have a name, the IPCCompiler would spin endlessly while
consuming more and more memory.

This is because it parses the parameter type incorrectly
(it consumes superfluous characters into the parameter type).

An example for such malformed declaration is:
tokens_info_result(Vector<GUI::AutocompleteProvider::TokenInfo>) =|

As a temporary fix, this adds VERIFY calls that would fail if we're at
EOF when parsing parameter names.

A real solution would be to parse C++ parameter types correctly.
LibCpp's Parser could be used for this task.
2022-01-29 12:44:15 +01:00
Liav A
308e54bc19 AK+Kernel: Implement UUID mixed endianness support
This is being used by GUID partitions so the first three dash-delimited
fields of the GUID are stored in little endian order but the last two
fields are stored in big endian order, hence it's a representation which
is mixed.
2022-01-29 13:35:54 +02:00
Rummskartoffel
2d67d141e6 UserspaceEmulator: Implement ioctl TIOCSTI 2022-01-29 11:22:43 +01:00
Rummskartoffel
e636e2abbe UserspaceEmulator: Implement ioctl TCFLSH 2022-01-29 11:22:43 +01:00
Rummskartoffel
a92719fc72 UserspaceEmulator: Implement signal masking 2022-01-29 11:22:43 +01:00
Rummskartoffel
335183d0e9 UserspaceEmulator: Implement virt$sigprocmask 2022-01-29 11:22:43 +01:00
Rummskartoffel
33b4b86141 UserspaceEmulator: Implement virt$getppid 2022-01-29 11:22:43 +01:00
Rummskartoffel
273f15e8ea UserspaceEmulator: Implement ioctl TIOCGPGRP 2022-01-29 11:22:43 +01:00
Rummskartoffel
ef151afac8 UserspaceEmulator: Implement ioctl TIOCSWINSZ 2022-01-29 11:22:43 +01:00
Rummskartoffel
b393fe573d UserspaceEmulator: Implement ioctl FIONBIO 2022-01-29 11:22:43 +01:00
Rummskartoffel
0c88a53d4c UserspaceEmulator: Convert virt$ioctl to use switch-case 2022-01-29 11:22:43 +01:00
networkException
fcd97a3e19 LibGUI: Show radio buttons for checkable actions in CommandPalette
This patch adds a painting delegate to the icon column of CommandPalette
to show a radio button in case an action is checkable and does not
explicitly have an icon :^)
2022-01-29 11:22:02 +01:00
networkException
b67d4ab52f LibGUI: Allow falling back to default paint behavior in delegate
This patch adds a method that can optionally be implemented to allow
a TableCellPaintingDelegate to fall back to the default painting in a
View.
2022-01-29 11:22:02 +01:00
networkException
e2df145e14 WindowServer: Allow checking checkable entries in a menu using space 2022-01-29 11:22:02 +01:00
Andreas Kling
d748a3c173 Kernel: Only lock process file descriptor table once in sys$poll()
Grab the OpenFileDescriptions mutex once and hold on to it while
populating the SelectBlocker::FDVector.
2022-01-29 02:17:12 +01:00
Andreas Kling
b56646e293 Kernel: Switch process file descriptor table from spinlock to mutex
There's no reason for this to use a spinlock. Instead, let's allow
threads to block if someone else is using the descriptor table.
2022-01-29 02:17:09 +01:00
Andreas Kling
8ebec2938c Kernel: Convert process file descriptor table to a SpinlockProtected
Instead of manually locking in the various member functions of
Process::OpenFileDescriptions, simply wrap it in a SpinlockProtected.
2022-01-29 02:17:06 +01:00
Timothy Flynn
93e90e16c3 Base: Add a man page for the timezone utility 2022-01-28 23:18:17 +00:00
Ali Mohammad Pur
e72521f286 LibCoredump: Copy out the FooInfo structs to an aligned address
We were handing out unaligned pointers to these, which made UBSAN super
mad, copy them out to avoid that.
2022-01-28 22:51:27 +00:00
Ali Mohammad Pur
e0db9cb876 LibDebug+LibCoredump: Replace remaining reinterpret_casts and C casts
You misused your toys and I'm now taking them away, reflect on what you
did wrong for a bit.
2022-01-28 22:51:27 +00:00
Ali Mohammad Pur
da3c4e5df5 LibDebug+LibCoredump: Use ByteReader to do unaligned reads
The previous solution of "lol whats a UB" was not nice and tripped over
itself when it was run under UBSAN, fix this by doing explicit
byte-by-byte reads where needed.
2022-01-28 22:51:27 +00:00
Ali Mohammad Pur
6d64b13a1b LibDebug+Everywhere: Avoid void* -> FlatPtr -> void* dance
And limit the `void*` to the functions that interface the system (i.e.
ptrace wrappers).
This generally makes the code less riddled with casts.
2022-01-28 22:51:27 +00:00
Andreas Kling
b27b22a68c Kernel: Allocate entire SelectBlocker::FDVector at once
Use try_ensure_capacity() + unchecked_append() instead of repeatedly
doing try_append().
2022-01-28 23:41:18 +01:00
Andreas Kling
a12e19c015 Kernel: Move kernel region checks from x86 page fault handler to MM
Ideally the x86 fault handler would only do x86 specific things and
delegate the rest of the work to MemoryManager. This patch moves some of
the address checks to a more generic place.
2022-01-28 23:41:18 +01:00