Commit graph

27097 commits

Author SHA1 Message Date
Andreas Kling
524ef5e475 Kernel: Add KBuffer::bytes() and use it
(Instead of hand-wrapping { data(), size() } in a bunch of places.)
2021-09-08 20:16:00 +02:00
Idan Horowitz
bee2de4b31 Kernel: Use an IntrusiveRedBlackTree for storing the cr3 mappings
This ensures we don't allocate when intializing the PageDirectory.
2021-09-08 19:17:07 +03:00
Idan Horowitz
0279fb4dd3 AK: Add key getter to IntrusiveRedBlackTreeNode 2021-09-08 19:17:07 +03:00
Idan Horowitz
cb9720baab AK: Set IntrusiveRBTree Node key on insertion instead of construction
This makes the API look much nicer.
2021-09-08 19:17:07 +03:00
Idan Horowitz
1db9250766 AK: Make IntrusiveRedBlackTree capable of holding non-raw pointers
This is completely based on e4412f1f59
and will allow us to convert some AK::HashMap users in the kernel.
2021-09-08 19:17:07 +03:00
Idan Horowitz
7bb3b2839e Kernel: Fix a typo in LockRank::Process's comment 2021-09-08 19:17:07 +03:00
Ben Wiederhake
2572f5ebec Documentation: Fix broken link in Documentation 2021-09-08 16:48:33 +02:00
Liav A
666c0c5a08 Kernel/VirtIO: Determine names without PCI access in IRQ context
This is a fix so the VirtIO code doesn't lead to assertion because we
try to determine the name based on the PCI values of the VirtIO device,
because trying to read from the PCI configuration space requires to
acquire a Mutex, which fails in an IRQ context.

To ensure we never encounter a situation when we call a pure virtual
function in an IRQ context, let's make class_name() method to be a
non-pure virtual function, so it can be still called at anytime.
2021-09-08 16:47:01 +02:00
Dawid Wolosowicz
ac798da642 SystemMonitor: West Const to East Const refactor 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
484b9c1ba3 LibGUI: West Const to East Const refactor 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
ec7879f628 SystemMonitor: Remove an unnecessarily specific inline capacity 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
2d91ba2737 LibGUI: Remove an unnecessarily specific inline capacity 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
8419eef85e LibGUI: Sync the highlighting after each model update
Without this, the highlighting would stay on the initial index even if
the matching row is no longer there.
2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
d0e44993a1 LibGUI: Refactor AbstractView::do_search() into two standalone steps
This change splits the do_search() into find_next_search_match() and
highlight_search() to allow the given index be independently highlighted
when needed.
2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
cc93736f21 LibGUI: Remove barely used AbstractView::is_searching() 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
b775b1c199 LibGUI: Unify naming of searching timer related members 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
9225b45c2d LibGUI: Rename AbstractView::m_searching => m_highlighted_search 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
aeffd9024e LibGUI: Remove barely used AbstractView::is_highlighting_searching() 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
0cbc222c17 LibGUI: Remove barely used AbstractView::searching() 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
e96081ef8f LibGUI: Make AbstractView::is_searching protected 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
000c74e6a8 SystemMonitor: Make the process list searchable 2021-09-08 15:48:02 +04:30
Andreas Kling
52ed43d139 LibWeb: Scroll viewport to (0, 0) after loading a new document
This fixes a long-standing bug where the view wouldn't update when
navigating to a new page after looking at the ACID2 test. This happened
because ACID2 actually scrolls the viewport far down. We didn't reset
the scroll position upon navigation, and so the new page thought that
we were still scrolled very far down, and this broke the invalidation
rect calculations.
2021-09-08 11:56:50 +02:00
Andreas Kling
e91edcaa28 LibWeb: Rename InitialContainingBlockBox => InitialContainingBlock
The "Box" suffix added nothing here.
2021-09-08 11:27:46 +02:00
Andreas Kling
e90ccf6a20 LibWeb: Make BrowsingContext::m_top_level_browsing_context a WeakPtr
At the moment, nested browsing contexts expect that there's always a
top-level browsing context at some higher level. That's okay, but let's
keep the top-level pointer in a WeakPtr to make it easier to catch
mistakes (as this turns UAF into a null dereference.)
2021-09-08 11:19:27 +02:00
Andreas Kling
ef371596a4 LibWeb: Remove unnecessary DOM::Position destructor 2021-09-08 11:14:29 +02:00
Andreas Kling
3a7e26ef28 LibWeb: Rename frame_did_set_viewport_rect() => browsing_context_*()
Names are still catching up after the Frame => BrowsingContext rename.
2021-09-08 11:12:22 +02:00
Andreas Kling
9d9500989a LibWeb: Remove unused PageClient::is_multi_process() 2021-09-08 11:07:14 +02:00
Andreas Kling
a38aefed0b LibWeb: Remove bogus forward declaration for Web::StackingContext
The real class is Web::Layout::StackingContext.
2021-09-08 11:07:14 +02:00
Andreas Kling
76b0253b6b LibWeb: Convert BrowsingContext to east-const style 2021-09-08 11:07:14 +02:00
Andreas Kling
57fbeff925 LibWeb: Use delegating constructors in BrowsingContext
This avoids having two nearly-identical initializer lists and and an
awkward setup() function that every constructor must call.
2021-09-08 11:07:14 +02:00
Andreas Kling
9d03ea6f74 LibWeb+WebContent: Port DumpLayoutTree to OutOfProcessWebView
This required adding a simple OOPWV::dump_layout_tree() API that
synchronously requests a dump of the layout tree from the WebContent
process.
2021-09-08 11:07:14 +02:00
Ben Wiederhake
c6e56612f5 LibGUI+WindowServer: Remove now-obsolete cursor tracking feature
This feature was problematic for several reasons:
- Tracking *all* the user activity seems like a privacy nightmare.
- LibGUI actually only supports one globally tracking widget per window,
  even if no window is necessary, or if multiple callbacks are desired.
