Commit graph

16224 commits

Author SHA1 Message Date
Andreas Kling
f3f2d77624 LibJS: Remove an unused TypedArray constructor 2021-01-25 23:23:33 +01:00
Linus Groh
5978424cf9 crash: Add option for failing assertion 2021-01-25 23:22:21 +01:00
Linus Groh
6568cba731 crash: Add option for pledge() violation 2021-01-25 23:22:21 +01:00
Linus Groh
629180b7d8 Kernel: Support pledge() with empty promises
This tells the kernel that the process wants to use pledge, but without
pledging anything - effectively restricting it to syscalls that don't
require a certain promise. This is part of OpenBSD's pledge() as well,
which served as basis for Serenity's.
2021-01-25 23:22:21 +01:00
Tom
b580c005f1 Kernel: Fix possible context switch within first context switch of a thread
We were enabling interrupts too early, before the first context switch to
a thread was complete. This could then trigger another context switch
within the context switch, which lead to a crash.
2021-01-25 23:22:12 +01:00
Tom
bd73102513 Kernel: Fix some race conditions with Lock and waiting/waking threads
There is a window between acquiring/releasing the lock with the atomic
variables and subsequently waiting or waking threads. With a single
processor this window was closed by using a critical section, but
this doesn't prevent other processors from running these code paths.
To solve this, set a flag in the WaitQueue while holding m_lock which
determines if threads should be blocked at all.
2021-01-25 22:54:55 +01:00
Tom
4cf0859612 Kernel: Fix race condition in Lock::lock that may leave corrupted state 2021-01-25 22:54:55 +01:00
TheMorc
d4668507d4 Ports: Improve configure script
Just a small modification so that ports that are configured e.g.
using cmake don't need a dummy configure file anymore.
2021-01-25 22:34:43 +01:00
TheMorc
ffc51853bf Ports: Add ProTracker 2 clone 2021-01-25 22:34:43 +01:00
Zac
b56ef9042b Vim: Add a simple yank and put implementation 2021-01-25 22:31:43 +01:00
Zac
94bfde2a38 TextEditor: Fix bug in delete_current_line() when deleting the last line
A missing '- 1' when initializing the starting TextPosition lead to a
crash due to attempting to delete text in an illegal TextRange.
2021-01-25 22:31:43 +01:00
Linus Groh
ed703b461b WindowServer: Fix client unresponsiveness detection
This broke in add01b3, where Core::Timer::create_single_shot() was
changed to create a stopped timer. Fix it by actually starting the timer
right away ourselves.

Fixes #5111.
2021-01-25 22:31:22 +01:00
Nico Weber
30e19c5a00 LibGfx: Implement scaling support for Painter::blit_filtered()
...and functions implemented in terms of it: blit_brightened(),
blit_dimmed(), blit_disabled().

