/**@file
Xen Platform PEI support
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2011, Andrei Warkentin <andreiw@motorola.com>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
//
// The package level header files this module uses
//
#include <PiPei.h>
//
// The Library classes this module consumes
//
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include "Platform.h"
/**
Connects to the Hypervisor.
@param XenLeaf CPUID index used to connect.
@return EFI_STATUS
**/
)
{
if (!mXenInfo.HyperPages) {
return EFI_OUT_OF_RESOURCES;
}
}
/* TBD: Locate hvm_info and reserve it away. */
&mXenInfo,
sizeof(mXenInfo)
);
return EFI_SUCCESS;
}
/**
Figures out if we are running inside Xen HVM.
@return UINT32 CPUID index used to connect to HV.
**/
)
{
return XenLeaf;
}
}
return 0;
}
/**
Perform Xen PEI initialization.
@return EFI_SUCCESS Xen initialized successfully
@return EFI_NOT_FOUND Not running under Xen
**/
)
{
if (XenLeaf == 0) {
return EFI_NOT_FOUND;
}
//
// Reserve away HVMLOADER reserved memory [0xFC000000,0xFD000000).
// This needs to match HVMLOADER RESERVED_MEMBASE/RESERVED_MEMSIZE.
//
return EFI_SUCCESS;
}