mirror of
https://github.com/RGBCube/serenity
synced 2025-09-14 00:48:00 +00:00
Kernel: Make self-contained locking smart pointers their own classes
Until now, our kernel has reimplemented a number of AK classes to provide automatic internal locking: - RefPtr - NonnullRefPtr - WeakPtr - Weakable This patch renames the Kernel classes so that they can coexist with the original AK classes: - RefPtr => LockRefPtr - NonnullRefPtr => NonnullLockRefPtr - WeakPtr => LockWeakPtr - Weakable => LockWeakable The goal here is to eventually get rid of the Lock* classes in favor of using external locking.
This commit is contained in:
parent
e475263113
commit
11eee67b85
360 changed files with 1703 additions and 1672 deletions
|
@ -45,10 +45,10 @@ SpinlockProtected<Inode::AllInstancesList>& Inode::all_instances()
|
|||
return s_all_instances;
|
||||
}
|
||||
|
||||
RefPtr<Memory::SharedInodeVMObject> Inode::shared_vmobject() const
|
||||
LockRefPtr<Memory::SharedInodeVMObject> Inode::shared_vmobject() const
|
||||
{
|
||||
VERIFY_NOT_REACHED();
|
||||
return RefPtr<Memory::SharedInodeVMObject>(nullptr);
|
||||
return LockRefPtr<Memory::SharedInodeVMObject>(nullptr);
|
||||
}
|
||||
|
||||
void Inode::will_be_destroyed()
|
||||
|
|
|
@ -42,12 +42,12 @@ u8 InterruptManagement::acquire_mapped_interrupt_number(u8 interrupt_number)
|
|||
return interrupt_number;
|
||||
}
|
||||
|
||||
Vector<RefPtr<IRQController>> const& InterruptManagement::controllers()
|
||||
Vector<LockRefPtr<IRQController>> const& InterruptManagement::controllers()
|
||||
{
|
||||
return m_interrupt_controllers;
|
||||
}
|
||||
|
||||
RefPtr<IRQController> InterruptManagement::get_responsible_irq_controller(u8)
|
||||
LockRefPtr<IRQController> InterruptManagement::get_responsible_irq_controller(u8)
|
||||
{
|
||||
// TODO: Support more interrupt controllers
|
||||
VERIFY(m_interrupt_controllers.size() == 1);
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <Kernel/Arch/aarch64/IRQController.h>
|
||||
#include <Kernel/Library/LockRefPtr.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -20,14 +20,14 @@ public:
|
|||
|
||||
static u8 acquire_mapped_interrupt_number(u8 original_irq);
|
||||
|
||||
Vector<RefPtr<IRQController>> const& controllers();
|
||||
RefPtr<IRQController> get_responsible_irq_controller(u8 interrupt_vector);
|
||||
Vector<LockRefPtr<IRQController>> const& controllers();
|
||||
LockRefPtr<IRQController> get_responsible_irq_controller(u8 interrupt_vector);
|
||||
|
||||
private:
|
||||
InterruptManagement() = default;
|
||||
void find_controllers();
|
||||
|
||||
Vector<RefPtr<IRQController>> m_interrupt_controllers;
|
||||
Vector<LockRefPtr<IRQController>> m_interrupt_controllers;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ void PageDirectory::deregister_page_directory(PageDirectory*)
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
RefPtr<PageDirectory> PageDirectory::find_current()
|
||||
LockRefPtr<PageDirectory> PageDirectory::find_current()
|
||||
{
|
||||
VERIFY_NOT_REACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -107,7 +107,7 @@ extern "C" [[noreturn]] void init()
|
|||
|
||||
auto& framebuffer = RPi::Framebuffer::the();
|
||||
if (framebuffer.initialized()) {
|
||||
g_boot_console = &try_make_ref_counted<Graphics::BootFramebufferConsole>(framebuffer.gpu_buffer(), framebuffer.width(), framebuffer.width(), framebuffer.pitch()).value().leak_ref();
|
||||
g_boot_console = &try_make_lock_ref_counted<Graphics::BootFramebufferConsole>(framebuffer.gpu_buffer(), framebuffer.width(), framebuffer.width(), framebuffer.pitch()).value().leak_ref();
|
||||
draw_logo();
|
||||
}
|
||||
dmesgln("Starting SerenityOS...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue