Commit graph

1031 commits

Author SHA1 Message Date
Timothy Flynn
ec7d5351ed LibJS+LibUnicode: Handle flexible day periods that roll over midnight
When searching for the locale-specific flexible day period for a given
hour, we were neglecting to handle cases where the period crosses 00:00.
For example, the en locale defines a day period range of [21:00, 06:00).
When given the hour of 05:00, we were checking if (21 <= 5 && 5 < 6),
thus not recognizing that the hour falls in that period.
2022-01-05 16:22:55 +01:00
Timothy Flynn
dd88ff70ac LibUnicode: Remove now unused value-from-string generator overload 2022-01-04 22:49:43 +00:00
Timothy Flynn
437b9fe204 LibUnicode: Convert UnicodeData to link with weak symbols 2022-01-04 22:49:43 +00:00
Timothy Flynn
f576142fe8 LibJS+LibUnicode: Convert UnicodeLocale to link with weak symbols 2022-01-04 22:49:43 +00:00
Timothy Flynn
cf8e11a562 LibUnicode: Add temporary overload of value-from-string generator
This is a temporary mechanism while LibUnicode is in an in-between state
where some symbols are weakly linked and others are dynamically loaded.
The latter require an asm() label to be loaded.
2022-01-04 22:49:43 +00:00
Timothy Flynn
ba4cdf34f8 LibUnicode: Convert UnicodeDateTimeFormat to link with weak symbols 2022-01-04 22:49:43 +00:00
Timothy Flynn
98709d9be1 LibUnicode: Convert UnicodeNumberFormat to link with weak symbols
Currently, we load the generated Unicode symbols with dlopen at runtime.
This is unnecessary as of 565a880ce5.

Applications that want Unicode data now link directly against the shared
library holding that data. So the same functionality can be achieved
with weak symbols.
2022-01-04 22:49:43 +00:00
sin-ack
9121cc7cae LibWeb: Implement CanvasRenderingContext2D.measureText
This requires an implementation of the "text preparation algorithm" as
specified here:

html.spec.whatwg.org/multipage/canvas.html#text-preparation-algorithm

However, we're missing a lot of things such as the
CanvasTextDrawingStyles interface, so most of the algorithm was not
implemented. Additionally, we also are not able to use a LineBox like
the algorithm suggests, because our layouting infra is not up to the
task yet. The prepare_text function does nothing other than figuring out
the width of the given text and return glyphs with offsets at the
moment.
2022-01-04 22:41:07 +00:00
Timothy Flynn
126a3fe180 LibUnicode: Add minimal support for generic & offset-based time zones
ECMA-402 now supports short-offset, long-offset, short-generic, and
long-generic time zone name formatting. For example, in the en-US locale
the America/Eastern time zone would be formatted as:

    short-offset: GMT-5
    long-offset: GMT-05:00
    short-generic: ET
    long-generic: Eastern Time

We currently only support the UTC time zone, however. Therefore, this
very minimal implementation does not consider GMT offset or generic
display names. Instead, the CLDR defines specific strings for UTC.
2022-01-03 15:11:59 +01:00
Tom
2bb32a87f9 Meta: Rename SERINITY_NVME_ENABLE variable to SERENITY_NVME_ENABLE 2022-01-01 21:05:44 +00:00
Pankaj Raghav
344cfa0db4 Meta: Enable attaching NVMe storage devices to qemu
Add an option to enable NVMe storage device as the boot
drive.

To enable NVMe support, run the following:

$ SERENITY_NVME_ENABLE=1 Meta/serenity.sh run i686 root=/dev/nvme0n1
2022-01-01 14:55:58 +01:00
Pankaj Raghav
e99fafb683 Kernel/NVMe: Add initial NVMe driver support
Add a basic NVMe driver support to serenity
based on NVMe spec 1.4.

The driver can support multiple NVMe drives (subsystems).
But in a NVMe drive, the driver can support one controller
with multiple namespaces.

Each core will get a separate NVMe Queue.
As the system lacks MSI support, PIN based interrupts are
used for IO.

