Commit graph

23869 commits

Author SHA1 Message Date
Jean-Baptiste Boric
4cc346fb19 Kernel: Add support for hypervisor CPUID feature 2021-07-14 13:52:34 +02:00
Liav A
bee75c1f24 Kernel/ProcFS: Allow a process directory to have a null Process pointer
In case we are about to delete the PID directory, we clear the Process
pointer. If someone still holds a reference to the PID directory (by
opening it), we still need to delete the process, but we can't delete
the directory, so we will keep it alive, but any operation on it will
fail by propogating the error to userspace about that the Process was
deleted and therefore there's no meaning to trying to do operations on
the directory.

Fixes #8576.
2021-07-14 13:40:01 +02:00
Aziz Berkay Yesilyurt
d1028f8aed LibGfx: Use clear_with capacity instead of clear in PNGWriter
Same vector was cleared up and filled in continuously.
2021-07-14 13:37:18 +02:00
Aziz Berkay Yesilyurt
b70f2b00a3 LibGfx: Store the size of the chunk from start in PNGWriter
Before this change PNGWriter::add_chunk used to make a copy of
PNGChunk's ByteBuffer to prepend the size of the data.
With this change, 4-byte space is saved from the beginning and written
at the end of the operation. Avoiding this copy yields significant
speed up.
2021-07-14 13:37:18 +02:00
Aziz Berkay Yesilyurt
db36ddc763 LibGfx: Prevent a copy in PNGWriter by storing type data at start 2021-07-14 13:37:18 +02:00
Aziz Berkay Yesilyurt
d84c4b94da LibGfx: Prevent frequent memory allocations in PNGWriter 2021-07-14 13:37:18 +02:00
Aziz Berkay Yesilyurt
97859aaff1 LibGfx: Use ByteBuffer instead of Vector<u8> in PNGWriter
This is the first step towards reducing the number of copies in
PNGWriter by switching to ByteBuffer as underlying storage.
2021-07-14 13:37:18 +02:00
Andreas Kling
d78a007b5d LibWeb: Use split_view() in attribute selector matching
Using split() creates a new String object for each of the split tokens.
Use split_view() instead to avoid these unnecessary heap allocations.
2021-07-14 13:31:49 +02:00
Andreas Kling
dc26c02379 Kernel: Convert MemoryManager to east-const style 2021-07-14 13:31:21 +02:00
Sam Atkins
ffc81cbfad LibWeb: Use Selectors instead of a String for :not() selectors
Rather than parsing the selector every time we want to check it, we
now parse it once at the beginning.

A bonus effect of this is that we now support a selector list in
:not(), instead of just a single selector, though only when using
the new parser.
2021-07-14 13:31:00 +02:00
Sam Atkins
776b1f4548 LibWeb: Make CSS::Selector reference counted
The end goal is to make the PseudoClass::not_selector be a Selector
instead of a String that is repeatedly re-parsed. But since Selector
contains a Vector of ComplexSelectors, which each have a Vector of
SimpleSelectors, it's probably a good idea to not be passing them
around by value anyway. :^)
2021-07-14 13:31:00 +02:00
Sam Atkins
8cae79cc8d LibWeb: Add 'PseudoElement' as a CSS SimpleSelector::Type
Same reasoning again! This is the last one.

While I was at it, I added the two remaining CSS2.2 pseudo-elements,
::first-line and ::first-letter. All 4 are handled in the new CSS
parser, including with the compatibility single-colon syntax. I have
not added support to the old parser.
2021-07-14 13:31:00 +02:00
Sam Atkins
4af7d41879 LibWeb: Add 'PseudoClass' as a CSS SimpleSelector::Type
Same reasoning as the previous commit.
2021-07-14 13:31:00 +02:00
Sam Atkins
96b2356cbb LibWeb: Add 'Attribute' as a CSS SimpleSelector::Type
Previously, SimpleSelectors optionally had Attribute-selector data
as well as their main type. Now, they're either one or the other,
which better matches the spec, and makes parsing and matching more
straightforward.
2021-07-14 13:31:00 +02:00
Sam Atkins
dadcb46344 LibWeb: Convert CSS Dump, Selector, & SelectorEngine to east const 2021-07-14 13:31:00 +02:00
Daniel Bertalan
cd55b817cf LibJS: Use AK::abs in TimeZone
This fixes a `-Wabsolute-value` warning emitted because of our use of
`abs()` on arguments of type `long long`.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
6821cd45ed Tests: Fix compile errors on Clang
Since Clang enables a couple of warnings that we don't have in GCC,
these were not caught before. Included fixes:

