Commit graph

25550 commits

Author SHA1 Message Date
Liav A 7ba991dc37 Kernel: Steer away from heap allocations for ProcFS process data
Instead, use more static patterns to acquire that sort of data.
2021-08-12 20:57:32 +02:00
Liav A bf1adc2d5d Kernel+LibC: Use 64 bit values for ino_t
Since the InodeIndex encapsulates a 64 bit value, it is correct to
ensure that the Kernel is exposing the entire value and the LibC is
aware of it.

This commit requires an entire re-compile because it's essentially a
change in the Kernel ABI, together with a corresponding change in LibC.
2021-08-12 20:57:32 +02:00
Liav A 04c2addaa8 Kernel: Fail process creating earlier if can't create AddressSpace
It makes more sense to fail the Process creation earlier if we can't
create an AddressSpace for the new Process.
2021-08-12 20:57:32 +02:00
Liav A 01b79910b3 Kernel/Process: Move protected values to the end of the object
The compiler can re-order the structure (class) members if that's
necessary, so if we make Process to inherit from ProcFSExposedComponent,
even if the declaration is to inherit first from ProcessBase, then from
ProcFSExposedComponent and last from Weakable<Process>, the members of
class ProcFSExposedComponent (including the Ref-counted parts) are the
first members of the Process class.

This problem made it impossible to safely use the current toggling
method with the write-protection bit on the ProcessBase members, so
instead of inheriting from it, we make its members the last ones in the
Process class so we can safely locate and modify the corresponding page
write protection bit of these values.

We make sure that the Process class doesn't expand beyond 8192 bytes and
the protected values are always aligned on a page boundary.
2021-08-12 20:57:32 +02:00
Stephan Unverwerth e405f436b6 3DFileViewer: Allow zooming via mouse wheel 2021-08-12 20:57:19 +02:00
Stephan Unverwerth 3c509cf2f7 3DFileViewer: Add magnification filters to texture menu 2021-08-12 20:57:19 +02:00
Stephan Unverwerth 00d527bc25 LibGL: Implement GL_LINEAR texture filter 2021-08-12 20:57:19 +02:00
Andreas Kling 00603d9fd0 Revert "HackStudio: Remove noop code when opening the project"
This reverts commit 012fc3f923.
2021-08-12 20:56:54 +02:00
Stephan Unverwerth 75bc7be622 3DFileViewer: Add texture menu
This allows setting different texture wrap modes
and setting different texture coordinate scale factors.
2021-08-12 18:58:41 +02:00
Stephan Unverwerth b9523e15df LibGL: Implement glTexParameter{i,f}
This currently only implements a subset of this function.
Namely setting wrap, mag and min modes for the GL_TETXURE_2D target.
2021-08-12 18:58:41 +02:00
Stephan Unverwerth e0fef60241 LibGL: Implement "mirrored repeat" wrap mode 2021-08-12 18:58:41 +02:00
Stephan Unverwerth 8902efa52d LibGL: Implement "clamp" wrap mode 2021-08-12 18:58:41 +02:00
Stephan Unverwerth 12785849aa LibGL: Turn Sampler2D into an actual class
This extracts the sampler functionality into its own class.
Beginning with OpenGL 3 samplers are actual objects, separate
from textures. It makes sense to do this already as it also
cleans up code organization quite a bit.
2021-08-12 18:58:41 +02:00
TheFightingCatfish fdde19d616 Utilities: Add option to control when to use colored output for grep
Fixes #9351.
2021-08-12 18:57:21 +02:00
Jean-Baptiste Boric 072961090f Ports: Add cc symlink to gcc port 2021-08-12 18:56:30 +02:00
Jean-Baptiste Boric c9d287b226 Ports: Add awk symlink to mawk port 2021-08-12 18:56:30 +02:00
Jean-Baptiste Boric 2084289162 Userland: Fix PATH environment variable ordering 2021-08-12 18:56:30 +02:00
Jean-Baptiste Boric b1add5860b Base: Make /bin/Shell the login shell by default 2021-08-12 18:56:30 +02:00
Jean-Baptiste Boric 62cd3af5a0 LibC: Add stub forwarders to LibRegex C API
The POSIX C regex functions are expected to live in the C standard
library, but Serenity split off its regex library into LibRegex. Make a
compromise by implementing stub forwarders for the C regex library that
load libregex.so and call the real implementation.

