Commit graph

25296 commits

Author SHA1 Message Date
Linus Groh
6852ba4d34 LibJS: Implement Temporal.Instant.prototype.subtract() 2021-08-07 13:10:35 +01:00
Linus Groh
b38f1fb071 LibJS: Implement Temporal.Instant.prototype.add() 2021-08-07 13:10:35 +01:00
Linus Groh
8ffad70504 LibJS: Add missing spec link to Temporal.Instant.prototype.round() 2021-08-07 13:10:35 +01:00
Andreas Kling
b197fc40a7 Kernel: Port process thread lists to SpinLockProtectedValue
I had to move the thread list out of the protected base area of Process
so that it could live with its lock (which needs to be mutable).
Ideally it would live in the protected area, so maybe we can figure out
a way to do that later.
2021-08-07 13:46:16 +02:00
Andreas Kling
d6667e4cb8 Kernel: Port process groups to SpinLockProtectedValue 2021-08-07 13:30:59 +02:00
Linus Groh
6762378f89 LibJS/Tests: Add length test for Temporal.Instant.prototype.round() 2021-08-07 12:10:34 +01:00
Linus Groh
cdb0c879d3 LibJS/Tests: Add length test for Temporal.Instant.prototype.equals() 2021-08-07 12:10:34 +01:00
Linus Groh
a8ba2f4b21 LibJS/Tests: Fix bad copy and paste that crept into a lot of tests
The top-level function should have been `describe()``, but instead it's
been nested `test()`s.
2021-08-07 12:10:34 +01:00
Timothy
1927dbf025 PixelPaint: Use unveil to hide file system 2021-08-07 12:48:22 +02:00
Timothy
62af82f494 AK: Use east const in MappedFile 2021-08-07 12:48:22 +02:00
Timothy
bc75ca4fe5 AK: Add method to create MappedFile from fd 2021-08-07 12:48:22 +02:00
Timothy
95ee7069d5 FileSystemAccessServer: Add window title as parameter for opening file 2021-08-07 12:48:22 +02:00
Brian Gianforcaro
d496eb48e3 Kernel: Fix boot profiling after big process lock separation regression
When I laid down the foundation for the start of the big process lock
separation, I added asserts to all system call implementations to
validate we hold the big process lock in the locations we think we
should be.

Adding that assert to sys$profiling_enable broke boot time profiling as
we were never holding the lock on boot. Even though it's not technically
required, lets make sure to hold the lock while enabling to appease the
assert.
2021-08-07 12:38:59 +02:00
Andreas Kling
58fb38551c Kernel/TTY: Remove redundant SpinLock from VirtualConsole
VirtualConsole::m_lock was only used in a single place: on_tty_write()
That function is already protected by a global lock, so this second
lock served no purpose whatsoever.
2021-08-07 12:38:14 +02:00
Brian Gianforcaro
b5b67a1747 SystemServer: Handle missing service executable gracefully
I use the `configure-components` functionality locally during
development. There are a few services (SpiceAgent) which aren't marked
as required components, and hence aren't built in all configurations,
but we still try to launch them in all configurations.

Instead of letting the forked SystemServer process crash, lets
gracefully handle the situation of a missing binary and provide a
message to the user.
2021-08-07 12:30:50 +02:00
Andreas Kling
5acb7e4eba Kernel: Remove outdated FIXME about ProcessHandle
ProcessHandle hasn't been a thing since Process became ref-counted.
2021-08-07 12:29:26 +02:00
Liav A
02c72de090 Meta: Remove legacy hardware components from Q35 machine
As this is a test machine I use personally to test "modern" hardware
setups, it feels quite comfortable to not care too much about VGA with
this type of machine.
Also, we don't actively use the IDE controller on this machine type, so
let's just remove it :^)
2021-08-07 11:49:07 +02:00
Jean-Baptiste Boric
08891e82a5 Kernel: Migrate process list locking to ProtectedValue
The existing recursive spinlock is repurposed for profiling only, as it
was shared with the process list.
2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
8554b66d09 Kernel: Make process list a singleton 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
626b99ce1c Kernel: Migrate hostname locking to ProtectedValue 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
9517100672 Kernel: Migrate UDP socket table locking to ProtectedValue 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
9216c72bfe Kernel: Migrate TCP socket tables locking to ProtectedValue
Note: TCPSocket::create_client() has a dubious locking process where
the sockets by tuple table is first shared lock to check if the socket
exists and bail out if it does, then unlocks, then exclusively locks to
add the tuple. There could be a race condition where two client
creation requests for the same tuple happen at the same time and both
cleared the shared lock check. When in doubt, lock exclusively the
whole time.
2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
583abc27d8 Kernel: Migrate IPv4 socket table locking to ProtectedValue 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
edd6c04024 Kernel: Migrate local socket table locking to ProtectedValue 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
6d83b2d8f0 Kernel: Migrate FIFO table locking to ProtectedValue 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
25d7beec6b Kernel: Use atomic integer for next FIFO id 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
738e604bfc Kernel: Migrate ARP table locking to ProtectedValue 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
75260bff92 Kernel: Introduce ProtectedValue
A protected value is a variable with enforced locking semantics. The
value is protected with a Mutex and can only be accessed through a
Locked object that holds a MutexLocker to said Mutex. Therefore, the
value itself cannot be accessed except through the proper locking
mechanism, which enforces correct locking semantics.

The Locked object has knowledge of shared and exclusive lock types and
will only return const-correct references and pointers. This should
help catch incorrect locking usage where a shared lock is acquired but
the user then modifies the locked value.

This is not a perfect solution because dereferencing the Locked object
returns the value, so the caller could defeat the protected value
semantics once it acquires a lock by keeping a pointer or a reference
to the value around. Then again, this is C++ and we can't protect
against malicious users from within the kernel anyways, but we can
raise the threshold above "didn't pay attention".
2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
39ceefa5dd Kernel: Implement contended, ref-counted resource framework
This is some syntaxic sugar to use a ContendedResource object with
reference counting. This effectively dissociates merely holding a
reference to an object and actually using the object in a way that
requires locking it against concurrent use.
2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
019ad8a507 Kernel: Introduce spin-locked contended and locked resource concepts 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
3d684316c2 Kernel: Introduce contended and locked resource concepts 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
aea98a85d1 Kernel: Move Lockable into its own header 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
2c3b0baf76 Kernel: Move SpinLock.h into Locking/ 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
f7f794e74a Kernel: Move Mutex into Locking/ 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
479b07339c Kernel: Move LockMode into Locking/ 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
786036820b AK: Introduce IntrusiveListRelaxedConst
This container is the same as IntrusiveList, except that it allows
modifications to the elements even if the reference to the
IntrusiveList itself is const, by returning mutable iterators. This
represents a use-case where we want to allow modifications to the
elements while keeping the list itself immutable.

This behavior is explicitely opt-in by using IntrusiveListRelaxedConst
instead of IntrusiveList. It will be useful later on when we model
shared/exclusive locks with the help of const and mutable references.
2021-08-07 11:48:00 +02:00
sin-ack
bb609cee7f Meta: Add run-local.sh
This allows one to set their desired parameters for run.sh without the
need to set them in every terminal session or add it to the user account
shell files. If a run-local.sh file exists at the repository root and is
executable, it will be sourced. The file can contain any variables that
are expected to be set in run.sh.
2021-08-07 11:47:07 +02:00
sin-ack
ab39a94fdf LibJS: Cast length to signed integer before subtraction
length is size_t as returned, and so subtracting from it may cause
underflow. We handle this case by just casting it to a signed value, and
the for loop predicate takes care of the rest.
2021-08-07 11:32:16 +02:00
sin-ack
3bea3f11e5 CI: Fix node-version typo
Otherwise this generates an "unexpected inputs" warning.
2021-08-07 09:30:28 +02:00
Linus Groh
f12152f77e LibJS: Reflect an editorial change in the Temporal spec
See: https://github.com/tc39/proposal-temporal/commit/fb9b550
2021-08-07 01:21:39 +01:00
Linus Groh
5d536c7fbc LibJS: Reflect infallibility editorial changes in the Temporal spec
See: https://github.com/tc39/proposal-temporal/commit/de918c9
2021-08-07 01:15:45 +01:00
LuK1337
0a7041aad7 Taskbar: Pass full argv for exit action
We need to pass --now to `shutdown` command.
2021-08-07 01:37:28 +02:00
Andreas Kling
f770b9d430 Kernel: Fix bad search-and-replace renames
Oops, I didn't mean to change every *Range* to *VirtualRange*!
2021-08-07 00:39:06 +02:00
Tobias Christiansen
0ca085910e PixelPaint: Make Guides' visibility optional
Whether Guides are drawn or not is now controlled via the menu-entry
View->Show Guides.
2021-08-07 02:52:47 +04:30
Tobias Christiansen
193f1e01cf PixelPaint: Add the GuideTool to the Toolbox
This also adds a custom icon for the GuideTool.
2021-08-07 02:52:47 +04:30
Tobias Christiansen
7923929a4d PixelPaint: Add GuideTool for editing Guides
This patch adds the logic for the GuideTool. Pulling in from outside the
image creates a new Guide, moving a Guide outside of the image deletes
it and a Guide can be deleteted via the context menu.
A Guide is considered clicked when the cursor is less than 20 pixels
away from the line.
2021-08-07 02:52:47 +04:30
Tobias Christiansen
d4cf4b74c1 PixelPaint: Allow creation of Guides via the View-Menu
You can specify the offset in percent, and it's getting parsed and
calculated appropriately.
2021-08-07 02:52:47 +04:30
Tobias Christiansen
515bbd0b83 PixelPaint: Add a Dialog for the creation of a Guide
You can select whether you want a horizontal or a vertical Guide and
specify the offset you want it to be at.
2021-08-07 02:52:47 +04:30
Tobias Christiansen
a717caa4b7 PixelPaint: Include Guides in the ImageEditor
The ImageEditor knows about its Guides, how to draw them and exposes
ways to manipulate them.
2021-08-07 02:52:47 +04:30
Tobias Christiansen
7e01d06226 PixelPaint: Add Guide class
This will allow the user to add Guides to the image, that will only be
visible in the Editor, not affecting the image.
2021-08-07 02:52:47 +04:30