- Use correct printf format string for `size_t`
- Don't compare Nonnull(Ref|Own)Ptr` to nullptr
- Fix unsigned int& => unsigned long& conversion
2021-07-14 13:12:25 +02:00
Daniel Bertalan
a88f7c99fe LibC: Use our implementation of crti.o and crtn.o
We have had these for quite a while, but we didn't compile them, and
used GCC's version instead. Clang does not come with these, so we have
to provide our own implementation.

Our implementation follows what `musl` and `FreeBSD` do, so this should
work fine, even if documentation can hardly be found for them.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
7f2eb2f332 Meta: Remove obsolete -fconcepts CFLAG
The GCC documentation says that since it's officially a part of C++20,
this flag does nothing. Clang, however, does complain that it does not
recognize it, so it's better to just remove it.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
11a945a499 LibWeb: Add missing typeinfo include
This code worked with GCC because libstdc++ pulls in `type_info`'s
definition through the `cxxabi` header included by `AK/Demangle.h`.

In contrast, `libc++` only forward-declares it, so this code failed to
compile with it.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
ef40de9c6c Kernel: Don't mix AT&T and Intel ASM syntax in boot.S
The rest of the file is in AT&T syntax, so for the time being, I'll
switch these instructions to AT&T too to make Clang shut up.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
b847541ee8 Kernel: Allow passing null pointer to delete
The C++ standard says that it's legal to call the `delete` operator with
a null pointer argument, in which case it should be a no-op. I
encountered this issue when running a kernel that's compiled with Clang.
I assume this fact was used for some kind of optimization.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
bb26cea291 WindowServer: Don't use GNU-style designator
Clang throws a fit when it encounters this code, since we already have
the standardized designated initializer syntax in C++20, which we should
use.
2021-07-14 13:12:25 +02:00
jakubiakdev
4a396dc7e8 Base+LibGUI: Add icon to the Rename action 2021-07-14 13:05:01 +02:00
x-yl
6b68f16f2c Meta: Change QEMU options in run.sh to use SPICE
If QEMU has the qemu_vdagent chardev (should be present in QEMU 6.1)
then we use that as the SPICE client.

If qemu_vdagent is not present, no SPICE client will be launched by
default because it makes the display a bit choppy.

Set SERENITY_SPICE to override the default behavior and use your default
SPICE client.
2021-07-14 12:33:07 +02:00
x-yl
c8b13bd053 SpiceAgent: Support copying and pasting images 2021-07-14 12:33:07 +02:00
x-yl
d4bb6a1a1e SpiceAgent: Add a new spice agent service :^)
A SPICE agent communicates with the host OS to provide nifty features
like clipboard sharing :^)

This patch implements only plain-text clipboard sharing.

