Index: /trunk/include/iprt/mangling.h
===================================================================
--- /trunk/include/iprt/mangling.h	(revision 46638)
+++ /trunk/include/iprt/mangling.h	(revision 46639)
@@ -901,6 +901,8 @@
 # define RTMpGetMaxFrequency                            RT_MANGLER(RTMpGetMaxFrequency)
 # define RTMpGetOnlineCount                             RT_MANGLER(RTMpGetOnlineCount)
+# define RTMpGetOnlineCoreCount                         RT_MANGLER(RTMpGetOnlineCoreCount)
 # define RTMpGetOnlineSet                               RT_MANGLER(RTMpGetOnlineSet)
 # define RTMpGetPresentCount                            RT_MANGLER(RTMpGetPresentCount)
+# define RTMpGetPresentCoreCount                        RT_MANGLER(RTMpGetPresentCoreCount)
 # define RTMpGetPresentSet                              RT_MANGLER(RTMpGetPresentSet)
 # define RTMpGetSet                                     RT_MANGLER(RTMpGetSet)
Index: /trunk/include/iprt/mp.h
===================================================================
--- /trunk/include/iprt/mp.h	(revision 46638)
+++ /trunk/include/iprt/mp.h	(revision 46639)
@@ -141,4 +141,12 @@
 
 /**
+ * Get the count of physical CPU cores in the system with one or more online
+ * threads.
+ *
+ * @returns The number of online cores.
+ */
+RTDECL(RTCPUID) RTMpGetCoreOnlineCount(void);
+
+/**
  * Checks if a CPU is online or not.
  *
@@ -163,4 +171,11 @@
  */
 RTDECL(RTCPUID) RTMpGetPresentCount(void);
+
+/**
+ * Get the count of physical CPU cores present in the system.
+ *
+ * @returns The number of cores.
+ */
+RTDECL(RTCPUID) RTMpGetPresentCoreCount(void);
 
 /**
Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 46638)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 46639)
@@ -732,4 +732,5 @@
 	generic/uuid-generic.cpp \
 	generic/RTMpGetCoreCount-generic.cpp \
+	generic/RTMpGetOnlineCoreCount-generic.cpp \
 	generic/RTMpGetCurFrequency-generic.cpp \
 	generic/RTMpGetMaxFrequency-generic.cpp \
@@ -793,4 +794,5 @@
 	generic/mppresent-generic.cpp \
 	generic/RTMpGetCoreCount-generic.cpp \
+	generic/RTMpGetOnlineCoreCount-generic.cpp \
  	generic/RTSemEventMultiWait-2-ex-generic.cpp \
  	generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \
@@ -867,4 +869,5 @@
 	generic/RTMpCpuId-generic.cpp \
 	generic/RTMpGetCoreCount-generic.cpp \
+	generic/RTMpGetOnlineCoreCount-generic.cpp \
 	generic/RTProcDaemonize-generic.cpp \
 	generic/RTProcIsRunningByName-generic.cpp \
@@ -929,4 +932,5 @@
 	generic/RTUuidCreate-generic.cpp \
 	generic/RTMpGetCoreCount-generic.cpp \
+	generic/RTMpGetOnlineCoreCount-generic.cpp \
 	generic/sched-generic.cpp \
 	generic/utf16locale-generic.cpp \
@@ -1007,4 +1011,5 @@
 	generic/RTThreadGetNativeState-generic.cpp \
 	generic/RTMpGetCoreCount-generic.cpp \
+	generic/RTMpGetOnlineCoreCount-generic.cpp \
 	r3/haiku/rtProcInitExePath-haiku.cpp \
 	r3/haiku/time-haiku.cpp \
Index: /trunk/src/VBox/Runtime/generic/RTMpGetCoreCount-generic.cpp
===================================================================
--- /trunk/src/VBox/Runtime/generic/RTMpGetCoreCount-generic.cpp	(revision 46638)
+++ /trunk/src/VBox/Runtime/generic/RTMpGetCoreCount-generic.cpp	(revision 46639)
@@ -30,5 +30,5 @@
 *******************************************************************************/
 #include <iprt/mp.h>
-#include <internal/iprt.h>
+#include "internal/iprt.h"
 
 
@@ -38,2 +38,3 @@
 }
 RT_EXPORT_SYMBOL(RTMpGetCoreCount);
