mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
Kernel: Use InterruptsState in Spinlock code
This commit updates the lock function from Spinlock and RecursiveSpinlock to return the InterruptsState of the processor, instead of the processor flags. The unlock functions would only look at the interrupt flag of the processor flags, so we now use the InterruptsState enum to clarify the intent, and such that we can use the same Spinlock code for the aarch64 build. To not break the build, all the call sites are updated aswell.
This commit is contained in:
committed by
Andreas Kling
parent
6432f3eee8
commit
e8aff0c1c8
@@ -1082,7 +1082,7 @@ u8* MemoryManager::quickmap_page(PhysicalAddress const& physical_address)
|
||||
{
|
||||
VERIFY_INTERRUPTS_DISABLED();
|
||||
auto& mm_data = get_data();
|
||||
mm_data.m_quickmap_prev_flags = mm_data.m_quickmap_in_use.lock();
|
||||
mm_data.m_quickmap_previous_interrupts_state = mm_data.m_quickmap_in_use.lock();
|
||||
|
||||
VirtualAddress vaddr(KERNEL_QUICKMAP_PER_CPU_BASE + Processor::current_id() * PAGE_SIZE);
|
||||
u32 pte_idx = (vaddr.get() - KERNEL_PT1024_BASE) / PAGE_SIZE;
|
||||
@@ -1108,7 +1108,7 @@ void MemoryManager::unquickmap_page()
|
||||
auto& pte = ((PageTableEntry*)boot_pd_kernel_pt1023)[pte_idx];
|
||||
pte.clear();
|
||||
flush_tlb_local(vaddr);
|
||||
mm_data.m_quickmap_in_use.unlock(mm_data.m_quickmap_prev_flags);
|
||||
mm_data.m_quickmap_in_use.unlock(mm_data.m_quickmap_previous_interrupts_state);
|
||||
}
|
||||
|
||||
bool MemoryManager::validate_user_stack(AddressSpace& space, VirtualAddress vaddr) const
|
||||
|
||||
Reference in New Issue
Block a user