mp-solaris.cpp revision 537680a235921a9a53f5040185a15cdcf228c217
537680a235921a9a53f5040185a15cdcf228c217vboxsync * IPRT - Multiprocessor, Solaris.
537680a235921a9a53f5040185a15cdcf228c217vboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
537680a235921a9a53f5040185a15cdcf228c217vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
537680a235921a9a53f5040185a15cdcf228c217vboxsync * available from http://www.virtualbox.org. This file is free software;
537680a235921a9a53f5040185a15cdcf228c217vboxsync * you can redistribute it and/or modify it under the terms of the GNU
537680a235921a9a53f5040185a15cdcf228c217vboxsync * General Public License (GPL) as published by the Free Software
537680a235921a9a53f5040185a15cdcf228c217vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
537680a235921a9a53f5040185a15cdcf228c217vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
537680a235921a9a53f5040185a15cdcf228c217vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
537680a235921a9a53f5040185a15cdcf228c217vboxsync * The contents of this file may alternatively be used under the terms
537680a235921a9a53f5040185a15cdcf228c217vboxsync * of the Common Development and Distribution License Version 1.0
537680a235921a9a53f5040185a15cdcf228c217vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
537680a235921a9a53f5040185a15cdcf228c217vboxsync * VirtualBox OSE distribution, in which case the provisions of the
537680a235921a9a53f5040185a15cdcf228c217vboxsync * CDDL are applicable instead of those of the GPL.
537680a235921a9a53f5040185a15cdcf228c217vboxsync * You may elect to license modified versions of this file under the
537680a235921a9a53f5040185a15cdcf228c217vboxsync * terms and conditions of either the GPL or the CDDL or both.
537680a235921a9a53f5040185a15cdcf228c217vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
537680a235921a9a53f5040185a15cdcf228c217vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
537680a235921a9a53f5040185a15cdcf228c217vboxsync * additional information or have any questions.
537680a235921a9a53f5040185a15cdcf228c217vboxsync/*******************************************************************************
537680a235921a9a53f5040185a15cdcf228c217vboxsync* Header Files *
537680a235921a9a53f5040185a15cdcf228c217vboxsync*******************************************************************************/
537680a235921a9a53f5040185a15cdcf228c217vboxsync g_cpuInfo = (kstat_t**)RTMemAlloc(g_nCPUs * sizeof(kstat_t*));
537680a235921a9a53f5040185a15cdcf228c217vboxsync for (ksp = g_kc->kc_chain; ksp != NULL; ksp = ksp->ks_next)
537680a235921a9a53f5040185a15cdcf228c217vboxsyncstatic uint64_t rtMpGetFrequency(RTCPUID idCpu, char *statName)
537680a235921a9a53f5040185a15cdcf228c217vboxsync kn = (kstat_named_t *)kstat_data_lookup(g_cpuInfo[idCpu], statName);
537680a235921a9a53f5040185a15cdcf228c217vboxsync Log(("kstat_data_lookup(%s) -> %d\n", statName, errno));
537680a235921a9a53f5040185a15cdcf228c217vboxsync return rtMpGetFrequency(idCpu, "current_clock_Hz") / 1000000;