5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync/* $Id$ */
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync/** @file
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * IPRT - Multiprocessor, Generic RTMpCpuId.
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync */
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync/*
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2008-2010 Oracle Corporation
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync *
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * available from http://www.virtualbox.org. This file is free software;
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * General Public License (GPL) as published by the Free Software
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync *
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * The contents of this file may alternatively be used under the terms
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * of the Common Development and Distribution License Version 1.0
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * VirtualBox OSE distribution, in which case the provisions of the
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * CDDL are applicable instead of those of the GPL.
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync *
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * You may elect to license modified versions of this file under the
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync * terms and conditions of either the GPL or the CDDL or both.
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync */
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync/*******************************************************************************
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync* Header Files *
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync*******************************************************************************/
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync#include <iprt/mp.h>
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync#include "internal/iprt.h"
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync#include <iprt/asm.h>
f737cdef9a611a3ebe4cfd6da04c42ede272344cvboxsync#include <iprt/asm-amd64-x86.h>
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsyncRTDECL(RTCPUID) RTMpCpuId(void)
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync{
6d5bb586830857ecd05ff82ef8d2545034bd0835vboxsync#if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) || defined(RT_ARCH_SPARC) || defined(RT_ARCH_SPARC64)
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync return ASMGetApicId();
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync#else
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync# error "Not ported to this architecture."
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync return NIL_RTAPICID;
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync#endif
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync}
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsyncRT_EXPORT_SYMBOL(RTMpCpuId);
5e91fc5e5ea9cccb7a40636f73253d489fbe340bvboxsync