From 2b04d8ab318733b3eb6d66dc5bb25e441fbca3c1 Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Fri, 6 Dec 2013 03:25:19 +0100 Subject: [PATCH] x86/paging: Use CPUSet instead of cpu_mask_t --- headers/private/kernel/smp.h | 2 -- .../x86/paging/x86_physical_page_mapper_large_memory.cpp | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/headers/private/kernel/smp.h b/headers/private/kernel/smp.h index 0452592abb..0085767ee5 100644 --- a/headers/private/kernel/smp.h +++ b/headers/private/kernel/smp.h @@ -40,8 +40,6 @@ enum { SMP_MSG_FLAG_FREE_ARG = 0x2, }; -typedef uint32 cpu_mask_t; - typedef void (*smp_call_func)(addr_t data1, int32 currentCPU, addr_t data2, addr_t data3); class CPUSet { diff --git a/src/system/kernel/arch/x86/paging/x86_physical_page_mapper_large_memory.cpp b/src/system/kernel/arch/x86/paging/x86_physical_page_mapper_large_memory.cpp index 0b75b14dc4..78301a7d4a 100644 --- a/src/system/kernel/arch/x86/paging/x86_physical_page_mapper_large_memory.cpp +++ b/src/system/kernel/arch/x86/paging/x86_physical_page_mapper_large_memory.cpp @@ -105,7 +105,7 @@ private: struct page_slot { PhysicalPageSlot* slot; phys_addr_t physicalAddress; - cpu_mask_t valid; + CPUSet valid; }; page_slot fSlots[SLOTS_PER_TRANSLATION_MAP]; @@ -389,10 +389,10 @@ LargeMemoryTranslationMapPhysicalPageMapper::GetPageTableAt( page_slot& slot = fSlots[i]; if (slot.physicalAddress == physicalAddress) { fNextSlot = (i + 1) & (fSlotCount - 1); - if ((slot.valid & (1 << currentCPU)) == 0) { + if (!slot.valid.GetBit(currentCPU)) { // not valid on this CPU -- invalidate the TLB entry invalidate_TLB(slot.slot->address); - slot.valid |= 1 << currentCPU; + slot.valid.SetBit(currentCPU); } return (void*)slot.slot->address; } @@ -404,7 +404,8 @@ LargeMemoryTranslationMapPhysicalPageMapper::GetPageTableAt( slot.physicalAddress = physicalAddress; slot.slot->Map(physicalAddress); - slot.valid = 1 << currentCPU; + slot.valid.ClearAll(); + slot.valid.SetBit(currentCPU); return (void*)slot.slot->address; }