Commit graph

24191 commits

Author SHA1 Message Date
Hendiadyoin1
c5f6ba6e71 AK: Introduce Math.h
This is to implement constexpr template based implementations for
mathematical functions

This also changes math.cpp to use these implementations.

Also adds a fastpath for floating point trucation for values smaller
than the signed 64 bit limit.
2021-07-19 16:34:21 +04:30
Gunnar Beutner
675de847f7 Kernel: Remove obsolete code 2021-07-19 11:29:09 +02:00
Gunnar Beutner
b6ddb4b70f Kernel: Simplify the linker script for the prekernel 2021-07-19 11:29:09 +02:00
Gunnar Beutner
a364f5c7b7 Kernel: Make sure super pages are in the first 16MiB of physical memory
This was broken by recent changes.
2021-07-19 11:29:09 +02:00
Gunnar Beutner
e01cc39eed SoundPlayer: Fix a spelling mistake in a variable name 2021-07-19 11:27:58 +02:00
Kenneth Myhra
37543234ce Ports: Bump libffi from version 3.3 to 3.4.2 2021-07-19 10:45:47 +02:00
brapru
4563d6da8d Applets: Add tooltip for Clipboard History 2021-07-19 10:31:40 +02:00
Karol Kosek
7f02270f01 SoundPlayer: End M3U tag names with a colon 2021-07-19 10:27:36 +02:00
Karol Kosek
aa6028298e SoundPlayer: Clear M3U track metadata after parsed file
Before this change, the track metadata was duplicated over and over
until it was overwritten.
2021-07-19 10:27:36 +02:00
Tom
18eeb3db87 WindowServer: Fix crash rendering fullscreen window
Fixes #8869
2021-07-19 10:24:58 +02:00
Idan Horowitz
94322ea985 LibJS: Implement Temporal.PlainDate.prototype.calendar 2021-07-19 09:11:20 +01:00
Idan Horowitz
94e1324a67 LibJS: Implement Temporal.PlainDate.prototype[@@toStringTag] 2021-07-19 09:11:20 +01:00
Idan Horowitz
cc00ccec41 LibJS: Start implementing Temporal.PlainDate
This commit adds the PlainDate object itself, its constructor and
prototype (currently empty), and several required abstract operations.
2021-07-19 09:11:20 +01:00
Idan Horowitz
ff6ca0f02d LibCrypto: Add operator<= and operator>= to SignedBigInteger 2021-07-19 09:11:20 +01:00
Brian Gianforcaro
121e7626d0 Kernel: Rename PerformanceEvent methods to be more ARCH independent 2021-07-19 08:46:55 +02:00
Brian Gianforcaro
1cffecbe8d Kernel: Push ARCH specific ifdef's down into RegisterState functions
The non CPU specific code of the kernel shouldn't need to deal with
architecture specific registers, and should instead deal with an
abstract view of the machine. This allows us to remove a variety of
architecture specific ifdefs and helps keep the code slightly more
portable.

We do this by exposing the abstract representation of instruction
pointer, stack pointer, base pointer, return register, etc on the
RegisterState struct.
2021-07-19 08:46:55 +02:00
Andrew Kaster
ff8429a749 LibTest/Utilities: Add method for TestRunner to print failed test names
If a test run has a lot of tests in it, and they fill up the terminal
buffer, it can be difficult to find out exactly which tests have failed
from your large test run. Make TestRunner print out an optional Vector
of failed test names at the end of the run, and have run-tests add each
failed or crashed test to a Vector it uses for this purpose.
2021-07-19 05:17:05 +04:30
Andrew Kaster
64aac345d3 AK: Use new Formatter for each element in Formatter<Vector<T>>
The state of the formatter for the previous element should be thrown
away for each iteration. This showed up when trying to format a
Vector<String>, since Formatter<StringView> was unhappy about some state
that gets set when it's called. Add a test for Formatter<Vector>.
2021-07-19 05:17:05 +04:30
Andrew Kaster
4842c8c902 AK: Use StringView literals in Format to avoid strlen
We don't want to be constructing StringViews at runtime if we don't have
to in Formatter code.
2021-07-19 05:17:05 +04:30
Andreas Kling
e49af4bac9 Kernel/E1000: Consolidate RX and TX buffer regions
Allocate all the RX buffers in one big memory region (and same for TX.)
This removes 38 lines from every crash dump (and just seems like a
reasonable idea in general.)
2021-07-19 02:16:24 +02:00
Linus Groh
5516ad7158 LibJS: Rename Temporal.now => Temporal.Now
See:

