Commit graph

20643 commits

Author SHA1 Message Date
Lenny Maiorani 98468ae2d2 Variant: Remove redundant inline keyword
Problem:
- `constexpr inline` is redundant because `constexpr` implies `inline`.

Solution:
- Remove redundancy.
2021-05-20 18:58:18 +02:00
Brendan Coles 3bbae6c18b HexEditor: find_and_highlight: Limit search to remaining buffer size 2021-05-20 18:40:18 +02:00
Idan Horowitz df7d938808 Kernel: Stop allocating the PS2KeyboardDevice in the eternal heap
The PS2KeyboardDevice can be free'd in try_to_initialize if the
initialization failed, resulting in an assertion.
2021-05-20 18:40:02 +02:00
Andreas Kling 59fec42a25 StateMachineGenerator: Put output into the CMake build directory
Don't pollute the source directory with generated code.
2021-05-20 18:10:59 +02:00
Andreas Kling 93ef661914 WindowServer+DisplaySettings: Remove the weird "simple" wallpaper mode
Painting the wallpaper at 100% scale in the top left corner is a weird
mode and I don't think we need it. :^)
2021-05-20 17:52:38 +02:00
Andreas Kling 3046b3467c DisplaySettings: Improve wallpaper preview code
Previously, this code would create a bitmap with the size of the screen
resolution, draw the new wallpaper into it, and then scale it down for
display inside the MonitorWidget.

This was done on every paint event, which made the code quite slow and
allocation-happy.

Instead of this, we now scale down the new wallpaper to a miniature
of the same scale as the little MonitorWidget screen. The miniature is
then used for tiling, etc. The miniature is cached and reused across
paint events if nothing else changes.
2021-05-20 17:52:38 +02:00
Andreas Kling df5f382b50 3DFileViewer: Remove unveil() calls and add "thread" pledge
An application that allows opening arbitrary files from the filesystem
needs to allow itself to access the filesystem, otherwise there's no
point in supporting the feature. :^)

And the "thread" pledge is needed for background thumbnail generation.
2021-05-20 17:52:38 +02:00
Andreas Kling 5419e2b510 Base: Update ladyball icons based on new variant from myphs 2021-05-20 17:52:38 +02:00
Ali Mohammad Pur c6b12841ee Meta: Make generate_state_machine() generate a proper target
And use GENERATED_SOURCES (or add_dependencies) to make LibVT depend on
that target.
Fixes a FIXME.
2021-05-20 12:11:27 +01:00
Ali Mohammad Pur a42bf04701 Meta: Add my email(s) to .mailmap
Also map the author name I used before to my current proper name.
2021-05-20 08:58:55 +01:00
Gunnar Beutner 8854d72e16 Meta: Add my other e-mail address to .mailmap 2021-05-20 09:43:17 +02:00
Brian Gianforcaro bbe315d8c0 Kernel: Fix regression, removing a ProcessGroup that not in the list
I introduced this bug in e95eb7a51, where it's possible that the
ProcessGroup is created, but we never add it to the list. Make sure we
check that we are in the list before removal. This only broke booting in
self-test mode oddly enough.

