[haiku-commits] BRANCH pdziepak-github.scheduler [fa6788d] src/system/kernel/arch/x86/paging headers/private/kernel src/system/kernel/util

  • From: pdziepak-github.scheduler <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 6 Dec 2013 03:45:32 +0100 (CET)

added 4 changesets to branch 'refs/remotes/pdziepak-github/scheduler'
old head: 8139385006983b8eff05ae4faef119fc5418d359
new head: fa6788d85d72f3f4da2873e749b46be13c7fc33a
overview: https://github.com/pdziepak/Haiku/compare/8139385...fa6788d

----------------------------------------------------------------------------

b1b46d9: kernel/util: Bitmap: Silence warning

34fbff2: x86/paging: Remove unusued local variable

b886e09: x86/paging: Use CPUSet instead of cpu_mask_t

fa6788d: kernel: Fix gcc2 build

                                    [ Pawel Dziepak <pdziepak@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

4 files changed, 8 insertions(+), 10 deletions(-)
headers/private/kernel/smp.h                                 | 6 ++----
.../kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp    | 1 -
.../x86/paging/x86_physical_page_mapper_large_memory.cpp     | 9 +++++----
src/system/kernel/util/Bitmap.cpp                            | 2 +-

############################################################################

Commit:      b1b46d997e5b424ede1a8e5e804d3ecc579609ce
Author:      Pawel Dziepak <pdziepak@xxxxxxxxxxx>
Date:        Fri Dec  6 02:10:50 2013 UTC

kernel/util: Bitmap: Silence warning

----------------------------------------------------------------------------

diff --git a/src/system/kernel/util/Bitmap.cpp 
b/src/system/kernel/util/Bitmap.cpp
index 588e996..8f47c95 100644
--- a/src/system/kernel/util/Bitmap.cpp
+++ b/src/system/kernel/util/Bitmap.cpp
@@ -60,7 +60,7 @@ Bitmap::GetHighestSet() const
        if (sizeof(addr_t) == sizeof(uint32))
                return log2(fBits[i]) + i * kBitsPerElement;
 
-       uint32 v = fBits[i] >> 32;
+       uint32 v = (uint64)fBits[i] >> 32;
        if (v != 0)
                return log2(v) + sizeof(uint32) * 8 + i * kBitsPerElement;
        return log2(fBits[i]) + i * kBitsPerElement;

############################################################################

Commit:      34fbff243f4f845d952bd5805d1f5d824f7abb25
Author:      Pawel Dziepak <pdziepak@xxxxxxxxxxx>
Date:        Fri Dec  6 02:11:42 2013 UTC

x86/paging: Remove unusued local variable

----------------------------------------------------------------------------

diff --git a/src/system/kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp 
b/src/system/kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp
index 37f5149..e8e0419 100644
--- a/src/system/kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp
+++ b/src/system/kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp
@@ -332,7 +332,6 @@ X86PagingMethod32Bit::InitPostArea(kernel_args* args)
        // now that the vm is initialized, create an area that represents
        // the page hole
        void *temp;
-       status_t error;
        area_id area;
 
        // unmap the page hole hack we were using before

############################################################################

Commit:      b886e09a9872f11de67236b590362a5084fce84d
Author:      Pawel Dziepak <pdziepak@xxxxxxxxxxx>
Date:        Fri Dec  6 02:25:19 2013 UTC

x86/paging: Use CPUSet instead of cpu_mask_t

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/smp.h b/headers/private/kernel/smp.h
index 0452592..0085767 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 0b75b14..78301a7 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;
 }

############################################################################

Commit:      fa6788d85d72f3f4da2873e749b46be13c7fc33a
Author:      Pawel Dziepak <pdziepak@xxxxxxxxxxx>
Date:        Fri Dec  6 02:31:20 2013 UTC

kernel: Fix gcc2 build

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/smp.h b/headers/private/kernel/smp.h
index 0085767..1f4b0f4 100644
--- a/headers/private/kernel/smp.h
+++ b/headers/private/kernel/smp.h
@@ -112,7 +112,7 @@ CPUSet::SetAll()
 inline void
 CPUSet::SetBit(int32 cpu)
 {
-       uint32* element = &fBitmap[cpu % kArraySize];
+       int32* element = (int32*)&fBitmap[cpu % kArraySize];
        atomic_or(element, 1u << (cpu / kArraySize));
 }
 
@@ -120,7 +120,7 @@ CPUSet::SetBit(int32 cpu)
 inline void
 CPUSet::ClearBit(int32 cpu)
 {
-       uint32* element = &fBitmap[cpu % kArraySize];
+       int32* element = (int32*)&fBitmap[cpu % kArraySize];
        atomic_and(element, ~uint32(1u << (cpu / kArraySize)));
 }
 


Other related posts:

  • » [haiku-commits] BRANCH pdziepak-github.scheduler [fa6788d] src/system/kernel/arch/x86/paging headers/private/kernel src/system/kernel/util - pdziepak-github . scheduler