- https://github.com/tc39/proposal-temporal/commit/d0acb66
- https://github.com/tc39/proposal-temporal/commit/0097fdd
2021-07-19 00:59:26 +01:00
Linus Groh
d159938acc LibJS: Reflect recent editorial changes in the Temporal proposal
See:

- https://github.com/tc39/proposal-temporal/commit/2148441
- https://github.com/tc39/proposal-temporal/commit/08c04cc
- https://github.com/tc39/proposal-temporal/commit/b77da58
2021-07-19 00:59:26 +01:00
Linus Groh
5c77885873 LibJS: Implement Temporal.Duration.from()
...with ParseTemporalDurationString currently TODO()'d.
2021-07-19 00:34:28 +01:00
Linus Groh
7355c23e17 LibJS: Fix TemporalDurationLike property order
The table is sorted alphabetically and supposed to be iterated in that
oder. Also move this to a templated lambda for later re-use with
different target structs and value types.
2021-07-19 00:34:28 +01:00
Linus Groh
152251f5a7 LibJS: Move Temporal AO structs/enum classes above function declarations
This is a bit closer to our usual style, and tidier.
2021-07-19 00:34:28 +01:00
Tom
7ae46ae218 WindowServer: Fix menu over-drawing
We only need to re-draw the item being selected and the item being
deselected. We also don't care anymore if applets were added or
removed as we no longer have a global menu bar.
2021-07-18 23:55:13 +02:00
Peter Bindels
8a4971f908 CI: Enable build breaks on x86_64 test failures 2021-07-18 23:36:08 +02:00
Tom
668de76fa7 Kernel: Don't truncate physical address in ACPI table to 32 bits
We need to cast physical addresses to PhysicalPtr instead of FlatPtr,
which is currently always 64 bits. However, if one day we were to
support 32 bit non-pae mode then it would also truncate appropriately.
2021-07-18 22:09:05 +02:00
Tom
a635ff4e60 Everywhere: Make tracking cpu usage independent from system ticks
This switches tracking CPU usage to more accurately measure time in
user and kernel land using either the TSC or another time source.
This will also come in handy when implementing a tickless kernel mode.
2021-07-18 22:08:26 +02:00
Tom
7e77a2ec40 Everywhere: Improve CPU usage calculation
As threads come and go, we can't simply account for how many time
slices the threads at any given point may have been using. We need to
also account for threads that have since disappeared. This means we
also need to track how many time slices we have expired globally.

However, because this doesn't account for context switches outside of
the system timer tick values may still be under-reported. To solve this
we will need to track more accurate time information on each context
switch.

This also fixes top's cpu usage calculation which was still based on
the number of context switches.

Fixes #6473
2021-07-18 22:08:26 +02:00
Peter Bindels
ef85c4f747 Tests: Make mmap test point to new kernel address too
During a recent commit the 64-bit kernel was moved to a different
address, breaking this test (unnoticed). This fixes it, so we can
turn on breaking x86_64 tests on the CI again.
2021-07-18 22:08:20 +02:00
Gunnar Beutner
e3b7ae0c77 Meta: Remove unused bootloader_test target
Due to other changes this is now just a copy of the q35 target.
2021-07-18 22:08:03 +02:00
Gunnar Beutner
61a8f3e81a Kernel: Fix GRUB config by specifying the correct file name 2021-07-18 22:08:03 +02:00
Gunnar Beutner
5ff1416076 Kernel: Rename bootloader to prekernel
There are a few occurrences of the old name that slipped through.
2021-07-18 22:08:03 +02:00
Max Wipfli
439bed301e Base: Associate .profile extension with Profiler 2021-07-18 19:01:57 +02:00
Max Wipfli
a6c4e84ac8 Kernel: Add .profile extension to perfcore files
This adds a ".profile" extension to perfcore files written by the
Kernel. Also, the process name is now visible in the perfcore filename.