This is needed for ports that expect these C functions to be available
inside the standard C library without introducing a strong coupling
between LibC and LibDl or LibRegex. The non-standard Serenity C++ regex
API still lives inside LibRegex as before.
2021-08-12 18:56:30 +02:00
Karol Kosek 012fc3f923 HackStudio: Remove noop code when opening the project
28b1e66b51 made that
the m_all_editor_wrappers vector is cleared everytime a project path
is changed (the m_project if check is just for the app launch --
the vector is empty there anyway), making the code never execute.
2021-08-12 18:55:58 +02:00
Karol Kosek a2cb5c862d HackStudio: Show the 'Save as...' dialog when saving uncreated file
Previously when user wanted to save an uncreated file, the program
would just quietly ignore the save request, without giving any message.
This can be seen when creating a new editor in split view mode.
2021-08-12 18:54:57 +02:00
Karol Kosek 8516b9532e HackStudio: Add 'Save as...' action
Not adding it to the toolbar, because it has the same icon as
a typical 'Save' action.
2021-08-12 18:54:57 +02:00
Karol Kosek 8a4bb581a2 HackStudio: Show text editor after starting the application
The user can now start typing text instead of creating a file first.

This also enables drag-and-dropping a file as soon as the application
starts.
2021-08-12 18:54:25 +02:00
Gunnar Beutner e4f0795ae4 LibELF+LibTest: Fix incorrect #ifdef 2021-08-12 08:16:07 +02:00
sin-ack a871a2040b Meta: Properly quote some CMake variables in serenity_component
This probably isn't all of them, because I'm no CMake expert. :^)
It does however allow "/bin/false" to build now.
2021-08-12 07:48:50 +02:00
Jean-Baptiste Boric 9b2cc9580b Userland: Add partial support for complex specifications to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric 310eb72f72 Userland: Add support for --delete flag as alias of -d to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric 89ba022ede Userland: Add support for -c/--complement flag to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric 7f2d3df906 Userland: Add support for multiple character translations to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric 7a9d05c24c AK: Add contains(char) method to String 2021-08-12 00:41:13 +02:00
Andreas Kling a29788e58a Kernel: Don't record sys$perf_event() if profiling is not enabled
If you want to record perf events, just enable profiling. This allows us
to add random perf events to programs without littering the file system
with perfcore files.
2021-08-12 00:03:40 +02:00
Andreas Kling 0c39f8128d LibTest: Emit a profile signpost at the start of each test
This makes it super easy to see which test is which when browsing a
profile of the test runner. :^)
2021-08-12 00:03:39 +02:00
Andreas Kling 1e90a3a542 Kernel: Make sys$perf_register_string() generate the string ID's
Making userspace provide a global string ID was silly, and made the API
extremely difficult to use correctly in a global profiling context.

Instead, simply make the kernel do the string ID allocation for us.
This also allows us to convert the string storage to a Vector in the
kernel (and an array in the JSON profile data.)
2021-08-12 00:03:39 +02:00
Andreas Kling 56e84a63ca LibJS: Emit a profile signpost when starting a garbage collection 2021-08-12 00:03:39 +02:00
Andreas Kling 3ed6c137df Profiler: Parse and render signpost strings
The first perf_event argument to a PERF_EVENT_SIGNPOST is now
interpreted as a string ID (in the profile strings set.)

This allows us to generate signposts with custom strings. :^)
2021-08-12 00:03:39 +02:00
Andreas Kling 4657c79143 Kernel+LibC: Add sys$perf_register_string()
This syscall allows userspace to register a keyed string that appears in
a new "strings" JSON object in profile output.