- Widgets can easily get confused whether an event is actually directed
  at it, or is actually just the result of global tracking.

The third item caused an issue where right-clicking CatDog opened two
context menus instead of one.
2021-09-08 10:53:49 +02:00
Ben Wiederhake
0a69da08aa Magnifier: Remove unnecessary global cursor tracking 2021-09-08 10:53:49 +02:00
Ben Wiederhake
f717008bde CatDog: Switch to new mouse-tracking method 2021-09-08 10:53:49 +02:00
Ben Wiederhake
2f38cad987 Assistant: Fix lockfile logic
Previously, Assistant was able to re-execute itself due to a quirk in
the global cursor tracking logic, it seems.

Now it has become necessary to explicitly drop the lockfile before
activating the new Assistant instance.

Alternatively, this has always been a latent bug that only now has
become more likely.
2021-09-08 10:53:49 +02:00
Ben Wiederhake
dbc8465c20 Assistant: Remove unnecessary global cursor tracking 2021-09-08 10:53:49 +02:00
Ben Wiederhake
c6546c7b03 Eyes: Switch to new mouse-tracking method 2021-09-08 10:53:49 +02:00
Ben Wiederhake
45126655cd LibGUI+WindowServer: Introduce new mouse tracking mechanism 2021-09-08 10:53:49 +02:00
Liav A
bde3c7301e Kernel/ACPI: Return Optional container after table search
This is a better pattern than returning a PhysicalAddress with a zero
value, so the code is more understandable now.
2021-09-08 10:27:02 +02:00
davidot
43b17f27a3 test-js: Add a mark_as_garbage method to force GC to collect that object
This should fix the flaky tests of test-js.
It also fixes the tests when running with the -g flag since the values
will not be garbage collected too soon.
2021-09-08 08:53:02 +01:00
Rodrigo Tobar
3373090993 Ports: Add gsl 2021-09-08 08:49:56 +01:00
Luke Wilde
7788a7e744 LibJS: Fix Temporal.PlainTime.prototype.equals test
The two plain times weren't being compared to each other.
2021-09-08 08:48:13 +01:00
Nico Weber
62e0bf852e Kernel: Don't link Prekernel against libsupc++
It isn't needed.

Also, we stopped linking Kernel against it in 67f0c0d5f0. libsupc++
depends on symbols like free() or realloc() which we removed from
Kernel/StdLib.cpp after 67f0c0d5f0 and which don't exist in Prekernel
either.

(It also happens to make the aarc64 link fail in less obvious ways.)
2021-09-08 04:23:17 +00:00
Linus Groh
33f76f88bb LibJS: Add and use the CreateNegatedTemporalDuration AO
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6178ed3
2021-09-08 00:07:18 +01:00
Linus Groh
f046a4a75d LibJS: Make implementation-defined language more concise
This is a normative change in the Temporal spec. No behavioral change,
just a clarification.

See: https://github.com/tc39/proposal-temporal/commit/42c964e
2021-09-08 00:07:18 +01:00
Linus Groh
86a7c795f6 LibJS: Use the newly added remainder operation in GetISOPartsFromEpoch
This is a normative change in the Temporal spec. No behavioral change,
just a clarification.

See: https://github.com/tc39/proposal-temporal/commit/b7bdc65
2021-09-08 00:07:18 +01:00
Linus Groh
97cc8f4613 LibJS: Validate Calendar.prototype.fields() values more strictly
This is a normative change in the Temporal spec.

See:

- https://github.com/tc39/proposal-temporal/commit/75b66d8
- https://github.com/tc39/proposal-temporal/commit/9c2262b
2021-09-08 00:07:18 +01:00
Liav A
fb7b4caa57 Kernel/Storage: Implement basic AHCI hotplug support
This is really a basic support for AHCI hotplug events, so we know how
to add a node representing the device in /sys/dev/block and removing it
according to the event type (insertion/removal).

This change doesn't take into account what happens if the device was
mounted or a read/write operation is being handled.

For this to work correctly, StorageManagement now uses the Singleton
container, as it might be accessed simultaneously from many CPUs
for hotplug events. DiskPartition holds a WeakPtr instead of a RefPtr,
to allow removal of a StorageDevice object from the heap.
StorageDevices are now stored and being referenced to via an
IntrusiveList to make it easier to remove them on hotplug event.

In future changes, all of the stated above might change, but for now,
this commit represents the least amount of changes to make everything
to work correctly.
2021-09-08 00:42:20 +02:00
Liav A
74c4c864bd Kernel+SystemServer: Simplify the DevTmpFS design
We are no longer have a separate Inode object class for the pts
directory. With a small exception to this, all chmod and chown code
is now at one place.
It's now possible to create any name of a sub-directory in the
filesystem.
2021-09-08 00:42:20 +02:00
Liav A
a7cb2ca1bf SystemServer: Don't rely on fstab to specify where to mount the ProcFS
For now, just hardcode the mounting in SystemServer code.
2021-09-08 00:42:20 +02:00