Commit graph

22977 commits

Author SHA1 Message Date
Gunnar Beutner 9ed051fe25 Kernel: Implement initializing threads on x86_64 2021-06-27 15:46:42 +02:00
Gunnar Beutner f285241cb8 Kernel: Rename Thread::tss to Thread::regs and add x86_64 support
We're using software context switches so calling this struct tss is
somewhat misleading.
2021-06-27 15:46:42 +02:00
Gunnar Beutner eba33f82b8 Kernel: Reorder code a bit to clarify which #if block it belongs to 2021-06-27 15:46:42 +02:00
Gunnar Beutner df530941cc Kernel: Implement safe_* memory access functions for x86_64 2021-06-27 15:46:42 +02:00
Gunnar Beutner 79ab9cce18 Kernel: Clear segment registers on x86_64
They're supposedly unused but iretq doesn't like ss being non-zero.
2021-06-27 15:46:42 +02:00
Gunnar Beutner 9d9f20391d Kernel: Use macros for GDT indices instead of hardcoding the values 2021-06-27 15:46:42 +02:00
Gunnar Beutner 065c6c307d Kernel: Add support for interrupts on x86_64 2021-06-27 15:46:42 +02:00
Gunnar Beutner 233ef26e4d Kernel+Userland: Add x86_64 registers to RegisterState/PtraceRegisters 2021-06-27 15:46:42 +02:00
Gunnar Beutner 10ca7f18a7 Kernel: Fix declaration for struct TrapFrame
This is declared as a struct elsewhere.
2021-06-27 15:46:42 +02:00
Gunnar Beutner 324f72d02b Kernel: Fix incorrect flags for the GDT entries
The Sz (protected mode) bit should not be set for 64-bit GDT entries.
2021-06-27 15:46:42 +02:00
Ali Mohammad Pur fd72597999 LibWeb: Make ExceptionOr capable of holding all error types in the spec
The WebIDL spec specifies a few "simple" exception types in addition to
the DOMException type, let's support all of those.
This allows functions returning ExceptionOr<T> to throw regular
javascript exceptions (as limited by the webidl spec) by returning a
`DOM::SimpleException { DOM::SimpleExceptionType::T, "error message" }`
which is pretty damn cool :^)
2021-06-27 12:49:49 +01:00
Ali Mohammad Pur bda19a9ff3 AK: Add explicit Variant conversion operators
This allows converting between Variants of different types with less
pain.
2021-06-27 12:49:49 +01:00
Andreas Kling dff3439ad0 Profiler: Cache the timeline histograms instead of recomputing on paint
There was an aggressive amount of work happening on every paint. :^)
2021-06-27 12:05:28 +02:00
Andreas Kling f4090d46de Kernel: Don't kmalloc() for small (<=1024) dbgputstr() syscalls 2021-06-27 10:50:24 +02:00
Tom a9906cfcd1 WindowServer: Try to auto-add unconfigured framebuffer devices
This will try to auto-add framebuffer devices that haven't been
explicitly configured to the right-hand side.
2021-06-27 09:46:27 +02:00
Tom 38af4c29e6 WindowServer: Coalesce flushing buffers into one ioctl() call
We regularily need to flush many rectangles, so instead of making many
expensive ioctl() calls to the framebuffer driver, collect the
rectangles and only make one call. And if we have too many rectangles
then it may be cheaper to just update the entire region, in which case
we simply convert them all into a union and just flush that one
rectangle instead.
2021-06-27 09:46:27 +02:00
Tom 56cd0f929e Kernel: Enable additional VirtIO displays only on first resolution set
Also, only allocate the amount of memory we actually need for the given
resolution.
2021-06-27 09:46:27 +02:00
Tom 8749235046 Kernel: Add support for multiple VirtIO GPU outputs
This creates /dev/fbX devices for each physical output, owned by the
parent VirtIOGPU instance. This allows mapping and setting resolutions
independently for each output.
2021-06-27 09:46:27 +02:00
Tom 708f27ca0e WindowServer: Use relative coordinates when flushing screen dirty rects
The framebuffer device expects coordinates relative to itself.
2021-06-27 09:46:27 +02:00
Tom c12cbb96ce WindowServer: Fix geometry label not updating if it isn't moving
This fixes a regression where the geometry label isn't updating even
though the window geometry had changed because the geometry label's
location isn't changing.
2021-06-27 09:37:07 +02:00
Andreas Kling f61a9f2dc5 LibJS: Don't extend arguments object to match the parameter count
The `arguments` object should only have the *arguments* as numeric
properties, not the *parameters*.

Given this function:

    function foo(a, b) {
        return arguments.length;
    }

Calling foo() with no arguments now correctly returns 0 instead of 2.
2021-06-27 00:37:07 +02:00
Andreas Kling beb43f673e AK: Undo bogus Variant::downcast() rename
I accidentally renamed these to verify_cast() when doing the global
AK::downcast() rename.
2021-06-26 21:27:58 +02:00
Linus Groh 337ad6d15c LibJS: Implement the GetMethod() abstract operation as a Value method
This was a standalone function previously (get_method()), but instead of
passing a Value to it, we can just make it a method.

Also add spec step comments and fix the receiver value by using GetV().
2021-06-26 19:24:35 +01:00
Linus Groh 31f5797e89 LibJS: Implement the GetV() abstract operation
Like Get(), but with any value instead of an object - it's calling
ToObject() for us and passes the value to [[Get]]() as the receiver.

This will be used in GetMethod() (and a couple of other places, which
can be updated over time).

