Andreas Kling
af8c74a328
Kernel: Make SharedInodeVMObject allocation OOM-safe
2021-07-11 17:52:07 +02:00
Andreas Kling
59049ae4b7
Kernel: Store VMObject physical pages in a FixedArray
...
Let's enforce the invariant that VMObjects don't shrink or grow by
storing the pages in a FixedArray.
2021-07-11 17:42:31 +02:00
Andreas Kling
373b8d7cfa
AK: Add FixedArray::span()
2021-07-11 17:42:31 +02:00
Andreas Kling
7d096a1287
Kernel: Make VMObject vend physical page range as a span
...
Stop exposing the internal data structure used for storing the physical
pages and return a Span<RefPtr<PhysicalPage>> instead.
2021-07-11 17:42:31 +02:00
Andreas Kling
88c8451973
AK: Bring back FixedArray<T>
...
Let's bring this class back, but without the confusing resize() API.
A FixedArray<T> is simply a fixed-size array of T.
The size is provided at run-time, unlike Array<T> where the size is
provided at compile-time.
2021-07-11 17:42:31 +02:00
Andreas Kling
846685fca2
Kernel: Remove bogus VMObject resizing in VirtIOGPU
...
It is not legal to resize a VMObject after it has been created.
As far as I can tell, this code would never actually run since the
object was already populated with physical pages due to using
AllocationStrategy::AllocateNow.
2021-07-11 17:42:31 +02:00
Andreas Kling
055726ecf5
Kernel: Remove unused MemoryManager::find_region_from_vaddr()
2021-07-11 17:42:31 +02:00
Hendiadyoin1
a8d86cc533
DynamicLoader+LibC: Make _start a naked function
2021-07-11 17:07:20 +02:00
Andreas Kling
112c7f9a5b
Kernel: Remove unused MemoryManager::m_physical_page_entries_free
2021-07-11 15:15:57 +02:00
Andreas Kling
5087b2b32f
AK: Don't forget to kfree_sized() in ByteBuffer
2021-07-11 15:15:57 +02:00
Andreas Kling
0afccb560b
Kernel: Remove some duplicate forward declarations
2021-07-11 15:15:57 +02:00
Andreas Kling
b2cd9b2c88
Kernel: Remove pointless ref-counting from PhysicalRegion
...
These are not multiple-owner objects and have no use for ref-counting.
Make them simple value types instead (not eternal heap-allocated.)
2021-07-11 15:15:57 +02:00
Max Wipfli
29d53cbee2
Kernel: Return correct error numbers for the mkdir syscall
...
Previously, VirtualFileSystem::mkdir() would always return ENOENT if
no parent custody was returned by resolve_path(). This is incorrect when
e.g. the user has no search permission in a component of the path
prefix (=> EACCES), or if on component of the path prefix is a file (=>
ENOTDIR). This patch fixes that behavior.
2021-07-11 14:59:57 +02:00
Andreas Kling
25e850ebb1
Kernel: Remove krealloc()
...
This was only used by a single class (AK::ByteBuffer) in the kernel
and not in an OOM-safe way.
Now that ByteBuffer no longer uses it, there's no need for the kernel
heap to burden itself with supporting this.
2021-07-11 14:14:51 +02:00
Andreas Kling
966880eb45
AK: Don't use realloc() in AK::ByteBuffer
...
This class is the only reason we have to support krealloc() in the
kernel heap, something which adds a lot of complexity.
Let's move towards a simpler path and do malloc+memset in the
ByteBuffer code (where we know the sizes anyway.)
2021-07-11 14:14:51 +02:00
Andreas Kling
0718bd264c
Kernel: Remove some no-longer-needed C library functions
...
Now that we no longer demangle symbols in the kernel, we don't need to
provide stuff like malloc(), memchr(), free(), etc to the demangler.
2021-07-11 14:14:51 +02:00
Andreas Kling
f684742f15
Kernel: VERIFY_NOT_REACHED in un-sized operator delete
...
All deletes in kernel code should now be of known size. :^)
2021-07-11 14:14:51 +02:00
Andreas Kling
43d7a7f274
Kernel: Use kfree_sized() in KString
2021-07-11 14:14:51 +02:00
Andreas Kling
c1e902acd9
AK: Use kfree_sized() in AK::Vector
2021-07-11 14:14:51 +02:00
Andreas Kling
c68c3fa69c
AK: Use kfree_sized() in AK::StringImpl
2021-07-11 14:14:51 +02:00
Andreas Kling
3aabace9f5
AK: Use kfree_sized() in AK::HashTable
2021-07-11 14:14:51 +02:00
Andreas Kling
05a00c3978
AK: Use kfree_sized() in AK::ByteBuffer
2021-07-11 14:14:51 +02:00
Andreas Kling
6950dd220b
AK: Use kfree_sized() in AK::Bitmap
2021-07-11 14:14:51 +02:00
Andreas Kling
875afb35c3
AK: Make kfree_sized() forward to kfree() in non-kernel code for now
2021-07-11 14:14:51 +02:00
Andreas Kling
d38b4e4665
Kernel: Add kfree_sized(), kfree() with a known allocation size
...
C++14 gave us sized operator delete, but we haven't been taking
advantage of it. Let's get to a point where it can help us by
adding kfree_sized(void*, size_t).
2021-07-11 14:14:51 +02:00
Andreas Kling
98080497d2
Kernel: Use Forward.h headers more
2021-07-11 14:14:51 +02:00
Adam Hodgen
47bfd366a8
LibWeb: Fix syntax for Table test
...
The parser fixes this by inserting the <tr> tags, but for this test it's
better to have perfect syntax - we're not testing the parser here.
2021-07-11 14:14:01 +02:00
Adam Hodgen
3e46e8fea8
LibWeb: Fix HTMLTable Element attributes
...
`Element::tag_name` return an uppercase version of the tag name. However
the `Web::HTML::TagNames` values are all lowercase.
This change fixes that using `Element::local_name`, which returns a
lowercase value.
2021-07-11 14:14:01 +02:00
LuK1337
99013ac3d5
LibTTF: Port width calculation changes from BitmapFont
2021-07-11 14:12:59 +02:00
LuK1337
c0f9adabd6
LibGfx: Try to get TTF font when query is not in name->font map
...
This change allows us to select TTF fonts in display settings again :^)
2021-07-11 14:12:47 +02:00
Timothy
c03353e7ca
TextEditor: Show an error message when opening a file failed
2021-07-11 14:11:53 +02:00
Gunnar Beutner
71840c1bf4
TextEditor: Open files with ReadOnly when we're just reading them
2021-07-11 14:11:53 +02:00
Gunnar Beutner
c343e9a4fd
TextEditor: Avoid calling realpath()
...
We can't use realpath() at that point because we've already called
unveil(nullptr, nullptr).
2021-07-11 14:11:53 +02:00
Karol Kosek
a90c484d4b
Pong: Only paint areas that needs to be updated
2021-07-11 14:11:26 +02:00
Max Wipfli
9ab528ff5c
Kernel: Make KLexicalPath::basename() more compliant
...
This removes some assertions from KLexicalPath::basename() by supporting
paths with trailing slashes, empty paths, paths consisting of only
slashes and paths with ending "." and ".." segments.
2021-07-11 14:10:58 +02:00
Adam Hodgen
a3638639a1
TextEditor: Show an error dialog when failing to open/save a file
2021-07-11 09:46:50 +02:00
Adam Hodgen
643ecfee73
FileSystemAccessServer: Return user_picked_value even on error
...
If a user picks a file which can't be opened for some reason, we should
still return the value, so client applications can report the error
along with the chosen filepath.
2021-07-11 09:46:50 +02:00
Andreas Kling
c9f6786e8b
Kernel: Make various T::class_name() and similar return StringView
...
Instead of returning char const*, we can also give you a StringView.
2021-07-11 01:46:59 +02:00
Andreas Kling
fa9111ac46
Kernel: Rename ProcFSComponentsRegistrar => ProcFSComponentRegistry
...
This matches the formatting used in SysFS.
2021-07-11 01:40:26 +02:00
Andreas Kling
c1143e1bae
Kernel: Remove friend classes from ProcFSComponentsRegistrar
2021-07-11 01:39:51 +02:00
Andreas Kling
358a7cc448
Kernel: Rename SysFS related classes in BIOS code
...
Give them names that sound related to SysFS.
2021-07-11 01:38:01 +02:00
Andreas Kling
84ae2b6f00
Kernel: Use nested namespace declarations in ACPI code
2021-07-11 01:36:30 +02:00
Andreas Kling
b1c68dd235
Kernel: Rename SysFS related classes in ACPI code
...
Give them names that sound related to SysFS.
2021-07-11 01:35:17 +02:00
Andreas Kling
805319ed30
Kernel: Replace "Folder" => "Directory" everywhere
...
Folders are a GUI concept, file systems have directories. :^)
2021-07-11 01:33:40 +02:00
Andreas Kling
5ec3f5433e
Kernel: Rename SysFS related classes in PCI code
...
Give them names that sound related to SysFS.
2021-07-11 01:31:48 +02:00
Andreas Kling
c74b3a310f
Kernel: Remove pointless lock/unlock in SysFS constructor
2021-07-11 01:18:20 +02:00
Andreas Kling
a9decf5aa6
Kernel: Remove all friend declarations from SysFSComponentRegistry
...
Let them access the class using public API instead.
2021-07-11 01:17:57 +02:00
Andreas Kling
d40ea1a0a8
Kernel: Move SystemExposed.* => FileSystem/SysFSComponent.*
2021-07-11 01:14:53 +02:00
Andreas Kling
807aadbe6e
Kernel: Remove some dead code and unused includes in SysFS files
2021-07-11 01:13:24 +02:00
Andreas Kling
98acebf56b
Kernel: Move SysFS forward declarations to FileSystem/Forward.h
2021-07-11 01:09:48 +02:00