Commit graph

48757 commits

Author SHA1 Message Date
Andreas Kling
19084ef743 Kernel: Simplify Mount internals
- The host custody never changes after initialization, so there's no
  need to protect it with a spinlock.

- To enforce the fact that some members don't change after
  initialization, make them const.
2023-04-04 10:33:42 +02:00
Andreas Kling
673592dea8 Kernel: Stop using *LockRefPtr for FileSystem pointers
There was only one permanent storage location for these: as a member
in the Mount class.

That member is never modified after Mount initialization, so we don't
need to worry about races there.
2023-04-04 10:33:42 +02:00
Caoimhe
3f69ef86c2 Kernel/aarch64: Implement Processor::time_spent_idle() 2023-04-04 10:30:09 +02:00
Timon Kruiper
bd2011406e Kernel: Merge x86_64 and aarch64 init.cpp files 2023-04-03 20:01:28 -06:00
Timon Kruiper
c31dc82b17 Kernel: Move deferred call code into separate DeferredCallPool class
This allows us to share this code between the x86_64 and aarch64 build.
2023-04-03 20:01:28 -06:00
Timon Kruiper
1f68ac600c Kernel/aarch64: Correctly implement Processor::leave_critical 2023-04-03 20:01:28 -06:00
Timon Kruiper
1fa1f09c38 Kernel/Graphics: Only search for PCI graphics cards on x86_64
This is for the upcoming commit that merges the x86_64 and aarch64
init.cpp files.
2023-04-03 20:01:28 -06:00
Timon Kruiper
14d20618f1 Kernel/aarch64: Move query_firmware_version into RPi::Mailbox
This is for the upcoming commit that merges the x86_64 and aarch64
init.cpp files.
2023-04-03 20:01:28 -06:00
Timon Kruiper
2613ac4cb4 Kernel/aarch64: Move logo drawing and initializing into RPi::Framebuffer
This is for a upcoming commit that merges the x86_64 and aarch64
init.cpp files.
2023-04-03 20:01:28 -06:00
Timon Kruiper
aa40cef2b7 Kernel: Disable interrupts for aarch64 in WorkQueue's main loop
This code expects to be executed with interrupts disabled, however we
currently spawn (kernel) threads with interrupts enabled on aarch64.
2023-04-03 20:01:28 -06:00
Timon Kruiper
05b9eb7feb Kernel/aarch64: Rename Processor::install to Processor::early_initialize
Also pass the cpu number to Processor::initialize. This way the init
code can be shared between the x86_64 and aarch64 build.
2023-04-03 20:01:28 -06:00
Fabian Dellwing
14d78e10d1 LibGUI+CertificateSettings: Use custom SortingProxy
The default SortingProxyModel does not allow to react to reodering.
As we would like to keep the column width on sorting, we create a
subclass and inject our code into the sorting method.
2023-04-03 19:58:47 -06:00
Fabian Dellwing
dfce65a0ab CertificateSettings: Add export functionality 2023-04-03 19:58:47 -06:00
Fabian Dellwing
8b881eaf02 LibCrypto: Add PEM encoder
This commit adds a new method to create a PEM encoded ASN1 from
its DER variant.
2023-04-03 19:58:47 -06:00
Fabian Dellwing
7ce75ee3c5 CertificateSettings: Add import functionality 2023-04-03 19:58:47 -06:00
Fabian Dellwing
c273784c3e CertificateSettings: Create basic Cert Store application
This commit adds a new application named CertificateSettings that
houses our Cert Store. It should be expanded in the future.
2023-04-03 19:58:47 -06:00
Fabian Dellwing
459dee1f86 LibTLS: Refactor CA loading into central function 2023-04-03 19:58:47 -06:00
Daniel Bertalan
924758c6f8 Toolchain+Meta: Support kernel debugging with host AArch64 GDB
Previously, we would unconditionally build GDB from source for the
AArch64 toolchain. This commit makes it possible to use the system's
`gdb` binary if it supports the architecture, or `aarch64-elf-gdb` if
such a package is installed.