I also tried something new here: adding the three steps from the spec as
inline comments :^)
2021-06-26 19:17:28 +01:00
Linus Groh dbda5a9a4c LibJS: Move install_error_cause() from Object to Error
This is only used by Error and its subclasses, so it doesn't need to be
available to all objects.
2021-06-26 19:06:55 +01:00
davidot a63cc2c6b9 LibJS: Skip tests which broke with reversion of f102b563
These tests are correct as other engines pass them but are now broken
2021-06-26 18:16:53 +01:00
davidot 83dd0164b2 Revert "LibJS: Fix this_value in native setters and getters"
This reverts commit f102b563
The reverted to behavior is not correct for example with a double proxy
But this change lead to problems with DOMNodes
2021-06-26 18:16:53 +01:00
davidot 19f505d320 LibJS: Fix propagation of setters and getters from prototypes
If we define a property with just a setter/getter (not both) we must:
- take the previous getter/setter if defined on the actual object
- overwrite the other to nullptr if it is from a prototype
2021-06-26 18:16:53 +01:00
davidot b1441a47b1 LibJS: Allow setting the length of an object with prototype Array
Before this it would always go through the native setter thus
 modifying the array but now you can set length to anything
2021-06-26 18:16:53 +01:00
davidot b38fb418f8 LibJS: Don't remove non-configurable items in Array when setting length 2021-06-26 18:16:53 +01:00
davidot c7aaf40a35 LibJS: Make Array.prototype.lastIndexOf slightly more spec compliant 2021-06-26 18:16:53 +01:00
Sahan Fernando 44174a44bd Meta: Use virtio-vga instead of virtio-gpu if using multiple monitors 2021-06-26 18:45:35 +02:00
Idan Horowitz 5b909a94e7 Toolchain: Build the x86_64 target in addition to i386 in BuildQemu.sh 2021-06-26 17:59:54 +02:00
Andreas Kling 9683b10aec LibJS: Make sure this in the global environment is the global object
Fixes regressed with 0f9038b732.
2021-06-26 17:06:36 +02:00
Andreas Kling 49018553d3 LibJS+LibCrypto: Allow '_' as a numeric literal separator :^)
This patch adds support for the NumericLiteralSeparator concept from
the ECMAScript grammar.
2021-06-26 16:30:35 +02:00
Andreas Kling 527c639c1f LibJS: Fix spelling mistake in one of the syntax error descriptions 2021-06-26 16:25:11 +02:00
Idan Horowitz f3197faf39 CI: Increase the on-target tests timeout to 60 minutes from 30 minutes
This should help reduce the random test failures due to timeouts on
slower github actions runners.
2021-06-26 13:41:58 +01:00
Luke a1f3e711c0 LibJS: Add %TypedArray%.prototype.entries 2021-06-26 13:32:53 +01:00
Luke a6324481e1 LibJS: Add %TypedArray%.prototype.values 2021-06-26 13:32:53 +01:00
Luke fb43b778ab LibJS: Add %TypedArray%.prototype.keys 2021-06-26 13:32:53 +01:00
Luke 293974c1cb LibJS: Add TypedArray support to ArrayIterator
ArrayIteratorPrototype::next seems to implement CreateArrayIterator,
which is an issue for a separate PR.
2021-06-26 13:32:53 +01:00
Gunnar Beutner 787f80d114 Kernel: Specify -fno-pic when using -mcmodel=large
According to the gcc man page these are mutually exclusive and did
in fact cause problems when trying to get the address for asm labels
on x86_64.
2021-06-26 11:08:52 +02:00
Gunnar Beutner b9f6b40651 Kernel: Clean up create_signal_trampoline a bit
The types for asm_signal_trampoline and asm_signal_trampoline_end
were incorrect. They both point into the text segment but they're
not really functions.
2021-06-26 11:08:52 +02:00
Gunnar Beutner 389bf82889 Kernel: Add CPUID flag for long mode
This isn't particularly useful because by the time we've entered
init() the CPU had better support x86_64 anyway. However this shows the
CPU flag in System Monitor - even in 32-bit mode.
2021-06-26 11:08:52 +02:00
Gunnar Beutner 409b874514 Kernel: Ensure that the ProcessBase class is properly laid out on x86_64
Without this the ProcessBase class is placed into the padding for the
ProtectedProcessBase class which then causes the members of the
RefCounted class to end up without the first 4096 bytes of the Process
class:

BP 1, Kernel::Process::protect_data (this=this@entry=0xc063b000)
205     {
(gdb) p &m_ref_count
$1 = (AK::Atomic<unsigned int, (AK::MemoryOrder)5> *) 0xc063bffc

Note how the difference between 'this' and &m_ref_count is less than
4096.
2021-06-26 11:08:52 +02:00
Gunnar Beutner 9077c64d37 Kernel: Correct spelling mistake 2021-06-26 11:08:52 +02:00
Gunnar Beutner 078eeb7bb0 Kernel: Make addresses returned by kmalloc() properly aligned for x86_64 2021-06-26 11:08:52 +02:00
Gunnar Beutner 1e20dd2a45 Kernel: Add PML4T support for the PageDirectory class 2021-06-26 11:08:52 +02:00
Gunnar Beutner f5cd366006 Kernel: Fix memcpy and memset for x86_64
Those size_ts sure are growing up fast.
2021-06-26 11:08:52 +02:00
Gunnar Beutner c4acfdc0fb Kernel: Add slab allocator for 256 bytes
Our types are getting a tiny bit larger for x86_64 so we need another
slab allocator to deal with that.
2021-06-26 11:08:52 +02:00