Tested the NVMe support by replacing IDE driver
with the NVMe driver :^)
2022-01-01 14:55:58 +01:00
Timothy Flynn
0c84957eba Meta: Add helper CMake function to link directly against LibUnicodeData
Rather than each CMakeLists.txt needing to import unicode_data.cmake and
check if Unicode data generation is enabled, add a helper method to do
this.
2021-12-30 14:18:12 +01:00
tuftedocelot
6dee1e91be Meta+Documentation: Don't rebuild disk image for every run on OpenBSD 2021-12-29 03:46:56 -08:00
tuftedocelot
68e4e7923a Meta: Add egcc as a GCC candidate
egcc is the alias for the GCC compiler (since OpenBSD uses Clang by
default). Toolchain/BuildIt.sh has the necessary adjustments, but the
compiler check occurs before BuildIt.sh is called.
2021-12-29 03:46:56 -08:00
tuftedocelot
5810467c97 Build: Remove gzip -k usage in PCI/USB ID files and crypt for OpenBSD
OpenBSD gzip does not have the -k flag to keep the original after
extraction. Work around this by copying the original gzip to the dest
and then extracting. A bit of a hack, but only needs to be done for the
first-time or rebuilds

OpenBSD provides crypt in libc, not libcrypt. Adjust if/else to check
for either and proceed accordingly

Remove outdated OpenBSD checks when building the toolchain
2021-12-29 03:46:56 -08:00
Andreas Kling
b24dc84ad9 Meta: Add SSE3, SMAP and SMEP to our bochsrc
- SSE3 makes LibM's trunc() not SIGILL (due to FISTTP).
- SMAP and SMEP allow us to exercise more kernel security mechanisms.
2021-12-28 11:51:50 +01:00
Ben Wiederhake
d9af659a12 Meta: Add link to awesome new meta-project from main website :^) 2021-12-27 15:06:39 +02:00
Kelvium
dfb994f62d Meta: Don't override SERENITY_KVM_SUPPORT if it is already set
I've seen how @awesomekling changes the script to disable KVM, so
that's a useful thing to have.

An example how to use it:
  SERENITY_KVM_SUPPORT='0' ./Meta/serenity.sh run x86_64

My first commit btw :^)
2021-12-26 22:39:29 +03:30
Stephan Unverwerth
ad3d5d43bd LibGL+LibSoftGPU: Move rendering related code to LibSoftGPU library
This introduces a new library, LibSoftGPU, that incorporates all
rendering related features that formerly resided within LibGL itself.

Going forward we will make both libraries completely independent from
each other allowing LibGL to load different, possibly accelerated,
rendering backends.
2021-12-24 05:10:28 -08:00
Michel Hermier
682f89d5bc LibC: Allow multiple includes of <assert.h>
ISO C requires in section 7.2:
The assert macro is redefined according to the current state of NDEBUG
each time that <assert.h> is included.

Also add tests for `assert` multiple inclusion accordingly.
2021-12-23 17:53:46 -08:00
Michel Hermier
7b8398ea0d Meta: Allow to skip #pragma once check
Some headers migth need to be reentered multiple times (eg. <assert.h>)
so a mecanism to skip that check is necessary.
2021-12-23 17:53:46 -08:00
Brian Gianforcaro
39e5b42f36 IPCCompiler: Default initialize all parameter member variables
PVS Studio static analysis noticed we didn't initialize these in a
bunch of cases. This change fixes that so we will always initialize
these using universal initialization.
2021-12-22 13:29:31 -08:00
Ali Mohammad Pur
f20e0036bd Meta: Add a cmake flag for building for compiler explorer
We don't need to build tests/binaries for CE.
2021-12-22 20:49:28 +03:30
Timothy Flynn
52394deece LibUnicode: Remove now unused value-from-string generator overload
The generate_value_from_string_for_dynamic_loading() overload was just
temporary until all generates were switched over to dynamic loading.
2021-12-21 13:09:49 -08:00
Timothy Flynn
15e1498419 LibUnicode: Dynamically load the generated UnicodeDateTimeFormat symbols 2021-12-21 13:09:49 -08:00
Timothy Flynn
a1f0ca59ae LibUnicode: Dynamically load the generated UnicodeNumberFormat symbols 2021-12-21 13:09:49 -08:00
Timothy Flynn
09be26b5d2 LibUnicode: Dynamically load the generated UnicodeLocale symbols 2021-12-21 13:09:49 -08:00
Timothy Flynn
3fd53baa25 LibUnicode: Dynamically load the generated UnicodeData symbols
The generated data for libunicodedata.so is quite large, and loading it
is a price paid by nearly every application by way of depending on
LibRegex. In order to defer this cost until an application actually uses
one of the surrounding APIs, dynamically load the generated symbols.

To be able to load the symbols dynamically, the generated methods must
have demangled names. Typically, this is accomplished with `extern "C"`
blocks. The clang toolchain complains about this here because the types
returned from the generators are strictly C++ types. So to demangle the
names, we use the asm() compiler directive to manually define a symbol
name; the caveat is that we *must* be sure the symbols are unique. As an
extra precaution, we prefix each symbol name with "unicode_". For more
details, see: https://gcc.gnu.org/onlinedocs/gcc/Asm-Labels.html

