1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +00:00

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
parent d6ef18f587
commit cf16b2c8e6
38 changed files with 708 additions and 627 deletions

View file

@ -558,8 +558,8 @@ public:
PerformanceEventBuffer* perf_events() { return m_perf_event_buffer; }
PerformanceEventBuffer const* perf_events() const { return m_perf_event_buffer; }
Memory::AddressSpace& address_space() { return *m_space; }
Memory::AddressSpace const& address_space() const { return *m_space; }
SpinlockProtected<OwnPtr<Memory::AddressSpace>>& address_space() { return m_space; }
SpinlockProtected<OwnPtr<Memory::AddressSpace>> const& address_space() const { return m_space; }
VirtualAddress signal_trampoline() const
{
@ -656,7 +656,7 @@ private:
NonnullOwnPtr<KString> m_name;
OwnPtr<Memory::AddressSpace> m_space;
SpinlockProtected<OwnPtr<Memory::AddressSpace>> m_space;
LockRefPtr<ProcessGroup> m_pg;