Commit Graph

9666 Commits

Author SHA1 Message Date
Andreas Kling
57b86fd082 Kernel: Fix invalid jump in case RDRAND fails
If RDRAND doesn't give us data, we want to try again, not jump to some
low address like 0x80 :^)
2020-05-20 19:54:56 +02:00
Linus Groh
a51adf27bf Base: Add more characters to Katica10 and CsillaThin7x10
£, ×, ÷, Ä, à, á, â, ã, ä, ñ, ò, ó, ô, õ, ù, ú, û, ß
2020-05-20 19:19:16 +02:00
Andreas Kling
b55b26a2bc Revert "AK: Add InitializerList, an implementation of std::initializer_list"
This reverts commit 0a2cab0928.
2020-05-20 16:24:26 +02:00
Andreas Kling
bded472ec4 Revert "AK+LibC: Move non-placement new/delete into LibC"
This reverts commit 2c82347393.
2020-05-20 16:24:26 +02:00
Andreas Kling
0c5e441a0b Revert "Kernel: Add implementation of operator new and delete to kmalloc.cpp"
This reverts commit 6d0d848720.
2020-05-20 16:24:26 +02:00
Andreas Kling
21c3045c47 Revert "Kernel: Don't link against libstdc++"
This reverts commit bde7bc3472.
2020-05-20 16:24:26 +02:00
Andreas Kling
67cc7d09a2 Revert "AK: Add AtomicRef, for atomically accesing a reference to a varaible"
This reverts commit aff594f1e7.
2020-05-20 16:24:26 +02:00
Andreas Kling
8876bfc3ac Revert "AK: Don't demangle in serenity :("
This reverts commit 4361a50225.
2020-05-20 16:24:26 +02:00
Andreas Kling
ef776c1e68 Revert "LibC: Implement Itanium C++ ABI for static variable guards"
This reverts commit cdbbe14062.
2020-05-20 16:24:26 +02:00
Andreas Kling
250c3b363d Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem"
This reverts commit c1eb744ff0.
2020-05-20 16:24:26 +02:00
Andreas Kling
3d02b23af5 Revert "Toolchain: Don't pre-build LibC and LibM, nor pre-install their headers"
This reverts commit 4e051c6c15.
2020-05-20 16:24:26 +02:00
Andreas Kling
59c3b3b702 Revert "Meta: Restore instructions to create build directory for CMake"
This reverts commit 83137f76de.
2020-05-20 16:24:26 +02:00
Sergey Bugaev
7d8bfe4f3a Base: Tweak SystemServer.ini
Notably, adjust service priorities.
2020-05-20 15:42:48 +02:00
Andreas Kling
81d35c6891 Kernel: Always inline stac(), clac() and SmapDisabler
Let's not be paying the function call overhead for these tiny ops.
Maybe there's an argument for having fewer gadgets in the kernel but
for now we're actually seeing stac() in profiles so let's put
that above theoretical security issues.
2020-05-20 14:17:01 +02:00
Andreas Kling
e10183a6c5 AK: Include Platform.h in RefCounted.h so we have ALWAYS_INLINE
Otherwise Lagom doesn't build on my host machine.
2020-05-20 14:13:39 +02:00
Sergey Bugaev
746db0bedb Kernel: Validate access to whole regions 2020-05-20 14:11:13 +02:00
Sergey Bugaev
0dd68a2949 Kernel: Look for a user region first
We're far more likely to be looking for a user region than otherwise, so
optimize for that case.
2020-05-20 14:11:13 +02:00
Sergey Bugaev
d2b500fbcb AK+Kernel: Help the compiler inline a bunch of trivial methods
If these methods get inlined, the compiler is able to statically eliminate most
of the assertions. Alas, it doesn't realize this, and believes inlining them to
be too expensive. So give it a strong hint that it's not the case.

This *decreases* the kernel binary size.
2020-05-20 14:11:13 +02:00
Sergey Bugaev
36dcbce161 LibC: Claim some copyright for stdio
I've written a large part of the new stdio, so I'm (partly) to blame for it now.
2020-05-20 14:11:13 +02:00
Sergey Bugaev
776275a747 LibC: Handle fgets(size = 0)
I accidentally broke this in the recent rewrite. This reinstantiates the
behavior implemented in 6571468525.
2020-05-20 14:11:13 +02:00
Hüseyin ASLITÜRK
da23514431 Base: Add MessageBox question icon 2020-05-20 13:54:10 +02:00
Hüseyin ASLITÜRK
63539d655c Demos: WidgetGallery, Add MessageBox question icon option 2020-05-20 13:54:10 +02:00
Hüseyin ASLITÜRK
25227ee284 LibGUI: Add MessageBox question icon 2020-05-20 13:54:10 +02:00
AnotherTest
7fba21aefc LibLine: Unify completion hooks and adapt its users
LibLine should ultimately not care about what a "token" means in the
context of its user, so force the user to split the buffer itself.
This also allows the users to pick up contextual clues as well, since
they have to lex the line themselves.

This commit pacthes Shell and the JS repl to better handle completions,
so certain wrong behaviours are now corrected as well:
- JS repl can now complete "Object . getOw<tab>"
- Shell can now complete "echo | ca<tab>" and paths inside strings
2020-05-20 13:41:37 +02:00
Hüseyin ASLITÜRK
d18f6e82eb LibGUI: Replace up and down arrows with emoji 2020-05-20 13:40:24 +02:00
Hüseyin ASLITÜRK
80699a0824 LibGUI: Update copyright character in about dialog 2020-05-20 13:40:24 +02:00
Hüseyin ASLITÜRK
426cdaf65b Base: Add new characters to Katica and Csilla 2020-05-20 13:40:24 +02:00
Andrew Kaster
83137f76de Meta: Restore instructions to create build directory for CMake
We eliminated the need to pre-build LibC for libstdc++ by eliminating
libstdc++ itself, so users need to create their own build directories
again.
2020-05-20 08:37:50 +02:00
Andrew Kaster
4e051c6c15 Toolchain: Don't pre-build LibC and LibM, nor pre-install their headers
We can do away with that shenanigans now that libstdc++ is gone.
Also, simplify the toolchain dependency hash calculation to only depend
on the toolchain build script(s) and the Patches files we use to modify
the toolchain itself.
2020-05-20 08:37:50 +02:00
Andrew Kaster
c1eb744ff0 Build: Include headers from LibC, LibM, and LibPthread with -isystem
Make sure that userspace is always referencing "system" headers in a way
that would build on target :). This means removing the explicit
include_directories of Libraries/LibC in favor of having it export its
headers as SYSTEM. Also remove a redundant include_directories of
Libraries in the 'serenity build' part of the build script. It's already
set at the top.

This causes issues for the Kernel, and for crt0.o. These special cases
are handled individually.
2020-05-20 08:37:50 +02:00
Andrew Kaster
cdbbe14062 LibC: Implement Itanium C++ ABI for static variable guards
This is __cxa_guard_acquire, __cxa_guard_release, and __cxa_guard_abort.

We put these symbols in a 'fake' libstdc++ to trick gcc into thinking it
has libstdc++. These symbols are necessary for C++ programs and not C
programs, so, seems file. There's no way to tell gcc that, for example,
the standard lib it should use is libc++ or libc. So, this is what we
have for now.

When threaded code enters a block that is trying to call the constructor
for a block-scope static, the compiler will emit calls to these methods
to handle the "call_once" nature of block-scope statics.

The compiler creates a 64-bit guard variable, which it checks the first
byte of to determine if the variable should be intialized or not.

If the compiler-generated code reads that byte as a 0, it will call
__cxa_guard_acquire to try and be the thread to call the constructor for
the static variable. If the first byte is 1, it will assume that the
variable's constructor was called, and go on to access it.

__cxa_guard_acquire uses one of the 7 implementation defined bytes of
the guard variable as an atomic 8 bit variable. To control a state
machine that lets each entering thread know if they gained
'initialization rights', someone is working on the varaible, someone is
working on the varaible and there's at least one thread waiting for it
to be intialized, or if the variable was initialized and it's time to
access it. We only store a 1 to the byte the compiler looks at in
__cxa_guard_release, and use a futex to handle waiting.
2020-05-20 08:37:50 +02:00
Andrew Kaster
4361a50225 AK: Don't demangle in serenity :(
In order to remove libstdc++ completely, we need to give up on their
implementation of abi::__cxa_demangle. The demangler logic will actually
have to be quite complex, and included in both the kernel and userspace.

A definite fixme for the future, to parse the mangled names into real
deal names.
2020-05-20 08:37:50 +02:00
Andrew Kaster
aff594f1e7 AK: Add AtomicRef, for atomically accesing a reference to a varaible
This is distintly different from Atomic<T*>, because we want to
atomically access a variable that the atomic object itself does not own.
2020-05-20 08:37:50 +02:00
Andrew Kaster
bde7bc3472 Kernel: Don't link against libstdc++
It has nothing we need anymore :^)
2020-05-20 08:37:50 +02:00
Andrew Kaster
6d0d848720 Kernel: Add implementation of operator new and delete to kmalloc.cpp
This was missing before, we were getting it for free from libstdc++
2020-05-20 08:37:50 +02:00
Andrew Kaster
2c82347393 AK+LibC: Move non-placement new/delete into LibC
This allows operator new and operator delete to be available to anyone
that links -lc (everyone) rather than just people that include
kmalloc.h (almost no one).
2020-05-20 08:37:50 +02:00
Andrew Kaster
0a2cab0928 AK: Add InitializerList, an implementation of std::initializer_list
Use the AK version of std::initializer_list in AK::Vector, but only
when in serenity. When building AK for a non-serenity target, the header
<initializer_list> should be always available.
2020-05-20 08:37:50 +02:00
Andrew Kaster
3de808e860 df: Don't include c++ standard <cstring>
Use string.h instead, since that's part of serenity :)
2020-05-20 08:37:50 +02:00
Andreas Kling
191073000e WindowServer: Remove WindowManager::invalidate(Window) API's
Instead, we now tell Windows to invalidate themselves. Window will then
pass on the requests to Compositor.

My basic idea here is that WindowManager should do window management,
dealing with incoming events, moving, resizing, etc. Compositor should
deal with painting the window stack in the right order with the least
amount of effort. :^)
2020-05-20 08:31:46 +02:00
Andreas Kling
10699b347f WindowServer: Move occlusion things from WindowManager to Compositor 2020-05-20 08:31:46 +02:00
Sergey Bugaev
db30a2549e LibC: Rewrite stdio
The new version uses buffering much more prominently, and hopefully performs
better. It also uses something resembling C++ rather than plain C.
2020-05-20 08:31:31 +02:00
Sergey Bugaev
000a9cad34 AK: Fix Checked::multiplication_would_overflow() signature
The two-argument version doesn't need an extra template parameter.
2020-05-20 08:31:31 +02:00
Sergey Bugaev
7541122206 Kernel+LibC: Switch isatty() to use a fcntl()
We would want it to work with only stdio pledged.
2020-05-20 08:31:31 +02:00
AnotherTest
f9cffda0e0 LibTLS: Flush some packets as soon as more packets are written
This seems like a better compromise between throughput and latency, and
it doesn't _really_ affect the performance, so let's just compromise.
2020-05-20 08:30:51 +02:00
Linus Groh
b69abb3626 LibWeb: Make window.location.reload() enumerable only 2020-05-20 08:30:22 +02:00
Linus Groh
eb0810bf1a LibWeb: Make window.location properties non-configurable
Technically the property descriptors for these should not have
"writable: true" but "get" and "set" instead - but we don't support that
yet.
2020-05-20 08:30:22 +02:00
Linus Groh
6caacfec85 LibWeb: Add leading "?" to window.location.search if not empty 2020-05-20 08:30:22 +02:00
Linus Groh
8a913f336a LibWeb: Add leading "#" to window.location.hash if not empty 2020-05-20 08:30:22 +02:00
AnotherTest
c38c2668da LibLine: Default to resolving Spans as byte offsets
This allows all the unicode processing to be internal to the line
editor.
2020-05-19 20:02:28 +02:00
AnotherTest
379cb061d7 LibTLS: Only try to flush data when needed
This patchset drops the write notifier, and schedules writes only when
necessary.
As a result, the CPU utilisation no longer spikes to the skies :^)
2020-05-19 20:00:43 +02:00