In theory, this should stop the window server from asserting when
an application becomes unresponsive, but that feature seems to be
broken for unrelated reasons atm (#5111).
2021-01-25 22:31:07 +01:00
Jelle Raaijmakers
d348976784 AbstractTableView: prevent setting an invalid index
If you tried to move a cursor down when the last row is selected, the
index becomes invalid without updating the selection. On the next
cursor movement the invalid index is then reset to {0, 0}, selecting
the first row instead.
2021-01-25 22:26:18 +01:00
Jean-Baptiste Boric
59396ab1c6 Documentation: Add instructions for network booting 2021-01-25 22:25:58 +01:00
Andreas Kling
ab14b0ac64 Kernel: Hoist VM range allocation up to sys$mmap() itself
Instead of letting each File subclass do range allocation in their
mmap() override, do it up front in sys$mmap().

This makes us honor alignment requests for file-backed memory mappings
and simplifies the code somwhat.
2021-01-25 18:57:06 +01:00
Andreas Kling
adcc1c1eff LibELF: Cache the DynamicObject in DynamicLoader
This avoids reparsing the same dynamic library file multiple times.
2021-01-25 18:57:06 +01:00
Andreas Kling
41d8734288 LibELF: Use Optional<SymbolLookupResult> as a return type
Instead of storing a "found" state inside the result object.
2021-01-25 18:57:06 +01:00
Andreas Kling
a5de46684b LibELF: Convert String::format() to String::formatted() 2021-01-25 18:57:06 +01:00
Andreas Kling
eb354b7ce8 DynamicLoader: Remove some unnecessary #includes 2021-01-25 18:57:06 +01:00
Andreas Kling
c5e52be5d4 LibELF: Convert dbgprintf() in DynamicObject class to dbgln() 2021-01-25 18:57:06 +01:00
Andreas Kling
98e4e2aae3 LibELF: Convert dbgprintf() in DynamicLinker class to dbgln() 2021-01-25 18:57:06 +01:00
Andreas Kling
e9fd81b964 LibELF: Convert dbgprintf() in DynamicLoader class to dbgln() 2021-01-25 18:57:06 +01:00
Andreas Kling
9a0762b203 DynamicLoader: Remove unused debugging macros 2021-01-25 18:57:06 +01:00
Nico Weber
75b7880f54 LibGfx: Remove unreachable branch in Painter::draw_scaled_bitmap
This is in the else block of a `(source.has_alpha_channel() || opacity != 1.0f)`
conditional, so it's guaranteed that !source.has_alpha_channel() in
here, which means source.format() can't be RGBA32.

No behavior change.
2021-01-25 18:56:54 +01:00
Nico Weber
ea8baaa1ab LibGfx: Fix opacity handling in Painter::draw_scaled_bitmap
If the source image had no alpha channel we'd ignore opacity < 1.0 and
blit the image as if it was fully opaque.

With this fix, adjusting the opacity of windows with mousewheel while
holding super works in hidpi mode.
2021-01-25 18:39:27 +01:00
Nico Weber
dfb12e2a73 LibGfx: Minor style tweaks in Painter
No behavior change.
2021-01-25 18:39:27 +01:00
asynts
8571209560 Kernel: Fix crash when booting with ACPI. 2021-01-25 13:00:49 +01:00
asynts
eea72b9b5c Everywhere: Hook up remaining debug macros to Debug.h. 2021-01-25 09:47:36 +01:00
asynts
da69de1f1b Meta: Make check-debug-flags.sh work with the new changes. 2021-01-25 09:47:36 +01:00
asynts
8465683dcf Everywhere: Debug macros instead of constexpr.
This was done with the following script:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \;

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
2021-01-25 09:47:36 +01:00
asynts
bb483f7ef4 Everywhere: Name debug macros more consistently.
Personally, I prefer the naming convention DEBUG_FOO over FOO_DEBUG, but
the majority of the debug macros are already named in the latter naming
convention, so I just enforce consistency here.

This was done with the following script:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/DEBUG_PATH/PATH_DEBUG/' {} \;
2021-01-25 09:47:36 +01:00
asynts
acdcf59a33 Everywhere: Remove unnecessary debug comments.
It would be tempting to uncomment these statements, but that won't work
with the new changes.

This was done with the following commands:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/#define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/#define/ { toggle = 1 }' {} \;

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/ #define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/ #define/ { toggle = 1 }' {} \;
2021-01-25 09:47:36 +01:00
asynts
1a3a0836c0 Everywhere: Use CMake to generate AK/Debug.h.
This was done with the help of several scripts, I dump them here to
easily find them later:

    awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in

    for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in)
    do
        find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \;
    done

    # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list.
    awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
2021-01-25 09:47:36 +01:00
Nico Weber
76f2918416 LibGfx:: Implement scale support for blit_with_opacity()
Now we no longer crash on mousewheel over Terminal while holding the
super key. The terminal window doesn't yet correctly become transparent
in hidpi mode (needs more investigation), but it works in LibGfxScaleDemo,
so maybe that's a problem elsewhere.

