kernel: Use SMP_MAX_CPUS instead of B_MAX_CPU_COUNT

This commit is contained in:
Pawel Dziepak
2013-12-06 19:53:56 +01:00
parent 3e0e3be760
commit e6ea745e81
9 changed files with 15 additions and 15 deletions
@@ -28,7 +28,7 @@
#include "interrupts.h" #include "interrupts.h"
static interrupt_descriptor* sIDTs[B_MAX_CPU_COUNT]; static interrupt_descriptor* sIDTs[SMP_MAX_CPUS];
// table with functions handling respective interrupts // table with functions handling respective interrupts
typedef void interrupt_handler_function(struct iframe* frame); typedef void interrupt_handler_function(struct iframe* frame);
+2 -2
View File
@@ -34,8 +34,8 @@
#endif #endif
static uint32 sCPUAPICIds[B_MAX_CPU_COUNT]; static uint32 sCPUAPICIds[SMP_MAX_CPUS];
static uint32 sAPICVersions[B_MAX_CPU_COUNT]; static uint32 sAPICVersions[SMP_MAX_CPUS];
static int32 static int32
@@ -168,7 +168,7 @@ private:
PhysicalPageSlot* fDebugSlot; PhysicalPageSlot* fDebugSlot;
PhysicalPageSlotPool* fInitialPool; PhysicalPageSlotPool* fInitialPool;
LargeMemoryTranslationMapPhysicalPageMapper fKernelMapper; LargeMemoryTranslationMapPhysicalPageMapper fKernelMapper;
PhysicalPageOpsCPUData fPerCPUData[B_MAX_CPU_COUNT]; PhysicalPageOpsCPUData fPerCPUData[SMP_MAX_CPUS];
}; };
static LargeMemoryPhysicalPageMapper sPhysicalPageMapper; static LargeMemoryPhysicalPageMapper sPhysicalPageMapper;
+2 -2
View File
@@ -81,7 +81,7 @@ void call_modules_hook(bool enter);
static void syslog_write(const char* text, int32 length, bool notify); static void syslog_write(const char* text, int32 length, bool notify);
static arch_debug_registers sDebugRegisters[B_MAX_CPU_COUNT]; static arch_debug_registers sDebugRegisters[SMP_MAX_CPUS];
static debug_page_fault_info sPageFaultInfo; static debug_page_fault_info sPageFaultInfo;
@@ -143,7 +143,7 @@ static int32 sInDebugger = 0;
static bool sPreviousDprintfState; static bool sPreviousDprintfState;
static volatile bool sHandOverKDL = false; static volatile bool sHandOverKDL = false;
static int32 sHandOverKDLToCPU = -1; static int32 sHandOverKDLToCPU = -1;
static bool sCPUTrapped[B_MAX_CPU_COUNT]; static bool sCPUTrapped[SMP_MAX_CPUS];
#define distance(a, b) ((a) < (b) ? (b) - (a) : (a) - (b)) #define distance(a, b) ((a) < (b) ? (b) - (a) : (a) - (b))
+2 -2
View File
@@ -199,8 +199,8 @@ private:
bool fWaitObjectNotificationsRequested; bool fWaitObjectNotificationsRequested;
Thread* volatile fWaitingProfilerThread; Thread* volatile fWaitingProfilerThread;
bool fProfilingActive; bool fProfilingActive;
bool fReentered[B_MAX_CPU_COUNT]; bool fReentered[SMP_MAX_CPUS];
CPUProfileData fCPUData[B_MAX_CPU_COUNT]; CPUProfileData fCPUData[SMP_MAX_CPUS];
WaitObject* fWaitObjectBuffer; WaitObject* fWaitObjectBuffer;
int32 fWaitObjectCount; int32 fWaitObjectCount;
WaitObjectList fUsedWaitObjects; WaitObjectList fUsedWaitObjects;
+1 -1
View File
@@ -53,7 +53,7 @@
static port_id sDefaultDebuggerPort = -1; static port_id sDefaultDebuggerPort = -1;
// accessed atomically // accessed atomically
static timer sProfilingTimers[B_MAX_CPU_COUNT]; static timer sProfilingTimers[SMP_MAX_CPUS];
// a profiling timer for each CPU -- used when a profiled thread is running // a profiling timer for each CPU -- used when a profiled thread is running
// on that CPU // on that CPU
+3 -3
View File
@@ -187,9 +187,9 @@ static const heap_class sHeapClasses[HEAP_CLASS_COUNT] = {
static uint32 sHeapCount; static uint32 sHeapCount;
static heap_allocator *sHeaps[HEAP_CLASS_COUNT * B_MAX_CPU_COUNT]; static heap_allocator *sHeaps[HEAP_CLASS_COUNT * SMP_MAX_CPUS];
static uint32 *sLastGrowRequest[HEAP_CLASS_COUNT * B_MAX_CPU_COUNT]; static uint32 *sLastGrowRequest[HEAP_CLASS_COUNT * SMP_MAX_CPUS];
static uint32 *sLastHandledGrowRequest[HEAP_CLASS_COUNT * B_MAX_CPU_COUNT]; static uint32 *sLastHandledGrowRequest[HEAP_CLASS_COUNT * SMP_MAX_CPUS];
static heap_allocator *sVIPHeap; static heap_allocator *sVIPHeap;
static heap_allocator *sGrowHeap = NULL; static heap_allocator *sGrowHeap = NULL;
+1 -1
View File
@@ -70,7 +70,7 @@ typedef BKernel::TeamThreadTable<Thread> ThreadHashTable;
// thread list // thread list
static Thread sIdleThreads[B_MAX_CPU_COUNT]; static Thread sIdleThreads[SMP_MAX_CPUS];
static ThreadHashTable sThreadHash; static ThreadHashTable sThreadHash;
static spinlock sThreadHashLock = B_SPINLOCK_INITIALIZER; static spinlock sThreadHashLock = B_SPINLOCK_INITIALIZER;
static thread_id sNextThreadID = 2; static thread_id sNextThreadID = 2;
+2 -2
View File
@@ -33,7 +33,7 @@ struct per_cpu_timer_data {
bigtime_t real_time_offset; bigtime_t real_time_offset;
}; };
static per_cpu_timer_data sPerCPU[B_MAX_CPU_COUNT]; static per_cpu_timer_data sPerCPU[SMP_MAX_CPUS];
//#define TRACE_TIMER //#define TRACE_TIMER
@@ -383,7 +383,7 @@ cancel_timer(timer* event)
int cpu = event->cpu; int cpu = event->cpu;
SpinLocker spinLocker; SpinLocker spinLocker;
while (true) { while (true) {
if (cpu >= B_MAX_CPU_COUNT) if (cpu >= SMP_MAX_CPUS)
return false; return false;
spinLocker.SetTo(sPerCPU[cpu].lock, false); spinLocker.SetTo(sPerCPU[cpu].lock, false);