Furthermore, this patch adds error handling for the case where the
filename generated by the Kernel is already taken. In that case, a digit
will be added to the filename (before the extension).

This also adds some more error logging to dump_perfcore().
2021-07-18 19:01:57 +02:00
Ali Mohammad Pur
c85ab623c0 LibJS: Use a Utf8View on the subject if the regex has the unicode flag
This makes LibRegex behave (more) correctly with regards to matching
unicode code points.
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
f364fcec5d LibRegex+Everywhere: Make LibRegex more unicode-aware
This commit makes LibRegex (mostly) capable of operating on any of
the three main string views:
- StringView for raw strings
- Utf8View for utf-8 encoded strings
- Utf32View for raw unicode strings

As a result, regexps with unicode strings should be able to properly
handle utf-8 and not stop in the middle of a code point.
A future commit will update LibJS to use the correct type of string
depending on the flags.
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
e5af15a6e9 LibRegex: Don't do out-of-bound match accesses when a test fails 2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
a245ea1743 AK: Add the at()/operator[]() getter to Utf32View
This is trivial, and makes it easier to get the code point compared to
the previous `.code_points()[index]` (which was not actually checked
for in-bounds length).
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
55fa51b4e2 AK: Add a is_null() method to Utf{8,32}View
Both of these can be null as well as empty, and there's a difference.
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
2961982277 LibRegex: Use <...> includes in RegexMatch.h 2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
5089fd8b3c LibRegex: Also print a newline after each debug line
Otherwise the new debug line would be printed right after the previous
one without a newline.
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
052004f92d LibRegex: Partially implement string compare for Utf32View 2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
da1fda73a7 LibRegex: Implement line splitting for Utf32View
Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
0060fa48d4 AK: Don't return a null Utf32View when a zero-length one is requested
There is still an offset to consider, a zero-length view is very
different from a nonexistent string :P

Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2021-07-18 21:10:55 +04:30
Tom
2f754013a1 LibGUI: Fix widgets not being occluded
Widget::is_visible_for_timer_purposes needs to also consult with the
base implementation, which ultimately checks the owning Window's
visibility and occlusion state. Widget::is_visible merely determins
whether a widget should be visible or not, regardless of the window's
state.

Fixes #8825
2021-07-18 18:39:20 +02:00
Tom
220886db4c WindowServer: Fix compositor overdraw issues related to transparency
We were re-rendering areas that were considered transparency areas even
though they weren't transparency areas or were occluded by opaque
areas.

In order to fix this, we need to be a bit smarter about what is above
and below any given window. Even though a window may have transparent
areas, if those are occluded by opaque window areas on top they are
not actually any areas that should be rendered at all. And the opposite
also applies, opaque window areas for windows below that are occluded
by transparent areas, do need to be rendered as transparency. This
solves the problem of unnecessary transparency areas.

The other problem is that we need to know what areas of a window's
dirty rectangles affect other windows, and where. Basically any
opaque area that is somehow below a transparent area that isn't
otherwise occluded, and any transparent area above any other window
area (transparent or opaque) needs to be marked dirty prior to
composing. This makes sure that all affected windows render these
areas in the correct order. To track these, we now have a map of
affected windows and the rectangles that are affected (because not all
of that window's transparency areas may be affected).
2021-07-18 18:39:20 +02:00
Tom
6bb1825366 WindowServer: Recompute occlusions when removing an overlay
This makes sure we don't needlessly render areas with transparency
that used to be occupied by an overlay.
2021-07-18 18:39:20 +02:00
Gunnar Beutner
f56ee10a13 Kernel: Hand out 64-bit addresses to userspace 2021-07-18 17:31:13 +02:00