mp-solaris.cpp revision b733caa403cbfbbcad164a0b2cb8ffe15e7fbdd1
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IPRT - Multiprocessor, Solaris.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
45e9809aff7304721fddb95654901b32195c9c7avboxsync * available from http://www.virtualbox.org. This file is free software;
45e9809aff7304721fddb95654901b32195c9c7avboxsync * you can redistribute it and/or modify it under the terms of the GNU
45e9809aff7304721fddb95654901b32195c9c7avboxsync * General Public License (GPL) as published by the Free Software
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The contents of this file may alternatively be used under the terms
45e9809aff7304721fddb95654901b32195c9c7avboxsync * of the Common Development and Distribution License Version 1.0
45e9809aff7304721fddb95654901b32195c9c7avboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * VirtualBox OSE distribution, in which case the provisions of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * CDDL are applicable instead of those of the GPL.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * You may elect to license modified versions of this file under the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * terms and conditions of either the GPL or the CDDL or both.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
45e9809aff7304721fddb95654901b32195c9c7avboxsync * additional information or have any questions.
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*******************************************************************************
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Header Files *
45e9809aff7304721fddb95654901b32195c9c7avboxsync*******************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*******************************************************************************
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Global Variables *
45e9809aff7304721fddb95654901b32195c9c7avboxsync*******************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/** Initialization serializing (rtMpSolarisOnce). */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/** Critical section serializing access to kstat. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/** The kstat handle. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/** Array pointing to the cpu_info instances. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/** The number of entries in g_papCpuInfo */
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Run once function that initializes the kstats we need here.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * @returns IPRT status code.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * @param pvUser1 Unused.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * @param pvUser2 Unused.
if (g_pKsCtl)
if (g_papCpuInfo)
RTCPUID i = 0;
return VINF_SUCCESS;
return rc;
if (pStat)
return u64;
if (cCpus < 0)
return cCpus;
while (idCpu-- > 0)
return pSet;
return pSet;
#ifdef RT_STRICT
long cCpusPresent = 0;
#ifdef RT_STRICT
cCpusPresent++;
return pSet;