VBoxAcpi.cpp revision eb90548e8e40e597d65cdcc16ec958a3e09c1d73
/* $Id$ */
/** @file
* VBoxAcpi - VirtualBox ACPI maniputation functionality.
*/
/*
* Copyright (C) 2009 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#if !defined(IN_RING3)
#endif
#define LOG_GROUP LOG_GROUP_DEV_ACPI
#ifdef VBOX_WITH_DYNAMIC_DSDT
/* vbox.dsl - input to generate proper DSDT on the fly */
#else
/* Statically compiled AML */
#endif
#ifdef VBOX_WITH_DYNAMIC_DSDT
void* *ppPtr,
{
*puDsdtLen = 0;
return 0;
}
void* pPtr)
{
return 0;
}
#else
{
int rc;
if (RT_FAILURE(rc))
return rc;
/* Clear CPU objects at all, if needed */
bool fShowCpu;
if (RT_FAILURE(rc))
return rc;
if (!fShowCpu)
cNumCpus = 0;
/**
* Now search AML for:
* AML_PROCESSOR_OP (UINT16) 0x5b83
* and replace whole block with
* AML_NOOP_OP (UINT16) 0xa3
* for VCPU not configured
*/
{
/*
* AML_PROCESSOR_OP
*
* DefProcessor := ProcessorOp PkgLength NameString ProcID
PblkAddr PblkLen ObjectList
* ProcessorOp := ExtOpPrefix 0x83
* ProcID := ByteData
* PblkAddr := DwordData
* PblkLen := ByteData
*/
{
/* false alarm, not named starting CP */
continue;
/* Processor ID */
continue;
/* Will fill unwanted CPU block with NOOPs */
/*
* See 18.2.4 Package Length Encoding in ACPI spec
* for full format
*/
("So far, we only understand simple package length"));
/* including AML_PROCESSOR_OP itself */
pAml[i+j] = 0xa3;
/* Can increase i by cBytes + 1, but not really worth it */
}
}
/* now recompute checksum, whole file byte sum must be 0 */
pAml[9] = 0;
return 0;
}
#endif
/* Two only public functions */
{
#ifdef VBOX_WITH_DYNAMIC_DSDT
#else
bool fCpuHotplug = false;
if (RT_FAILURE(rc))
N_("Configuration error: Failed to read \"CpuHotplug\""));
if (fCpuHotplug)
{
cbAmlCode = sizeof(AmlCodeCpuHotplug);
}
else
{
}
return 0;
#endif
}
{
#ifdef VBOX_WITH_DYNAMIC_DSDT
#else
/* Do nothing */
return 0;
#endif
}