This will be used to add custom strings to profile signposts. :^)
2021-08-12 00:03:39 +02:00
Andreas Kling 00b11d7577 Profiler: Parse and paint profile signpost events :^)
Signposts generated by perf_event(PERF_EVENT_SIGNPOST) now show up in
profile timelines, and if you hover them you get a tooltip with the two
arguments passed with the event.
2021-08-12 00:03:38 +02:00
Andreas Kling 9ae8cd823c profile: Always enable PERF_EVENT_SIGNPOST 2021-08-12 00:03:38 +02:00
Andreas Kling 0d997d48ea Kernel+LibC: Add PERF_EVENT_SIGNPOST
This event will be used by userspace programs wanting to mark
interesting high-level events in the profile. :^)
2021-08-12 00:03:38 +02:00
Linus Groh 84053816d5 LibJS: Use Checked<T> for offsets in the SetViewValue AO
Fixes #9338.
2021-08-11 22:56:58 +01:00
Linus Groh 6fc0b2a43d LibJS: Use Checked<T> for offsets in the GetViewValue AO
Fixes #9336.
2021-08-11 22:56:58 +01:00
Federico Guerinoni b2a849935b LibIPC: Pass only message size to decoder
Fixes #9015.
2021-08-11 18:28:59 +02:00
Timothy Flynn df14d11a11 LibRegex: Disallow invalid interval qualifiers in Unicode mode
Fixes all remaining 'built-ins/RegExp/property-escapes' test262 tests.
2021-08-11 13:11:01 +02:00
Timothy Flynn a98d3a1a85 LibUnicode: Download and parse DerivedNormalizationProps UCD file
This file contains the last properties that LibUnicode is not parsing.
Much of the data in this file is not currently used; that is left as a
FIXME for when String.prototype.normalize is implemented. Until then,
only the code point properties are utilized for regular expression
pattern escapes.
2021-08-11 13:11:01 +02:00
Timothy Flynn 1e91334008 LibUnicode: Handle edge-case script extensions, Common and Inherited
These script extensions have some peculiar behavior in the Unicode spec.
The UCD ScriptExtension file does not contain these scripts. Rather, it
is implied the code points which have these scripts as an extension are
the code points that both:

  1. Have Common or Inherited as their primary script value
  2. Do not have any other script value in their script extension lists

Because these are not explictly listed in the UCD, we must manually form
these script extensions.
2021-08-11 13:11:01 +02:00
Timothy Flynn 47bb350ebd LibUnicode: Generate separate tables for scripts and script extensions
Notice that unlike the note in populate_general_category_unions(),
script extension do indeed have code point ranges which overlap. Thus,
this commit adds code to handle that, and hooks it into the GC unions.
2021-08-11 13:11:01 +02:00
Timothy Flynn e6e462249f LibUnicode: Generate *_from_string methods using a hash map
Rather than a long series of string comparisons, generate each of these
methods using a hash map of the enumeration name to its value.
2021-08-11 13:11:01 +02:00
Timothy Flynn 5ac23d244d LibUnicode: Generate separate tables for Unicode properties
Similar to General Categories, this generates separate tables for the
Property list.
2021-08-11 13:11:01 +02:00
Timothy Flynn b06c104076 LibUnicode: Include Unassigned code points in the Other General Category
Now that the generator parses unassigned General Category properties, it
can include Unassigned (Cn) in the Other (C) category.
2021-08-11 13:11:01 +02:00
Timothy Flynn 7dce2bfe23 LibUnicode: Generate separate tables for General Category properties
Previously, each code point's General Category was part of the generated
UnicodeData structure. This ultimately presented two problems, one
functional and one performance related:

  * Some General Categories are applied to unassigned code points, for
    example the Unassigned (Cn) category. Unassigned code points are
    strictly excluded from UnicodeData.txt, so by relying on that file,
    the generator is unable to handle these categories.

  * Lookups for General Categories are slower when searching through the
    large UnicodeData hash map. Even though lookups are O(1), the hash
    function turned out to be slower than binary searching through a
    category-specific table.

So, now a table is generated for each General Category. When querying a
code point for a category, a binary search is done on each code point
range in that category's table to check if code point has that category.

Further, General Categories are now parsed from the UCD file
DerivedGeneralCategory.txt. This file is a normal "prop list" file and
contains the categories for unassigned code points.
2021-08-11 13:11:01 +02:00