GIMMinimal.cpp revision b1ac43a82a2e4114bc44feb83007a10c99077085
/* $Id$ */
/** @file
* GIM - Guest Interface Manager, Minimal implementation.
*/
/*
* Copyright (C) 2014-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMInternal.h"
#include <iprt/asm-amd64-x86.h>
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/**
* Initializes the Minimal provider.
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
*/
{
/*
* Enable the Hypervisor Present.
*/
return VINF_SUCCESS;
}
/**
* Initializes remaining bits of the Minimal provider.
* This is called after initializing HM and almost all other VMM components.
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
*/
{
/*
* Expose a generic hypervisor-agnostic leaf (originally defined VMware).
* The leaves range from 0x40000010 to 0x400000FF.
*
* This is done in the init. completed routine as we need PDM to be
* initialized (otherwise PDMApicGetTimerFreq() would fail).
*/
if (RT_SUCCESS(rc))
{
/*
* Insert missing zero leaves (you never know what missing leaves are
* going to return when read).
*/
{
if (RT_FAILURE(rc))
{
}
}
/*
* Add the timing information hypervisor leaf.
* MacOS X uses this to determine the TSC, bus frequency. See @bugref{7270}.
*
* EAX - TSC frequency in KHz.
* EBX - APIC frequency in KHz.
* ECX, EDX - Reserved.
*/
}
else
LogRel(("GIM: Minimal: failed to get hypervisor leaf 0x40000000.\n"));
return VINF_SUCCESS;
}
/**
* Applies relocations to data and code managed by this component.
*
* This function will be called at init and whenever the VMM need to relocate
* itself inside the GC.
*
* @param pVM Pointer to the VM.
* @param offDelta Relocation delta relative to old location.
*/
{
}