Commit Graph

26189 Commits

Author SHA1 Message Date
Andreas Kling
8000e8a080 Kernel: Mark Thread::Blocker leaf subclasses final 2021-08-23 00:02:09 +02:00
Andreas Kling
53019f413c Kernel: Mark BlockCondition subclasses as final 2021-08-23 00:02:09 +02:00
Andreas Kling
bcd2025311 Everywhere: Core dump => Coredump
We all know what a coredump is, and it feels more natural to refer to
it as a coredump (most code already does), so let's be consistent.
2021-08-23 00:02:09 +02:00
Andreas Kling
a930877f31 Kernel: Mape quickmap functions VERIFY that MM lock is held
The quickmap_page() and unquickmap_page() functions are used to map a
single physical page at a kernel virtual address for temporary access.

These use the per-CPU quickmap buffer in the page tables, and access to
this is guarded by the MM lock. To prevent bugs, quickmap_page() should
not *take* the MM lock, but rather verify that it is already held!

This exposed two situations where we were using quickmap without holding
the MM lock during page fault handling. This patch is forced to fix
these issues (which is great!) :^)
2021-08-23 00:02:09 +02:00
Andreas Kling
1b9916439f Kernel: Make Processor::platform_string() return StringView 2021-08-23 00:02:09 +02:00
Andreas Kling
492b7152d9 Kernel: Consolidate I386/X86_64 implementations of do_init_context()
We can use ThreadRegisters::set_flags() to avoid the #ifdef's here.
2021-08-23 00:02:09 +02:00
Andreas Kling
7a4f6da61b Kernel: Fix some trivial clang-tidy warnings in x86/common/Processor.cpp 2021-08-23 00:02:09 +02:00
Andreas Kling
dea93a8bb9 Kernel: Rename Processor::id() => current_id()
And let id() be the non-static version that gives you the ID of a
Processor object.
2021-08-23 00:02:09 +02:00
Andreas Kling
0f03a8aece Kernel: Add VERIFY(!m_in_block) when entering Thread::block() 2021-08-23 00:02:09 +02:00
Andreas Kling
d60635cb9d Kernel: Convert Processor::in_irq() to static current_in_irq()
This closes the race window between Processor::current() and a context
switch happening before in_irq().
2021-08-23 00:02:09 +02:00
Andreas Kling
3e3f760808 Kernel: Fix some trivial clang-tidy warnings in Thread.{cpp,h} 2021-08-23 00:02:09 +02:00
Liav A
cd52eb3103 Kernel/SysFS: Don't expose SMBIOS blobs if can't find SMBIOS tables
Don't assume that a platform machine will provide at least the 32 bit
version of SMBIOS tables. If there's no SMBIOS tables, don't expose
directory entries in the /sys/bios/ directory.
2021-08-22 23:42:20 +02:00
Karol Kosek
8d3304f853 HackStudio: Update every editor with matching filename on 'Save as...'
Prior this change, if user had more than two copies of one file opened
in a split view, then only the active editor was renamed,
when the others had the same file contents changed.

This change will set a new file name for every file.

The is_null() check is for uncreated files, as they shouldn't be
treated as the same single file.
2021-08-22 23:41:53 +02:00
Karol Kosek
90396f5b08 HackStudio: Convert selected path to a relative path on 'Save as...'
This makes the editor title a bit more consistent with the other files
and removes duplicating the file name in the file history
when reopening that file.
2021-08-22 23:41:53 +02:00
Ralf Donau
9bef96748d Games: Make cpath appear once in the pledge promises 2021-08-22 23:39:41 +02:00
Linus Groh
969aee2022 LibJS: Add missing builtin calendar check to ParseTemporalCalendarString
See: https://github.com/tc39/proposal-temporal/commit/48b11d6
2021-08-22 21:20:00 +01:00
Richard Wurth
4b2953125b AK: Use POSIX specified types for Time::to_timespec and to_timeval
The previous implementation assumed 64-bit time_t and 32-bit long,
which is not true on some 32-bit systems
2021-08-22 17:07:11 +02:00
Itamar
f5b69dce0b Utilities: Add -d option to gzip
This option specifies that we should perform decompression instead of
compression.
2021-08-22 16:51:18 +02:00
Robert Stefanic
e4f040147f SQLServer: Use m_client_id instead of client_id in callback
In the DatabaseConnection constructor, there's a deferred_invoke
callback that references the client_id. But depending on when the
callback occurs, the reference of the client_id can change. This created
a problem when connecting to SQLServer using the SQL utility because
depending on when the callback was invoked, the client_id could change.

