From 31bb486c913795c8b67d1c4dbaae2bdec4943fc9 Mon Sep 17 00:00:00 2001 From: raywu Date: Thu, 13 Sep 2018 16:11:56 +0800 Subject: SLP1.0 / SLP2.0 / Default Password / Logo / Fix Boot Order --- Core/EM/Slp10/Slp10.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 Core/EM/Slp10/Slp10.c (limited to 'Core/EM/Slp10/Slp10.c') diff --git a/Core/EM/Slp10/Slp10.c b/Core/EM/Slp10/Slp10.c new file mode 100644 index 0000000..b83edd5 --- /dev/null +++ b/Core/EM/Slp10/Slp10.c @@ -0,0 +1,125 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//***************************************************************************** +// $Header: /Alaska/SOURCE/Modules/Slp10/Slp10.c 1 6/18/09 5:31p Vyacheslava $ +// +// $Revision: 1 $ +// +// $Date: 6/18/09 5:31p $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/Slp10/Slp10.c $ +// +// 1 6/18/09 5:31p Vyacheslava +// Initial Creation +// +// +//***************************************************************************** +// +// +// Name: Slp10.c +// +// Description: Implementation of the SLP 1.0 eModule. +// +// +//***************************************************************************** + +//---------------------------------------------------------------------------- + +#include +#include +#include +#include "Slp10.h" + +//---------------------------------------------------------------------------- + +// +//---------------------------------------------------------------------------- +// +// Procedure: Slp10_EntryPoint +// +// Description: This function is the entry point of the Slp10 eModule. +// +// Parameter: +// ImageHandle - Image handle for this driver image. +// SystemTable - Pointer to the EFI system table. +// +// Return value: EFI_STATUS +// +//---------------------------------------------------------------------------- +// + +EFI_STATUS Slp10_EntryPoint( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) +{ + EFI_STATUS Status; + EFI_GUID EfiLegacyBiosExtProtocolGuid = EFI_LEGACY_BIOS_EXT_PROTOCOL_GUID; + EFI_GUID BiosFeaturesSectionGuid = BIOS_FEATURES_SECTION_GUID; + EFI_LEGACY_BIOS_EXT_PROTOCOL *LegacyBiosExtProtocol = NULL; + UINT8 *DataPtr = NULL; + UINTN Size = 0; + UINTN Address; + + InitAmiLib( ImageHandle, SystemTable ); + + // Get OEM data from Aptio FV + Status = ReadImageResource( + ImageHandle, + &BiosFeaturesSectionGuid, + &DataPtr, + &Size + ); + if (EFI_ERROR(Status)) + return Status; + + // Locate the Aptio extended Legacy Protocol + Status = pBS->LocateProtocol( + &EfiLegacyBiosExtProtocolGuid, + NULL, + &LegacyBiosExtProtocol + ); + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) + return Status; + + // Copy OEM Data to Legacy Table + Address = LegacyBiosExtProtocol->CopyLegacyTable( + ((BIOS_OEM_DATA*)DataPtr)->Data, // Pointer to SLP data + OEM_DATA_SPACE_SIZE, // Size of the data + 1, // Alignment + OEM_DATA_LOCATION_BIT // Location Attribute + ); + ASSERT_EFI_ERROR(Address); + + Status = pBS->FreePool(DataPtr); + ASSERT_EFI_ERROR(Status); + return Status; +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* -- cgit v1.2.3