Also add a FIXME for a pre-existing bug.
2021-01-25 09:41:34 +01:00
Andrew Kaster
258a3b27ac Userland: Implement grep -v (invert-match)
This will make grep output every line that doesn't have
any matches of the given regular expression
2021-01-25 09:41:19 +01:00
Andrew Kaster
036828ff43 Userland: Use getline instead of Core::File::standard_input in grep
Core::IODevice (which Core::File inherits from) does not have a
reasonable way to block for a line. grep was spinning on
IODevice::read_line, passing endless empty strings to the matcher
lambda. Use getline instead, which will at least block in the Kernel for
characters to be available on stdin and only return full lines (or eof)
2021-01-25 09:41:19 +01:00
Andreas Kling
f5d916a881 Kernel: Make sys$anon_create() fail if size == 0
An empty anonymous file is useless since it cannot be resized anyway,
so let's not support creating it.
2021-01-25 09:36:42 +01:00
Linus Groh
02cca92763 LibJS: Set length of TypedArray constructors to 3
https://tc39.es/ecma262/#sec-typedarray-constructors

    Each TypedArray constructor [...] has a "length" property whose
    value is 3.
2021-01-24 22:24:10 +01:00
Jean-Baptiste Boric
76e12a4840 SystemServer: Do not crash if device files are not present 2021-01-24 22:16:18 +01:00
Jean-Baptiste Boric
491a67ddc4 WindowServer: Don't crash if unable to open input peripherals
Seems a bit extreme, other operating systems don't have their graphical
environment crash if there is no keyboard or no mouse.
2021-01-24 22:16:18 +01:00
Jean-Baptiste Boric
4d755725bf Kernel: Allow disabling of IDE controllers with disable_ide
The kernel doesn't like the IDE controllers on an Asus A7N8X-E Deluxe
motherboard, so add an option to disable them.
2021-01-24 22:16:18 +01:00
Jean-Baptiste Boric
7eaefa5aa6 Kernel: Make use of interrupts as an entropy source
Booting old computers without RDRAND/RDSEED and without a disk makes
the system severely starved for entropy. Uses interrupts as a source
to side-step that issue.

Also warn whenever the system is starved of entropy, because that's
a non-obvious failure mode.
2021-01-24 22:16:18 +01:00
Nico Weber
cb89d3b780 FontEditor: change order of baseline and mean line row
The mean line is above the baseline, so it makes sense if the UI
elements are in the same order.
2021-01-24 22:02:23 +01:00
Nico Weber
40f6dfeacc FontEditor: change "Mean Line:" label to "Mean line:"
Matches the case used in other labels in the app.
2021-01-24 22:02:23 +01:00
Nico Weber
42a8f99374 FontEditor: Fix typos in code
No behavior change.
2021-01-24 22:02:23 +01:00
Nico Weber
90e09dd7a8 FontEditor: Make left and right UI margins match 2021-01-24 22:02:23 +01:00
Nico Weber
8bb9c667fd FontEditor: Remove "Save" and "Quit" buttons
We have both the normal menu items and keyboard shortcuts for these by
now. No need to have always-visible buttons -- makes the app more
consistent with the other apps, and makes it use up less vertical space.
2021-01-24 22:02:23 +01:00
Zac
330ab52ddb
Vim: More correct word jumping (#5090)
Implemented move_to_beginning_of_next(), move_to_end_of_next(),
move_to_beginning_of_previous() and move_to_end_of_previous() functions
for more correct word jumping than the move_to_xxx_span() methods that
were previously used.
2021-01-24 19:24:56 +01:00
Camisul
0678dab7dc HexEditor: Find
Added search submenu with options to find or find again.
Find allows to search for ASII string or sequence of Hex value.
2021-01-24 19:23:31 +01:00