See: github.com/freedesktop/spice-protocol/blob/master/spice/vd_agent.h
2021-07-14 12:33:07 +02:00
x-yl
42c5df7256 Kernel: Fix inverted check in VirtIOConsolePort
We should really only try to open if we're closed. Oops :P
2021-07-14 12:33:07 +02:00
Tom
d7e5521a04 Kernel: Ignore subsequent calls to Process::die
It's possible that another thread might try to exit the process just
about the same time another thread does the same, or a crash happens.
Also, we may not be able to kill all other threads instantly as they
may be blocked in the kernel (though in this case they would get killed
before ever returning back to user mode. So keep track of whether
Process::die was already called and ignore it on subsequent calls.

Fixes #8485
2021-07-14 12:30:41 +02:00
Timothy
3cc0283eac LibCore: Convert File to east-const style 2021-07-14 14:35:16 +04:30
Timothy
068802d58d LibCore: Add File method to determine absolute path
This will generate absolute paths lexically rather than through a call
to realpath. The motivation for this is to generate absolute paths for
non-existent files in unveil calls, as realpath will not work if the
file does not exist.
2021-07-14 14:35:16 +04:30
Timothy
3ae64c7c3d LibCore: Add File method to determine current working directory 2021-07-14 14:35:16 +04:30
TheFightingCatfish
a3400798f8 Utilities: Add an implementation of 'comm'
Add an implementation of 'comm' -- compare files line by line
2021-07-14 14:13:25 +04:30
JJ Roberts-White
74f1f2b5e2 Piano: Add Play/Pause, Forward and Back buttons
Piano now has a toolbar allowing the playback to be paused,
or to be stepped forward or back a note.
2021-07-14 12:07:43 +04:30
Hendiadyoin1
54c005754a UserpaceEmulator: Handle possibly unaligned IO
We also should add some UB warnings for that in the future
2021-07-14 11:26:34 +04:30
Hendiadyoin1
d761c5024b AK: Generalize ByteReader
Also use it instead of CPU.h's possibly_unaligned_data interface
2021-07-14 11:26:34 +04:30
Hendiadyoin1
b98e741237 Tests: Change test-filtering mechanism
We have a new config argument to add space separated exclude regex'
This is separate from "NotTestsPattern", because these are still Tests,
although they are not supposed to be run by the runner

This also adds the test for a working UserspaceEmulator to the tests run
2021-07-14 11:26:34 +04:30
Hendiadyoin1
3cc59f6454 Tests: Rename write-oob
The "ue-" prefix makes it clearer that it should be run with the
UserspaceEmulator
2021-07-14 11:26:34 +04:30
Hendiadyoin1
bdde44a833 Tests: Assure that UE does not regress via ue ls 2021-07-14 11:26:34 +04:30
brapru
5b6d2644bc LibCore: Generate new passwd file by checking pw_name
LibCore::Account::generate_passwd_file should follow
generate_shadow_file by conditionally checking for the username.
Previously, usermod's set_uid changes would not reflect in the updated
passwd file as m_uid had already been changed to the updated value.
2021-07-14 08:06:30 +02:00
brapru
9b5a1b5036 Utilities: Implement usermod command
Previously there was no way to modify existing user accounts.
2021-07-14 08:06:30 +02:00
brapru
6ef6bd1ccb LibCore: Add setters for all user account properties 2021-07-14 08:06:30 +02:00
Joachim Le Fournis
1420549abf Ports: Add epsilon 15.5.0 2021-07-14 05:27:25 +02:00
Andreas Kling
c42807e3dc Kernel: Remove debug spam when PhysicalRegion::take_free_page() fails
We can have multiple PhysicalRegions (often the case when there is a
huge amount of RAM) so we really shouldn't print a debug message any
time someone tries to allocate from one. They will move on to another
region anyway.
2021-07-14 01:37:31 +02:00
Andreas Kling
5c24d18923 Kernel: Fix logic error in PhysicalRegion::contains()
This was incorrectly returning true for the address one byte past the
end of the region.
2021-07-14 01:37:19 +02:00
Andreas Kling
6cc1247395 Kernel: Cut allocation size for physical buddy bitmaps in half
We were allocating twice as much memory as we needed for these bitmaps
due to a silly typo. Found by tomuta trying to boot with 24 GiB of RAM.
2021-07-13 23:47:49 +02:00
pancake
eb7b755937 Ports: Add vlang weekly.2021.28 package 2021-07-13 23:30:59 +02:00
ForLoveOfCats
60713c5fcf KeyboardPreferenceLoader: Use correct default Num Lock config value 2021-07-13 23:25:07 +02:00
Liav A
11fe38346c Meta: Remove options of explicit command line runners in run script
Let's remove the qcmd and q35_cmd options and instead have a simple
"q35" run option. Specifiying the kernel command line was a neat trick
I personally used for many debug sessions, but it seems better to stick
to setting it internally in the kernel or modifying the shell
SERENITY_KERNEL_CMDLINE environment variable to do this.
2021-07-13 23:24:16 +02:00
Liav A
c92c944356 Meta: Tweak qemu run script to use pcie-root-ports
With this change, we use 6 PCIe root ports in the Q35 machine, and plug
the bochs-display device into one of those PCIe ports.
We plug the bochs-display as function 0 of that device, because
otherwise SeaBIOS and also the kernel will not detect its presence.
2021-07-13 23:24:16 +02:00