An `aarch64-elf-gdb` package will be available through Homebrew once
this PR is merged: https://github.com/Homebrew/homebrew-core/pull/127323
2023-04-03 19:56:09 -06:00
Lucas CHOLLET
66c12af45f LibTest: Don't output information on tests if none exist 2023-04-03 20:58:49 +01:00
Lucas CHOLLET
2812ef246d Tests: Add benchmarks for JPEGLoader
I'm the author of the image.
2023-04-03 20:58:49 +01:00
Sam Atkins
b746d324cf Spreadsheet: Propagate errors from SpreadsheetWidget::initialize_menubar 2023-04-03 21:16:26 +02:00
Sam Atkins
1e275dd942 Spreadsheet: Add list of recently-opened files 2023-04-03 21:16:26 +02:00
MacDue
b85d24b1f4 LibWeb: Expand background-position layers into x/y position lists
This fixes multi-layer backgrounds with background positions. This
is a little awkard, so maybe it would be better to refactor the
parsing code to make these lists directly, but right now this is
the simplest fix.
2023-04-03 20:54:36 +02:00
MacDue
ca02c433d2 LibWeb: Add getter for separator to StyleValueList 2023-04-03 20:54:36 +02:00
Lucas CHOLLET
6bc30099f2 LibGfx/JPEG: Add YCCK and CMYK to RGB color transformations
It means that we now fully support JPEGs with four components :^).
2023-04-03 17:12:27 +01:00
Lucas CHOLLET
9cbed7b359 LibGfx/JPEG: Support for images with four components
This patch adds support for properly read images with four components,
basically CMYK or YCCK. However, we still lack color spaces
transformations for this type of image. So, it just postpones failure.
2023-04-03 17:12:27 +01:00
Lucas CHOLLET
261d36351d LibGfx/JPEG: Replace C-style array by Array 2023-04-03 17:12:27 +01:00
Lucas CHOLLET
df12e70541 LibGfx/JPEG: Bring IDCT and YCbCr conversion closer to specification
As mentioned in F.2.1.5 - Inverse DCT (IDCT), the decoder needs to
perform a level shift by adding 128. This used to be done in
`ycbcr_to_rgb` after the conversion. Now, we do it in `inverse_dct` in
order to ensure that the task is done unconditionally.

Consequences of this are that we are no longer required to explicitly
do it for RGB images and also, the `ycbcr_to_rgb` function is exactly
like the specification.
2023-04-03 17:12:27 +01:00
Lucas CHOLLET
62290d57f7 Tests: Add a test for SOF2 JPEGs with successive approximations
This image was generated using `cjpeg` with the following scan file:

0 1 2: 0 0 0 2;
0: 1 63 0 1;
1: 1 63 0 1;
2: 1 63 0 1;
0 1 2: 0 0 2 1;
0: 1 63 1 0;
1: 1 63 1 0;
2: 1 63 1 0;
0 1 2: 0 0 1 0;
2023-04-03 17:06:21 +01:00
Lucas CHOLLET
f42d850211 LibGfx/JPEG: Don't reject SOF2 image with successive approximations
It means full SOF2 JPEG support, yay!
2023-04-03 17:06:21 +01:00
Lucas CHOLLET
fbad9a70fc LibGfx/JPEG: Support refinement scans
These scans are only present in progressive JPEGs and contains bits to
increase the precision of values acquired in previous scans.
2023-04-03 17:06:21 +01:00
Lucas CHOLLET
8806e66f66 LibGfx/JPEG: Handle ZRL as a special case
When reading the stream, interpreted as a normal value 0xF0 means skip
15 values and assign the 16th to 0. On the other hand, the marker ZRL
- which has the value 0xF0, means skip 16 values. For baseline JPEGs,
ZRL doesn't need to be interpreted differently as writing the 16th value
has no consequence. This is no longer the case with refining scans.
That's why this patch implement correctly ZRL.
2023-04-03 17:06:21 +01:00
Lucas CHOLLET
731c876ff7 LibGfx/JPEG: Change the loop over AC coefficients
We used to skip over zero coefficient by modifying the loop counter. It
is unfortunately impossible to perform this with SOF2 images as only
coefficients with a zero-history should be skipped.
This induces no behavior change for the user of the function.
2023-04-03 17:06:21 +01:00
Lucas CHOLLET
902d0ab58e LibGfx/JPEG: Still iterate over AC coefficients of a EOB targeted block
This commit is nonsense for anything else than SOF2 images with spectral
approximation. For this particular case, skips like EOB or ZRL only
apply to coefficients with a zero-history. This commit prepares the code
to handle this behavior.
2023-04-03 17:06:21 +01:00
Lucas CHOLLET
ef98b06dff LibGfx/JPEG: Split spectral_approximation
This `u8` is actually two values of 4 bits. Let's store them separately
to avoid confusion.
2023-04-03 17:06:21 +01:00
Sam Atkins
5c76b63f79 PDFViewer: Add list of recently-opened files 2023-04-03 16:32:03 +02:00
Timothy Flynn
15532df83d AK+Everywhere: Change AK::fill_with_random to accept a Bytes object
Rather than the very C-like API we currently have, accepting a void* and
a length, let's take a Bytes object instead. In almost all existing
cases, the compiler figures out the length.
2023-04-03 15:53:49 +02:00
Timothy Flynn
5c045b6934 AK: Add templated Span<u8> and Span<u8 const> constructors for C-arrays
This helper constructor exists on the unspecialized Span<T> class also,
and is convenient for e.g. creating Bytes from:

    u8 buffer[64];
    Bytes bytes { buffer };
