Commit Graph

17525 Commits

Author SHA1 Message Date
Andreas Kling
9588f01739 UserspaceEmulator+LibC: Use sys$emuctl() to pass malloc info to UE
Get rid of the awkward secret handshake sequence between malloc and UE
and simply use sys$emuctl() to notify UE of malloc, free and realloc.
2021-03-09 11:31:18 +01:00
Andreas Kling
4faeaf101c LibC: Don't scrub memory in malloc/free when running in UE
Since UE is keeping track of the heap anyway, we can skip the scrubbing
and drastically improve the speed of malloc and free when emulating.
2021-03-09 08:59:10 +01:00
Andreas Kling
84725ef3a5 Kernel+UserspaceEmulator: Add sys$emuctl() system call
This returns ENOSYS if you are running in the real kernel, and some
other result if you are running in UserspaceEmulator.

There are other ways we could check if we're inside an emulator, but
it seemed easier to just ask. :^)
2021-03-09 08:58:26 +01:00
Luke
d650b38eb9 LibWeb: Expose new CSS interfaces on the window object 2021-03-09 07:57:33 +01:00
Bui Quang Minh
ec063f4f63 HackStudio: Add language client check in identifier click 2021-03-09 07:54:30 +01:00
AnicJov
68f2ef1097 Ports: Add libogg
This library will allow us to port more multimedia programs and games,
since it's a common dependency of such projects. I was looking at
Scummvm's dependencies in particular, with a goal of porting them all
eventually, so that we can have Myst running in Serenity!
2021-03-09 07:29:35 +01:00
Tom
389dddd4b3 Meta: Add a build helper script
This script automatically manages the toolchain and cmake/ninja folders
making it easier to manage the different target architectures.
2021-03-09 07:28:59 +01:00
Mițca Dumitru
b07310dc8b LibM: Add nan{f, l} 2021-03-09 07:28:06 +01:00
Mițca Dumitru
efe4845c56 LibM: Implement more rounding functions
This patch implements the entire rint family, while taking into account
the current rounding mode, and implements ceil, round, trunc, and floor
for types which they weren't before.
2021-03-09 07:28:06 +01:00
Mițca Dumitru
88d342d007 LibM: Implement the frexp family 2021-03-09 07:28:06 +01:00
Mițca Dumitru
b274120b3c LibM: Implement copysign for float and long double 2021-03-09 07:28:06 +01:00
Mițca Dumitru
87b61b0eef LibM: Add scalbn and associated functions
Also implement ldexp in terms of them, and add ldexpl
2021-03-09 07:28:06 +01:00
Mițca Dumitru
8f7aa1e03a AK: Include Assertions.h in StdLibExtras.h 2021-03-09 07:28:06 +01:00
Mițca Dumitru
352b383280 LibM: Add ilogb and logb 2021-03-09 07:28:06 +01:00
Mițca Dumitru
190952675e LibM: Specialiase FloatExtractor for long double as well 2021-03-09 07:28:06 +01:00
Mițca Dumitru
a13f2b7df3 LibC: Add defines to float.h
This doesn't define FLT_EVAL_METHOD as I'm not sure what I should actually use for that
2021-03-09 07:28:06 +01:00
Mițca Dumitru
857b0e1dc3 LibC: Add imaxdiv and lldiv 2021-03-09 07:28:06 +01:00
Mițca Dumitru
42a8186728 LibM: Define floating point comparsion macros 2021-03-09 07:28:06 +01:00
Mițca Dumitru
70737b42b2 LibM: Define math_errhandling and associated macros 2021-03-09 07:28:06 +01:00
Ben Wiederhake
1e857de263 UserspaceEmulator: Support munmap/mprotect with partial mappings
Fixes #5663.
2021-03-08 22:57:36 +01:00
Ben Wiederhake
45443f24ec UserspaceEmulator: Enable splitting regions at arbitrary points
This is not yet useful in and of itself, but enables the feature in the next commit.
2021-03-08 22:57:36 +01:00
Ben Wiederhake
7cc8f20a30 UserspaceEmulator: Convert backing storage from malloc to mmap
This saves a few bytes for each guest-mmaped region, especially since these are likely to be page-aligned.
2021-03-08 22:57:36 +01:00
Andreas Kling
968ad0f8d1 LibWeb: Some improvements to CSS height:auto computation for blocks
Auto block heights are now computed according to something that kinda
resembles the specification.

Blocks with inline children and height:auto have their height computed
based on the top of the first line box and the bottom of the last line
box. Very straightforward.

Blocks with block children and height:auto have their height computed
based on the top of the first in-flow block child's margin box, and the
bottom of the last in-flow block child's margin box.
2021-03-08 22:53:28 +01:00
Andreas Kling
0918dd0460 Website: Add link to @ABigPickle's VLA exploit 2021-03-08 22:53:28 +01:00
Andreas Kling
dfca6b03e4 Website: Reorganize bounty page history section a little bit 2021-03-08 22:53:28 +01:00
Brian Gianforcaro
bac0dd5e3d LibGUI: Use AK_ENUM_BITWISE_OPERATORS for the FocusPolicy enum 2021-03-08 18:47:40 +01:00
Brian Gianforcaro
5f6ab77352 Kernel: Add bitwise operators for Thread::FileBlocker::BlockFlags enum
Switch to using type-safe bitwise operators for the BlockFlags class,
this cleans up a lot of boilerplate casts which are necessary when the
enum is declared as `enum class`.
2021-03-08 18:47:40 +01:00
Brian Gianforcaro
eaef57443c Kernel: Make MemoryManager API type-safe for Region::Access enum
Increase type-safety moving the MemoryManager APIs which take a
Region::Access to actually use that type instead of a `u8`.