Reported-By: Andrew Kaster <andrewdkaster@gmail.com>
2021-05-20 09:41:52 +02:00
Brian Gianforcaro cdb93e9307 Meta: Add a .mailmap file to map email addresses to the same comitter
.mailmap files are documented here: https://git-scm.com/docs/gitmailmap
2021-05-20 09:09:35 +02:00
Gunnar Beutner 8495d6aeca Kernel: Use the Function class for smp_broadcast()/smp_unicast()
This avoids allocations for smp_broadcast() and smp_unicast() by
using the Function class.
2021-05-20 09:09:10 +02:00
Gunnar Beutner cac7a8ced9 Kernel: Use the Function class for deferred_call_queue()
This avoids allocations for deferred_call_queue().
2021-05-20 09:09:10 +02:00
Gunnar Beutner 7557f2db90 Kernel: Remove an allocation when blocking a thread
When blocking a thread with a timeout we would previously allocate
a Timer object. This removes the allocation for that Timer object.
2021-05-20 09:09:10 +02:00
Gunnar Beutner 96b75af5d1 AK: Don't unlink intrusive list elements in the destructor
Removing the element from the intrusive linked list might not be safe
if doing so requires a lock. Instead this is something the caller
should have done so let's verify instead that we're not on any lists.
2021-05-20 09:09:10 +02:00
Josh Perry c46ab4fbb9
LibChess: Fixed PGN export bug (#7300)
In cases with ambiguous captures involving pawns (where multiple pieces
could have made the capture), we were exporting invalid syntax for
the move:

`1. e4 e5 2. Bb5 c6 3. Bxc6 ddxc6`

Move 3 should be `Bxc6 dxc6`, but we were duplicating the d on the pawn
move.
2021-05-20 08:32:19 +02:00
Anand 4a2dd5bf66 Inspector: Throw an error when inspecting a process it has no access to 2021-05-20 08:21:48 +02:00
Brian Gianforcaro e95eb7a51d Kernel: Avoid allocating under spinlock in ProcessGroup::find_or_create
Avoid allocating while holding the g_process_groups_lock spinlock, it's
a pattern that has a negative effect on performance and scalability,
especially given that it is a global lock, reachable by all processes.
2021-05-20 08:10:07 +02:00
Brian Gianforcaro bb91bed576 Kernel: Make ProcessGroup::find_or_create API OOM safe
Make ProcessGroup::find_or_create & ProcessGroup::create OOM safe, by
moving to adopt_ref_if_nonnull.
2021-05-20 08:10:07 +02:00
Brian Gianforcaro 7540f4268b Kernel: Remove s_processor_lock by making s_processors statically sized
Currently in SMP mode we hard code support for up to only 8 processors.
There is no reason for this to be a dynamic allocation that needs to be
guarded by a spinlock. Instead use a Array<T* with inline storage of 8,
allowing each processor to initialize it self in place, avoiding all
the need for locks.
2021-05-20 08:10:07 +02:00
Brian Gianforcaro 1415b2cfc3 Kernel: Do not allocate AnonymousVMObject's under spin lock
Spinlocks guard short regions, with hopefully no other locks being taken
in the process. Violating constraints usually had detrimental effects on
platform stability as well as performance and scalability. Allocating
memory takes it own locks, and can in some cases even allocate new
regions, and thus violates these tenants.

Move the AnonymousVMObject creation outside of the spinlock as
creation does not modify any shared state.
2021-05-20 08:10:07 +02:00
Brian Gianforcaro a43bccfc3c Meta: Mark the other image file formats as binary in .gitattributes
We had rules for .png and .jpg files, but we have not maintained the
list as support for other file formats has been added. To test these
changes test files have been committed for each of these formats.

This change updates the list with all of the binary image file types I
was able to find in the tree at the time of writing.
2021-05-20 08:04:28 +02:00
Brian Gianforcaro d58263497b Meta: Cleanup stale rules from .gitignore
The wild card rules at the top of the .gitignore came from a time when
the build wrote back to the git repository and placed files right next
to the source. (Original commit that introduced them 37c27e2e, they were
later consolidated into the root .gitignore in 802d4dc) We have since
moved to cmake, and these rules have become obsolete, and they just
cause issues where we need to go and add negations for these rules in
order for things to work.

A previous change attempted to remove the top wild card rules (PR #4565)
but it was later reverted, as they forgot to remove the top ignore
everything rule '*', so all files were ignored. This change just removes
all of these rules that no longer make sense, restoring a bit of sanity.

*.o,*.d,*.a rules were also from when the build wrote to the repository,
they are now defunct. The same goes for the *Endpoint.h and CMakeFiles
rules.

The lowercase build directory can be removed as we've standardized on
the uppercase 'Build' directory as the root of the build output dir.
2021-05-20 08:04:28 +02:00
Lenny Maiorani d25d4ec0ee Bitmap: De-duplicate bitmasks
Problem:
- Bitmasks are duplicated.
- Bitmasks are C-style arrays.

Solution:
- Move bitmasks to BitmapView.h.
- Change C-style arrays to be AK::Array for added safety.
2021-05-19 23:37:10 +01:00
Linus Groh 9c19e62675 LibMarkdown: Wrap code block language string in escape_html_entities()
This would allow HTML injection as the string was inserted into the HTML
output with no sanitation whatsoever.

Fixes #7123.
2021-05-19 23:31:00 +01:00
Andreas Kling 0a70e1728a DisplaySettings: Fix broken path to MonitorSettingsWidget's GML 2021-05-20 00:25:15 +02:00
Linus Groh c2fb252ebf LibWeb: Use -libweb-palette-base-text for text color in default CSS
This makes un-styled text readable when using a dark system theme,
previously such text would be black, regardless of the theme background
color.

Fixes #7274.
2021-05-19 23:23:48 +01:00
Andreas Kling 6394ea00d8 DisplaySettings: Remove icon from browse-for-wallpaper button
The icon on this button looked out of place.
2021-05-20 00:13:56 +02:00
Andreas Kling 7f206ca6de DisplaySettings: Select the currently used wallpaper on startup 2021-05-20 00:03:30 +02:00
Andreas Kling 7ba644456e LibGUI: Don't invalidate FileSystemModel indices on thumbnail update
Finishing a thumbnail generation doesn't affect indices at all.
2021-05-20 00:03:30 +02:00
Andreas Kling bb9e955ef8 DisplaySettings: Make MonitorWidget update itself on property changes 2021-05-20 00:03:30 +02:00
Andreas Kling c79e33d00c DisplaySettings: Rename DisplaySettingsWidget => MonitorSettingsWidget 2021-05-20 00:03:30 +02:00
Andreas Kling 540acc1a32 DisplaySettings: Give the UI a facelift :^)
- Split the main UI into two tabs: "Background" and "Monitor".
- Use a GUI::IconView for selecting background pictures.
- Tweak layout, spacing, etc.
2021-05-20 00:03:30 +02:00
Andreas Kling ff519e5421 LibGUI: Add widget registration for GUI::IconView 2021-05-20 00:03:30 +02:00
Andreas Kling c14ffdef00 DisplaySettings: Tweak main window layout & setup code
Get rid of the menu and put some padding around the main tab widget.
2021-05-20 00:03:30 +02:00
Andreas Kling 83f43b6464 DisplaySettings: Replace the monitor image with something more thematic
This is a drawing of my own monitor in a familiar style. :^)
2021-05-20 00:03:30 +02:00
Ali Mohammad Pur a57f152ec7 LibHTTP: Relax the assertion on extra reads after transfer is finished
This was added in #4831, but it didn't account for extra newlines after
the response (seems like some servers like to do this).
2021-05-19 23:57:04 +02:00
Itamar 832e9c6e02 LibCpp: Add regression tests for the parser
For each .cpp file in the test suite data, there is a .ast file that
represents the "known good" baseline of the parser result.