2023-04-03 15:53:49 +02:00
Timothy Flynn
f7960ffbe3 AK: Prevent passing lengths greater than 256 to getentropy()
From the getentropy() man page, "The maximum permitted value for the
length argument is 256". Several of our tests were passing lengths of
several thousand bytes, causing getentropy() to fail with EIO, which we
were completely ignoring. This caused these tests to only test long
sequences of 0x00.

We now loop over the provided buffer to fill it 256 bytes at a time. If
getentropy() fails for any reason, we fall back to the default method of
filling it with one random byte at a time.
2023-04-03 15:53:49 +02:00
Lucas CHOLLET
cb0c8634d4 LibGfx/JPEG: Use a basic Stream instead of a SeekableStream
Only one use `seek` remains, as it is a bit more complex to remove.
2023-04-03 09:19:15 -04:00
Lucas CHOLLET
dc9e783608 LibGfx/JPEG: Remove the ensure_bounds_okay function
This function has probably been added when we weren't as good with error
propagations as we are now. We can safely remove it and let future
calls to `read` fail if the file is corrupted.

This can be tested with the following bytes (already used in 9191829a):
ffd8ffc000000800080ef701101200ffda00030100
2023-04-03 09:19:15 -04:00
Idan Horowitz
402c9e5e23 Kernel: Implement Processor::assume_context for AArch64
With this implemented sys$execve should be fully working on AArch64.
2023-04-03 02:59:37 -06:00
Idan Horowitz
0dc5c49938 Kernel: Call exit_trap in AArch64 restore_context_and_eret
This matches x86_64's behaviour in common_trap_exit. (called from
thread_context_first_enter)
Currently thread_context_first_enter is only called when creating new
processes from scratch, in which case this doesn't change the actual
behaviour. But once thread_context_first_enter is called as part of
execve support, this will ensure the Thread's m_current_trap is set
correctly to the new trap frame.
2023-04-03 02:59:37 -06:00
Idan Horowitz
a349570a04 Kernel: Abstract Processor::assume_context flags using InterruptsState
The details of the specific interrupt bits that must be turned on are
irrelevant to the sys$execve implementation. Abstract it away to the
Processor implementations using the InterruptsState enum.
2023-04-03 02:59:37 -06:00
Idan Horowitz
6ad8f4bb11 Kernel: Stop overwriting AArch64 link register in forked processes
Forked processes already have an existing value for the link register,
which we can't overwrite. But since they're forked the original link
register value that points to exit_kernel_thread was already saved
somewhere on the stack, so it's ok not to set it.
2023-04-03 02:59:37 -06:00
Idan Horowitz
8669f4ce45 Kernel: Add AArch64 support to sys$fork 2023-04-03 02:59:37 -06:00
Tim Ledbetter
3fa9c9bda4 PixelPaint: Update recent files list on project save
This is consistent with the behavior of other applications.
2023-04-03 07:13:27 +02:00
matcool
1bd8f4eb03 PixelPaint: Make Bloom use InplaceFilter instead of Filter
This change affects the filter preview widget, which would get the bloom
filter applied over the same bitmap, leading to an incorrect preview.
2023-04-03 07:13:13 +02:00
justus2510
2259ddf937 ImageViewer: Fix crash when setting wallpaper
When trying to set the wallpaper from the menu, ImageViewer would
crash because setting the wallpaper requires the program to pledge
to the WindowManager domain. This patch adds that pledge.
2023-04-03 07:11:28 +02:00
MacDue
0abd469d24 Base: Add background-position-x/y test page 2023-04-03 07:10:33 +02:00