m_client_id is set in the constructor and that reference will not change
depending on when the callback is invoked.
2021-08-22 15:32:09 +02:00
Andrew January
9a4c1c019a LibGUI: Make Ctrl+Shift+Right select text
Ctrl+Shift+Left would add the word before the cursor to the selection,
but for some reason Ctrl+Shift+Right didn't add the word after the
cursor to the selection.
2021-08-22 15:31:27 +02:00
Maciej Zygmanowski
7237972022 LibC: Support getsignalbyname() with full signal name
This allows e.g. to use `kill` with names like -SIGKILL, not only -KILL.
2021-08-22 15:23:25 +02:00
Lennon Donaghy
283d8d3928 HackStudio: Warn about unsaved changes on opening different project 2021-08-22 10:30:06 +02:00
Lennon Donaghy
82b88c6e16 HackStudio: Fix editor not marking file with unsaved changes as dirty
The editor's on_change callback was being overwritten in
HackStudioWidget.cpp in order to call update_gml_preview on every
change. This stopped the original callback from being called and marking
files as dirty when changed.

Now we call update_gml_preview in a new callback within the editor
wrapper, which is then called within the original on_change callback
in the editor.
2021-08-22 10:30:06 +02:00
Lennon Donaghy
d454c63bde HackStudio: Fix GitWidget issues with switching between projects
GitWidget no longer crashes upon trying to create a repository for a new
project, and it correctly updates after opening a different project. A
new method, change_repo, has been added to make this work, which changes
m_repo_root and resets most of the widget's state in order to make this
work.
2021-08-22 10:30:06 +02:00
Lennon Donaghy
d9c295de46 HackStudio: Moved code closing project from open_project to own method
Take the code which closes the current project out of open_project
method and move it into its own method.
2021-08-22 10:30:06 +02:00
Lennon Donaghy
3ce96134b5 HackStudio: Call update_gml_preview() to reset when opening new project 2021-08-22 10:30:06 +02:00
Lennon Donaghy
5ca888132d HackStudio: Make FindInFilesWidget reset when opening new project
Add method to FindInFilesWidget which resets the model in order to
clear the output when needed, and use this when a new project is opened.
2021-08-22 10:30:06 +02:00
Lennon Donaghy
ff2a1ee8b0 HackStudio: Stop debugger when opening new project
Moved code to stop the debugger in the HackStudioWidget destructor to
a new method so that this can be called in both the destructor and when
opening a new project.
2021-08-22 10:30:06 +02:00
Lennon Donaghy
971a5a70d1 HackStudio: Clear embedded terminal upon opening a different project 2021-08-22 10:30:06 +02:00
Lennon Donaghy
6076deae1d HackStudio: Clear ToDo entries upon opening new project
The ToDoEntries and ToDoEntriesWidget classes now have methods for
clearing the entries, before entries would stay permanently, even after
switching to a new project.
2021-08-22 10:30:06 +02:00
Lennon Donaghy
d48bd49002 HackStudio: Move handle_external_file_deletion logic into own method
Added a close_file_in_all_editors method to HackStudioWidget and moved
the code from handle_external_file_deletion into it so that it can be
reused elsewhere to close files.
2021-08-22 10:30:06 +02:00
Karol Kosek
219206725b LibGUI: Always resize the mapping rows when sorting
Prior this change, creating a file or directory
on Desktop crashed the desktop instance of FileManager.