Each .cpp file goes through the parser, and the result of
invoking `ASTNode::dump()` on the root node is compared to the
baseline to find regressions.

We also check that there were no parser errors when parsing the .cpp
files.
2021-05-19 23:19:07 +02:00
Itamar fbf796cd9f LibCpp: Fix "NumricLiteral" => "NumericLiteral" typo 2021-05-19 23:19:07 +02:00
Itamar 402483ec1f LibCpp: Generalize ASTNode::dump() to support redirecting its output
Previously, ASTNode::dump() used outln() for output, which meant it
always wrote its output to stdout.

After this commit, ASTNode::dump() receives an 'output' argument (which
is stdout by default). This enables writing the output to somewhere
else.

This will be useful for testing the LibCpp Parser with the output of
ASTNode::dump.
2021-05-19 23:19:07 +02:00
Itamar 463a91c4a2 Utilities: Rename CppParserTest => cpp-parser
This is a utility program that runs the LibCpp parser on a program and
dumps out the AST.
2021-05-19 23:19:07 +02:00
Itamar ef95ddcbfa LibCpp: Fix match_expression()
match_expression() will now return true if there's a match for a Name
node.
2021-05-19 23:19:07 +02:00
Itamar f28d944122 LibCpp: Support 'auto' Type 2021-05-19 23:19:07 +02:00
Itamar eeb98335d5 CppLanguageServer: Put cpp test files in /home/anon/cpp-tests/
This is similar to the LibJS test data that resides in
/home/anon/js-tests.
It's more convenient than storing the test programs as raw strings
in the code.
2021-05-19 23:19:07 +02:00
Stephan Unverwerth 28ed518142 LibGL: Implement all of glVertex{2,3,4}{d,dv,f,fv,i,iv,s,sv} 2021-05-19 23:18:13 +02:00
Marcus Nilsson 41e74d4d31 CatDog: Don't show context menu when clicking outside of widget
The context menu for CatDog was shown when right clicking anywhere on
the screen because of global cursor tracking being enabled.
Also fix event not being passed by reference.

Fixes #7285
2021-05-19 23:14:07 +02:00
Brian Gianforcaro 83fc591cea Kernel: Generate page fault events from the kernel profiler
Hook the kernel page fault handler and capture page fault events when
the fault has a current thread attached in TLS. We capture the eip and
ebp so we can unwind the stack and locate which pieces of code are
generating the most page faults.

Co-authored-by: Gunnar Beutner <gbeutner@serenityos.org>
2021-05-19 22:51:42 +02:00
Gunnar Beutner 6ac1ca5a9a Profiler: Remove ability to filter Kernel::Scheduler::yield() frames
Hiding those frames doesn't really make sense. They're a major
contributor to a process' spent CPU time and show up in a lot of
profiles. That however is because those processes really do spend
quite a bit of time in the scheduler by doing lots of context
switches, like WindowServer when responding to IPC calls.

Instead of hiding these for aesthetic reasons we should instead
improve the scheduler.
2021-05-19 22:51:42 +02:00