c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync/* $Id$ */
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync/** @file
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * IPRT - Multiprocessor, Generic RTMpGetDescription stub.
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync */
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync/*
ac76755aa3b8483a71b7e52674eaf3432cbda053vboxsync * Copyright (C) 2009-2014 Oracle Corporation
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync *
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * available from http://www.virtualbox.org. This file is free software;
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * you can redistribute it and/or modify it under the terms of the GNU
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * General Public License (GPL) as published by the Free Software
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync *
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * The contents of this file may alternatively be used under the terms
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * of the Common Development and Distribution License Version 1.0
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * VirtualBox OSE distribution, in which case the provisions of the
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * CDDL are applicable instead of those of the GPL.
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync *
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * You may elect to license modified versions of this file under the
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * terms and conditions of either the GPL or the CDDL or both.
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync */
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync/*******************************************************************************
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync* Header Files *
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync*******************************************************************************/
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync#include <iprt/mp.h>
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync#include "internal/iprt.h"
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync#include <iprt/string.h>
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsyncRTDECL(int) RTMpGetDescription(RTCPUID idCpu, char *pszBuf, size_t cbBuf)
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync{
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync static const char s_szUnknown[] = "Unknown";
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync
ac76755aa3b8483a71b7e52674eaf3432cbda053vboxsync if (idCpu != NIL_RTCPUID && !RTMpIsCpuOnline(idCpu))
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync return RTMpIsCpuPossible(idCpu)
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync ? VERR_CPU_OFFLINE
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync : VERR_CPU_NOT_FOUND;
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync if (cbBuf < sizeof(s_szUnknown))
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync return VERR_BUFFER_OVERFLOW;
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync memcpy(pszBuf, s_szUnknown, sizeof(s_szUnknown));
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync return VINF_SUCCESS;
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync}
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsyncRT_EXPORT_SYMBOL(RTMpGetDescription);
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync