Kernel: Wrap process address spaces in SpinlockProtected

This forces anyone who wants to look into and/or manipulate an address
space to lock it. And this replaces the previous, more flimsy, manual
spinlock use.

Note that pointers *into* the address space are not safe to use after
you unlock the space. We've got many issues like this, and we'll have
to track those down as wlel.
This commit is contained in:
Andreas Kling 2022-08-23 17:58:05 +02:00
commit cf16b2c8e6
Notes: sideshowbarker 2024-07-17 07:48:58 +09:00
38 changed files with 708 additions and 627 deletions

View file

@ -32,13 +32,13 @@ DisplayConnector::DisplayConnector(size_t framebuffer_resource_size, bool enable
{
}
ErrorOr<Memory::Region*> DisplayConnector::mmap(Process& process, OpenFileDescription&, Memory::VirtualRange const& range, u64 offset, int prot, bool shared)
ErrorOr<Memory::Region*> DisplayConnector::mmap(Process&, Memory::AddressSpace& address_space, OpenFileDescription&, Memory::VirtualRange const& range, u64 offset, int prot, bool shared)
{
VERIFY(m_shared_framebuffer_vmobject);
if (offset != 0)
return Error::from_errno(ENOTSUP);
return process.address_space().allocate_region_with_vmobject(
return address_space.allocate_region_with_vmobject(
range,
*m_shared_framebuffer_vmobject,
0,