Eventually the actually m_access can be moved there as well, but
I hit some weird bug where it wasn't using the correct operators
in `set_access_bit(..)` even though it's declared (and tested).
Something to fix-up later.
2021-03-08 18:47:40 +01:00
Brian Gianforcaro
c825159f01 AK: Add AK_ENUM_BITWISE_OPERATORS(..) to enable type-safe enum bitwise operations
This change introduces `AK_ENUM_BITWISE_OPERATORS(..)` which when
enabled for an enum, will automatically declare all the necessary
bitwise operators for that enum.

This allows bit masks enums to be used as first class, type safe, citizens.
2021-03-08 18:47:40 +01:00
Andreas Kling
dda6eb0f1f LibWeb: Implement StyleSheet.type
This just returns "text/css" on CSSStyleSheet, nothing exciting.
2021-03-08 16:16:28 +01:00
Andreas Kling
2cff070108 LibWeb: Map all the IDL string types to AK::String for now
DOMString, CSSOMString and USVString can all map to AK::String for now,
until we figure something better out.
2021-03-08 16:14:56 +01:00
Andreas Kling
bc116f3b13 LibWeb: Give CSSLoader a backpointer to its owner element
This allows CSSLoader to set up the style sheet owner node internally,
and avoids an awkward weak link between CSSLoader and Document.
2021-03-08 16:03:14 +01:00
Andreas Kling
d07fcba69b LibWeb: Implement StyleSheet.ownerNode :^) 2021-03-08 16:03:14 +01:00
Tom
183b2e71ba AK: Take advantage of constexpr in Time and add time conversion methods
By making the Time constructor constexpr we can optimize creating a
Time instance from hardcoded values.

Also add more functions to convert between Time and various time units.
2021-03-08 15:29:11 +01:00
Tom
42bc229500 AK: Initialize the AK::Time members
Since we tell the compiler to provide a default constructor we
need to initialize the member variables.
2021-03-08 15:29:11 +01:00
Andreas Kling
096c4571bb Ports: Add SDL2_mixer 2021-03-08 13:15:35 +01:00
Andreas Kling
a9830d9a55 LibWeb: Start exposing CSS style sheets to JavaScript :^)
This patch adds bindings for the following objects:

- StyleSheet
- StyleSheetList
- CSSStyleSheet

You can get to a document's style sheets via Document.styleSheets
and iterate through them using StyleSheetList's item() and length().

That's it in terms of functionality at this point, but still neat. :^)
2021-03-08 11:50:36 +01:00
Andreas Kling
0d515dea5d LibWeb: Allow specifying a custom C++ implementation for IDL attributes
The "ImplementedAs" extended attribute can now be specified on IDL
attributes to provide the name of a custom C++ implementation instead
of assuming it will have the same name as the attribute.
2021-03-08 11:50:36 +01:00
Andreas Kling
79bc07e5af LibWeb: Make generated wrapper code cast IDL longs to i32 for now
This makes it possible to use "long" and "unsigned long" in IDL.
2021-03-08 11:50:36 +01:00
Andreas Kling
483b45db3f AK: JsonObject::value_or() fallback value should be a const reference 2021-03-08 11:50:36 +01:00
Jorropo
9eff9b8cea Ports/git: remove no longer needed patches 2021-03-08 10:22:14 +01:00
Brendan Coles
69b98f7d32 Base: Add sysctl man page 2021-03-08 09:48:34 +01:00
AnotherTest
fb68aa1480 Shell: Don't blindly dereference the result of Parser::parse()
It _may_ return nullptr if there's nothing to return.
Fixes #5691.
2021-03-08 09:28:15 +01:00
Emanuele Torre
26c4cae77c Meta: check-newlines-at-eof.py now checks .json files and files in Base/
This makes it also check man pages and keymap files. :^)
2021-03-08 09:20:53 +01:00
Emanuele Torre
dd17ec180f Base: Fix newlines at end of file in some files. 2021-03-08 09:20:53 +01:00
Emanuele Torre
1f81bc6879 Everywhere: Remove unnecessary whitespace at the end of some lines. 2021-03-08 09:20:53 +01:00
Emanuele Torre
6749ba3477 Base: Replace HTMl => HTML 2021-03-08 09:20:53 +01:00
Emanuele Torre
b7de2046e6 Meta: serenityos.org: Fix javascript error in the 2nd anniversary page.
The error as seen from chromium's devtools:

    Uncaught ReferenceError: I is not defined
        at (index):455
2021-03-08 09:20:53 +01:00
aabajyan
0dfbc2c702 Ports: Add Genemu
This is a Basic Genesis / MegaDrive Emulator, that only requires
SDL2 to run it.

Usage: genemu /path/to/game.bin
2021-03-08 08:57:12 +01:00
Luke
368f78d03c Kernel: Manually reset the XCR0 register
According to the Intel manual: "After reset, all bits (except bit 0) in
XCR0 are cleared to zero; XCR0[0] is set to 1."
Sadly we can't trust this, for example VirtualBox starts with
bits 0-4 set, so let's do it ourselves.

Fixes #5653
2021-03-08 08:56:38 +01:00