This symbol loader used in this implementation provides the additional
benefit of removing many [[maybe_unused]] attributes from the LibUnicode
methods. Internally, if ENABLE_UNICODE_DATABASE_DOWNLOAD is OFF, the
loader is able to stub out the function pointers it returns.

Note that as of this commit, LibUnicode is still directly linked against
LibUnicodeData. This commit is just a first step towards removing that.
2021-12-21 13:09:49 -08:00
Linus Groh
92672b1520 Meta: Add a fuzzer for the QOILoader 2021-12-21 13:27:27 +01:00
Michel Hermier
060e5ccbbc Lagom: Bind time_zone_list_index_type in the generator
The variable `s_time_zone_list_index_type` seems to be unused (detected
when compiling with clang), and it seems logical to bind it even it if
it is not used for now.
2021-12-18 21:01:10 -08:00
Andreas Kling
363875128c Websites: Update the SerenityOS bug bounty program :^)
Let's increase the reward since I have significantly improved funding
over the last year! Merry haxmas! :^)
2021-12-18 11:30:10 +01:00
Simon Woertz
c2df6b597a Lagom: Add argument WORKING_DIRECTORY to lagom_test(...)
So far the working directory was set in some cases using
`set_tests_properties(...)`, but this requires to know which name is
picked by `lagom_test(...)` when calling `add_test(...)`.
In case of adding multiple test cases using a globbing pattern this
would require to duplicate code to construct the test name from the file
name.
2021-12-15 10:33:27 -08:00
Linus Groh
976ab23b9c LibWeb: Add support for the BufferSource IDL parameter type 2021-12-14 09:01:06 +01:00
Linus Groh
615be9eb7c LibWeb: Add the SubtleCrypto interface
Just some boilerplate code to get started :^)
This adds both the SubtleCrypto constructor to the window object, as
well as the crypto.subtle instance attribute.
2021-12-14 09:01:06 +01:00
Timothy Flynn
ce6c515873 LibUnicode: Generate unique list patterns and lists of list patterns 2021-12-13 21:28:56 -08:00
Timothy Flynn
0ad2decd04 LibUnicode: Generate unique list of keyword values 2021-12-13 21:28:56 -08:00
Timothy Flynn
0c6cc4ad96 LibUnicode: Generate unique lists of localized currencies 2021-12-13 21:28:56 -08:00
Timothy Flynn
a45f2ccc25 LibUnicode: Generate unique lists of languages, territories, and scripts 2021-12-13 21:28:56 -08:00
Timothy Flynn
6e5f0b139b LibUnicode: Remove unused fields from generated structures
A couple of structures held a string index that is unused. Removing them
also removes the string values from the unique string list.
2021-12-13 21:28:56 -08:00
Timothy Flynn
77fc877c04 LibUnicode: Generate unique lists of hour cycles 2021-12-13 21:28:56 -08:00
Timothy Flynn
6f17696176 LibUnicode: Generate unique lists of time zone structures 2021-12-13 21:28:56 -08:00
Timothy Flynn
df33156462 LibUnicode: Generate unique lists of day period structures 2021-12-13 21:28:56 -08:00
Timothy Flynn
265785e847 LibUnicode: Generate unique day period structures 2021-12-13 21:28:56 -08:00
Timothy Flynn
7af1818e76 LibUnicode: Generate unique time zone structures
Each of the 374 locales contain 156 time zone structures. Of these
58,344 structures, 13,578 are unique.
2021-12-13 21:28:56 -08:00
Timothy Flynn
b14b37f386 LibUnicode: Generate unique calendar structures
Of the 374 generated calendars, 173 are unique.
2021-12-13 21:28:56 -08:00
Timothy Flynn
4b721597d7 LibUnicode: Generate unique lists of calendar range patterns
Of the 374 range pattern lists and 374 range12 pattern lists, 230 are
unique.
2021-12-13 21:28:56 -08:00
Timothy Flynn
9fc2442e7d LibUnicode: Generate unique lists of calendar patterns
Of the 374 generated lists, 152 are unique. These lists have upwards of
1000 entries as well, so the de-duplication is particularly nice.
2021-12-13 21:28:56 -08:00
Timothy Flynn
09547f4084 LibUnicode: Generate unique lists of calendar symbols structures
Of the 374 generated lists, 120 are unique.
2021-12-13 21:28:56 -08:00
Timothy Flynn
f681ec9d98 LibUnicode: Generate unique calendar symbols structures
Each of the 374 generated calendars include 4 symbols structures. Of
these 1496 structures, only 386 are unique.
2021-12-13 21:28:56 -08:00