+
Index: /trunk/src/VBox/Runtime/generic/RTMpGetOnlineCoreCount-generic.cpp
===================================================================
--- /trunk/src/VBox/Runtime/generic/RTMpGetOnlineCoreCount-generic.cpp	(revision 46639)
+++ /trunk/src/VBox/Runtime/generic/RTMpGetOnlineCoreCount-generic.cpp	(revision 46639)
@@ -0,0 +1,40 @@
+/* $Id$ */
+/** @file
+ * IPRT - Multiprocessor, Generic RTMpGetCoreCount.
+ */
+
+/*
+ * Copyright (C) 2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <iprt/mp.h>
+#include "internal/iprt.h"
+
+
+RTDECL(RTCPUID) RTMpGetOnlineCoreCount(void)
+{
+    return RTMpGetOnlineCount();
+}
+RT_EXPORT_SYMBOL(RTMpGetOnlineCoreCount);
+
Index: /trunk/src/VBox/Runtime/generic/mppresent-generic.cpp
===================================================================
--- /trunk/src/VBox/Runtime/generic/mppresent-generic.cpp	(revision 46638)
+++ /trunk/src/VBox/Runtime/generic/mppresent-generic.cpp	(revision 46639)
@@ -47,4 +47,11 @@
 
 
+RTDECL(RTCPUID) RTMpGetPresentCoreCount(void)
+{
+    return RTMpGetCoreCount();
+}
+RT_EXPORT_SYMBOL(RTMpGetPresentCoreCount);
+
+
 RTDECL(bool) RTMpIsCpuPresent(RTCPUID idCpu)
 {
Index: /trunk/src/VBox/Runtime/r3/linux/mp-linux.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/linux/mp-linux.cpp	(revision 46638)
+++ /trunk/src/VBox/Runtime/r3/linux/mp-linux.cpp	(revision 46639)
@@ -34,4 +34,7 @@
 
 #include <iprt/mp.h>
+#include "internal/iprt.h"
+
+#include <iprt/alloca.h>
 #include <iprt/cpuset.h>
 #include <iprt/assert.h>
@@ -180,26 +183,21 @@
 RTDECL(RTCPUID) RTMpGetCoreCount(void)
 {
-    RTCPUID cMax = rtMpLinuxMaxCpus();
-    uint32_t aCores[256];
-    RT_ZERO(aCores);
-    uint32_t cCores = 0;
+    RTCPUID     cMax      = rtMpLinuxMaxCpus();
+    uint32_t   *paidCores = (uint32_t *)alloca(sizeof(*uint32_t) * (cMax + 1));
+    uint32_t    cCores    = 0;
     for (RTCPUID idCpu = 0; idCpu < cMax; idCpu++)
     {
         if (RTMpIsCpuPossible(idCpu))
         {
-            uint32_t idCore =
-                (uint32_t)RTLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/topology/core_id", (int)idCpu);
-            unsigned i;
+            uint32_t idCore = (uint32_t)RTLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/topology/core_id", (int)idCpu);
+            uint32_t i;
             for (i = 0; i < cCores; i++)
-                if (aCores[i] == idCore)
+                if (paidCores[i] == idCore)
                     break;
-            if (   i >= cCores
-                && cCores < RT_ELEMENTS(aCores))
-            {
-                aCores[cCores] = idCore;
-                cCores++;
-            }
-        }
-    }
+            if (i >= cCores)
+                paidCores[cCores++] = idCore;
+        }
+    }
+    Assert(cCores > 0);
     return cCores;
 }
@@ -223,4 +221,28 @@
     return RTCpuSetCount(&Set);
 }
+
+
+RTDECL(RTCPUID) RTMpGetOnlineCoreCount(void)
+{
+    RTCPUID     cMax      = rtMpLinuxMaxCpus();
+    uint32_t   *paidCores = (uint32_t *)alloca(sizeof(*uint32_t) * (cMax + 1));
+    uint32_t    cCores    = 0;
+    for (RTCPUID idCpu = 0; idCpu < cMax; idCpu++)
+    {
+        if (RTMpIsCpuOnline(idCpu))
+        {
+            uint32_t idCore = (uint32_t)RTLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/topology/core_id", (int)idCpu);
+            uint32_t i;
+            for (i = 0; i < cCores; i++)
+                if (paidCores[i] == idCore)
+                    break;
+            if (i >= cCores)
+                paidCores[cCores++] = idCore;
+        }
+    }
+    Assert(cCores > 0);
+    return cCores;
+}
+
 
 
Index: /trunk/src/VBox/Runtime/r3/win/mp-win.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/mp-win.cpp	(revision 46638)
+++ /trunk/src/VBox/Runtime/r3/win/mp-win.cpp	(revision 46639)
@@ -166,2 +166,9 @@
 }
 
+
+RTDECL(RTCPUID) RTMpGetOnlineCoreCount(void)
+{
+    /** @todo this isn't entirely correct. */
+    return RTMpGetCoreCount();
+}
+
