mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:37:47 +00:00
Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace! This was a slightly tedious refactoring that took a long time, so it's not unlikely that some bugs crept in. Nevertheless, it does pass basic functionality testing, and it's just real nice to finally see the same pattern in all contexts. :^)
This commit is contained in:
parent
7ee10c6926
commit
79fa9765ca
262 changed files with 2415 additions and 2600 deletions
|
@ -49,8 +49,8 @@ public:
|
|||
Yes,
|
||||
};
|
||||
|
||||
static KResultOr<NonnullOwnPtr<Region>> try_create_user_accessible(VirtualRange const&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, OwnPtr<KString> name, Region::Access access, Cacheable, bool shared);
|
||||
static KResultOr<NonnullOwnPtr<Region>> try_create_kernel_only(VirtualRange const&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, OwnPtr<KString> name, Region::Access access, Cacheable = Cacheable::Yes);
|
||||
static ErrorOr<NonnullOwnPtr<Region>> try_create_user_accessible(VirtualRange const&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, OwnPtr<KString> name, Region::Access access, Cacheable, bool shared);
|
||||
static ErrorOr<NonnullOwnPtr<Region>> try_create_kernel_only(VirtualRange const&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, OwnPtr<KString> name, Region::Access access, Cacheable = Cacheable::Yes);
|
||||
|
||||
~Region();
|
||||
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
|
||||
PageFaultResponse handle_fault(PageFault const&);
|
||||
|
||||
KResultOr<NonnullOwnPtr<Region>> try_clone();
|
||||
ErrorOr<NonnullOwnPtr<Region>> try_clone();
|
||||
|
||||
[[nodiscard]] bool contains(VirtualAddress vaddr) const
|
||||
{
|
||||
|
@ -170,7 +170,7 @@ public:
|
|||
void set_executable(bool b) { set_access_bit(Access::Execute, b); }
|
||||
|
||||
void set_page_directory(PageDirectory&);
|
||||
KResult map(PageDirectory&, ShouldFlushTLB = ShouldFlushTLB::Yes);
|
||||
ErrorOr<void> map(PageDirectory&, ShouldFlushTLB = ShouldFlushTLB::Yes);
|
||||
enum class ShouldDeallocateVirtualRange {
|
||||
No,
|
||||
Yes,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue