AcpiPlatform.c revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Sample ACPI Platform Driver
Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
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.
**/
#include <PiDxe.h>
#include <Protocol/AcpiTable.h>
#include <Protocol/FirmwareVolume2.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DebugLib.h>
#include <IndustryStandard/Acpi.h>
/**
Locate the first instance of a protocol. If the protocol requested is an
FV protocol, then it will return the first FV that contains the ACPI table
storage file.
@param Instance Return pointer to the first instance of the protocol
@return EFI_SUCCESS The function completed successfully.
@return EFI_NOT_FOUND The protocol could not be located.
@return EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol.
**/
)
{
FvStatus = 0;
//
// Locate protocol.
//
NULL,
);
//
// Defined errors at this time are not found and out of resources.
//
return Status;
}
//
// Looking for FV with ACPI storage file
//
//
// Get the protocol on this handle
// This should not fail because of LocateHandleBuffer
//
(VOID**) &FvInstance
);
//
// See if it has the ACPI storage file
//
NULL,
&Size,
&FileType,
);
//
// If we found it, then we are done
//
if (Status == EFI_SUCCESS) {
*Instance = FvInstance;
break;
}
}
//
// Our exit status is determined by the success of the previous operations
// If the protocol was found, Instance already points to it.
//
//
// Free any allocated buffers
//
return Status;
}
/**
This function calculates and updates an UINT8 checksum.
@param Buffer Pointer to buffer to checksum
@param Size Number of bytes to checksum
**/
)
{
//
// Set checksum to 0 first
//
Buffer[ChecksumOffset] = 0;
//
// Update checksum value
//
}
/**
Entrypoint of Acpi Platform driver.
@param ImageHandle
@param SystemTable
@return EFI_SUCCESS
@return EFI_LOAD_ERROR
@return EFI_OUT_OF_RESOURCES
**/
)
{
Instance = 0;
CurrentTable = NULL;
TableHandle = 0;
//
// Find the AcpiTable protocol
//
return EFI_ABORTED;
}
//
// Locate the firmware volume protocol
//
return EFI_ABORTED;
}
//
// Read tables from the storage file.
//
while (Status == EFI_SUCCESS) {
(VOID**) &CurrentTable,
&Size,
);
//
// Add the table
//
TableHandle = 0;
//
// Checksum ACPI table
//
//
// Install ACPI table
//
);
//
// Free memory allocated by ReadSection
//
return EFI_ABORTED;
}
//
// Increment the instance
//
Instance++;
CurrentTable = NULL;
}
}
return EFI_SUCCESS;
}