Closes: #9560
2021-08-22 10:29:17 +02:00
Peter Elliott
38e0d1b456 Kernel: Return ENOTSUP instead of panicking on invalid sockopt
X11 handles this gracefully, and it makes more sense than panicking.
2021-08-22 10:29:06 +02:00
Peter Elliott
ee0c6e1b6d LibC: Add <sys/poll.h> as an alias for <poll.h>
<poll.h> was originally <sys/poll.h> and some old software like X11
still uses the old path.
2021-08-22 10:29:06 +02:00
Peter Elliott
39a77559f1 Kernel+LibC: Implement FIONREAD ioctl
FIONREAD gets the number of bytes availible to read from a file
descriptor without blocking. I only implemented it for regular files and
sockets
2021-08-22 10:29:06 +02:00
Peter Elliott
db92e66902 LibC: Make <netinet/in.h> more POSIX compliant
1. Move htonl() etc. from <arpa/inet.h> to <netinet/in.h> (which
   <arpa/inet.h> includes).

   The htonl(), htons(), ntohl(), and ntohs() functions shall be
   available as described in <arpa/inet.h>.  Inclusion of the
   <netinet/in.h> header may also make visible all symbols from
   <arpa/inet.h>.

   - POSIX

2. Define IN6_IS_ADDR_LOOPBACK() and IN6_IS_ADDR_V4MAPPED()
2021-08-22 10:29:06 +02:00
Peter Elliott
f16aba405f LibC: Add LINK_MAX and _PC_LINK_MAX
LINK_MAX was set arbitrarily to 4096, this is not an actual system
limit.
2021-08-22 10:29:06 +02:00
Peter Elliott
d9ecb3ecfa LibC: Modify fd_set to be compatible with X/OPEN
For some reason X/OPEN requires that fd_set has a field fds_bits. Xproto
requires either fds_bits or _fds_bits to be present, so the field 'bits'
was renamed 'fds_bits'
2021-08-22 10:29:06 +02:00
Itamar
6f4324e64e Meta: Add 'copy-src' command to serenity.sh
This command copies the project's source tree to
/home/anon/Source/serenity in the built disk image.

This will be useful for working on serenity inside serenity :^)
2021-08-22 10:28:13 +02:00
Karol Kosek
f6f429bfbc Base: Add csv file association 2021-08-22 10:37:20 +04:30
Andreas Kling
c922a7da09 Kernel: Rename ScopedSpinlock => SpinlockLocker
This matches MutexLocker, and doesn't sound like it's a lock itself.
2021-08-22 03:34:10 +02:00
Andreas Kling
55adace359 Kernel: Rename SpinLock => Spinlock 2021-08-22 03:34:10 +02:00
Andreas Kling
7d5d26b048 Kernel: Simplify SpinLockProtected<T>
Same treatment as MutexProtected<T>: inheritance and helper class is
removed, SpinLockProtected now holds a T and a SpinLock.
2021-08-22 03:34:09 +02:00
Andreas Kling
ed6f84c2c9 Kernel: Rename SpinLockProtectedValue<T> => SpinLockProtected<T> 2021-08-22 03:34:09 +02:00
Andreas Kling
532ffa7ddb Kernel: Simplify MutexProtected<T>
This patch removes the MutexContendedResource<T> helper class,
and MutexProtected<T> no longer inherits from T.
Instead, MutexProtected<T> simply has a T and a Mutex.

The LockedResource<T, LockMode> helper class is made a private nested
class in MutexProtected.
2021-08-22 03:34:09 +02:00
Andreas Kling
c2fc33becd Kernel: Rename ProtectedValue<T> => MutexProtected<T>
Let's make it obvious what we're protecting it with.
2021-08-22 03:34:09 +02:00
Andreas Kling
81d990b551 Kernel: Remove some unused classes from Kernel/Locking/ 2021-08-22 03:34:09 +02:00
Ralf Donau
60a4da8e20 Utilities: Use File.error_string() instead of perror(3) in cpp-* 2021-08-22 02:01:58 +02:00
networkException
d51072629d ThemeEditor: Add Actions to save preview_palette to theme file
This patch adds a save and save as Action to the file menu allowing
to export all colors into an ini file.
2021-08-22 01:32:25 +02:00
networkException
acde7d12b0 Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system
configs more inline with the regular ConfigFile::open functions.
2021-08-22 01:32:25 +02:00