Modules clean up.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3242 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2007-07-16 03:28:26 +00:00
parent 7658d609a3
commit ececc2eb4b
40 changed files with 585 additions and 890 deletions

View File

@ -186,13 +186,13 @@
$(WORKSPACE)/IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf $(WORKSPACE)/IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Universal/HiiDataBaseDxe/HiiDatabase.inf $(WORKSPACE)/IntelFrameworkModulePkg/Universal/HiiDataBaseDxe/HiiDatabase.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/SetupBrowser.inf $(WORKSPACE)/IntelFrameworkModulePkg/Universal/SetupBrowserDxe/SetupBrowser.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Universal/DriverSampleDxe/DriverSample.inf $(WORKSPACE)/IntelFrameworkModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf $(WORKSPACE)/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/VgaMiniPortDxe.inf $(WORKSPACE)/IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/VgaMiniPortDxe.inf
[Components.IA32] [Components.IA32]
$(WORKSPACE)/IntelFrameworkModulePkg/PcatCompatible/RealTimeClockRuntimeDxe/PcRtc.inf $(WORKSPACE)/IntelFrameworkModulePkg/PcatCompatible/RealTimeClockRuntimeDxe/PcRtc.inf
[Components.X64] [Components.X64]
$(WORKSPACE)/IntelFrameworkModulePkg/PcatCompatible/RealTimeClockRuntimeDxe/PcRtc.inf $(WORKSPACE)/IntelFrameworkModulePkg/PcatCompatible/RealTimeClockRuntimeDxe/PcRtc.inf

View File

@ -1,42 +0,0 @@
/**@file
Common header file shared by all source files.
This file includes package header files, library classes and protocol, PPI & GUID definitions.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __COMMON_HEADER_H_
#define __COMMON_HEADER_H_
//
// The package level header files this module uses
//
#include <PiDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Protocol/FormCallbackFramework.h>
#include <Protocol/HiiFramework.h>
//
// The Library classes this module consumes
//
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/BaseLib.h>
#include <Library/PrintLib.h>
#include <Library/IfrSupportLibFramework.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/HiiLibFramework.h>
#endif

View File

@ -1,28 +1,23 @@
/*++ /*++
Copyright (c) 2006 - 2007, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
DriverSample.c DriverSample.c
Abstract: Abstract:
This is an example of how a driver might export data to the HII protocol to be This is an example of how a driver might export data to the HII protocol to be
later utilized by the Setup Protocol later utilized by the Setup Protocol
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "DriverSample.h" #include "DriverSample.h"
#define DISPLAY_ONLY_MY_ITEM 0x0001 #define DISPLAY_ONLY_MY_ITEM 0x0001
@ -33,7 +28,7 @@ Abstract:
} }
EFI_GUID mFormSetGuid = FORMSET_GUID; EFI_GUID mFormSetGuid = FORMSET_GUID;
EFI_GUID mStringPackGuid = STRING_PACK_GUID; EFI_GUID mStringPackGuid = STRING_PACK_GUID;
STATIC STATIC
EFI_STATUS EFI_STATUS
@ -50,7 +45,7 @@ Routine Description:
This is the function that is called to provide results data to the driver. This data This is the function that is called to provide results data to the driver. This data
consists of a unique key which is used to identify what data is either being passed back consists of a unique key which is used to identify what data is either being passed back
or being asked for. or being asked for.
Arguments: Arguments:
@ -60,7 +55,7 @@ Arguments:
Data - A pointer to the data being sent to the original exporting driver. Data - A pointer to the data being sent to the original exporting driver.
Returns: Returns:
--*/ --*/
{ {
@ -507,7 +502,7 @@ DriverSampleInit (
CallbackInfo->CallbackHandle = Handle; CallbackInfo->CallbackHandle = Handle;
PackageList = PreparePackages (1, &mStringPackGuid, DriverSampleStrings); PackageList = PreparePackages (1, &mStringPackGuid, DriverSampleDxeStrings);
Status = Hii->NewPack (Hii, PackageList, &HiiHandle); Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
FreePool (PackageList); FreePool (PackageList);

View File

@ -1,31 +0,0 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DriverSample.dxs
Abstract:
Dependency expression source file.
--*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include <DxeDepex.h>
DEPENDENCY_START
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID
DEPENDENCY_END

View File

@ -25,9 +25,27 @@ Revision History
// //
// Include common header file for this module. // The package level header files this module uses
// //
#include "CommonHeader.h" #include <PiDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Protocol/FormCallbackFramework.h>
#include <Protocol/HiiFramework.h>
//
// The Library classes this module consumes
//
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/BaseLib.h>
#include <Library/PrintLib.h>
#include <Library/IfrSupportLibFramework.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/HiiLibFramework.h>
#include "NVDataStruc.h" #include "NVDataStruc.h"
@ -43,7 +61,7 @@ extern UINT8 InventoryBin[];
// //
// extern UINT8 InventoryStringsStr[]; // extern UINT8 InventoryStringsStr[];
// //
extern UINT8 DriverSampleStrings[]; extern UINT8 DriverSampleDxeStrings[];
#define SAMPLE_STRING L"This is an error!" #define SAMPLE_STRING L"This is an error!"

View File

@ -21,7 +21,7 @@
################################################################################ ################################################################################
[Defines] [Defines]
INF_VERSION = 0x00010005 INF_VERSION = 0x00010005
BASE_NAME = DriverSample BASE_NAME = DriverSampleDxe
FILE_GUID = FE3542FE-C1D3-4EF8-657C-8048606FF670 FILE_GUID = FE3542FE-C1D3-4EF8-657C-8048606FF670
MODULE_TYPE = DXE_DRIVER MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
@ -50,8 +50,6 @@
VfrStrings.uni VfrStrings.uni
Inventory.vfr Inventory.vfr
InventoryStrings.uni InventoryStrings.uni
CommonHeader.h
################################################################################ ################################################################################
# #

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0"> <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
<MsaHeader> <MsaHeader>
<ModuleName>DriverSample</ModuleName> <ModuleName>DriverSampleDxe</ModuleName>
<ModuleType>DXE_DRIVER</ModuleType> <ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>FE3542FE-C1D3-4EF8-657C-8048606FF670</GuidValue> <GuidValue>FE3542FE-C1D3-4EF8-657C-8048606FF670</GuidValue>
<Version>1.0</Version> <Version>1.0</Version>
@ -19,7 +19,7 @@
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>DriverSample</OutputFileBasename> <OutputFileBasename>DriverSampleDxe</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">

View File

@ -1,41 +0,0 @@
/**@file
Common header file shared by all source files.
This file includes package header files, library classes and protocol, PPI & GUID definitions.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __COMMON_HEADER_H_
#define __COMMON_HEADER_H_
//
// The package level header files this module uses
//
#include <FrameworkDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Guid/GlobalVariable.h>
#include <Protocol/FormCallbackFramework.h>
#include <Protocol/HiiFramework.h>
//
// The Library classes this module consumes
//
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/IfrSupportLibFramework.h>
#endif

View File

@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -20,11 +20,6 @@ Abstract:
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "HiiDatabase.h" #include "HiiDatabase.h"
// //
@ -85,7 +80,7 @@ HiiGetGlyph (
/*++ /*++
Routine Description: Routine Description:
Translates a Unicode character into the corresponding font glyph. Translates a Unicode character into the corresponding font glyph.
If the Source was pointing to a non-spacing character, the next Source[*Index] If the Source was pointing to a non-spacing character, the next Source[*Index]
character will be parsed and OR'd to the GlyphBuffer until a spacing character character will be parsed and OR'd to the GlyphBuffer until a spacing character
is found in the Source. Since non-spacing characters are considered to be the is found in the Source. Since non-spacing characters are considered to be the
@ -98,7 +93,7 @@ Routine Description:
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -222,7 +217,7 @@ Returns:
Attributes = GlobalData->NarrowGlyphs[Character].Attributes & EFI_GLYPH_NON_SPACING; Attributes = GlobalData->NarrowGlyphs[Character].Attributes & EFI_GLYPH_NON_SPACING;
} else { } else {
for (Value = 0; Value != Count; Value++) { for (Value = 0; Value != Count; Value++) {
*GlyphBuffer[Location + Value] = (UINT8) (*GlyphBuffer[Location + Value] | *GlyphBuffer[Location + Value] = (UINT8) (*GlyphBuffer[Location + Value] |
GlobalData->WideGlyphs[Character].GlyphCol1[Value]); GlobalData->WideGlyphs[Character].GlyphCol1[Value]);
*GlyphBuffer[Location + Value + Count] = (UINT8) (*GlyphBuffer[Location + Value + Count] | *GlyphBuffer[Location + Value + Count] = (UINT8) (*GlyphBuffer[Location + Value + Count] |
GlobalData->WideGlyphs[Character].GlyphCol2[Value]); GlobalData->WideGlyphs[Character].GlyphCol2[Value]);

View File

@ -1,23 +1,18 @@
/**@file /**@file
This file contains the form processing code to the HII database. This file contains the form processing code to the HII database.
Copyright (c) 2006 - 2007 Intel Corporation. <BR> Copyright (c) 2006 - 2007 Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "HiiDatabase.h" #include "HiiDatabase.h"
STATIC STATIC
@ -27,24 +22,24 @@ Ascii2Unicode (
IN CHAR8 *AsciiStr IN CHAR8 *AsciiStr
) )
/*++ /*++
Routine Description: Routine Description:
This function converts ASCII string to Unicode string. This function converts ASCII string to Unicode string.
Arguments: Arguments:
UnicodeStr - NULL terminated Unicode output string. UnicodeStr - NULL terminated Unicode output string.
AsciieStr - NULL terminated ASCII input string. AsciieStr - NULL terminated ASCII input string.
Returns: Returns:
Start of the Unicode ouput string. Start of the Unicode ouput string.
--*/ --*/
{ {
CHAR16 *Str = UnicodeStr; CHAR16 *Str = UnicodeStr;
while (TRUE) { while (TRUE) {
*(UnicodeStr++) = (CHAR16) *AsciiStr; *(UnicodeStr++) = (CHAR16) *AsciiStr;
if (*(AsciiStr++) == '\0') { if (*(AsciiStr++) == '\0') {
@ -60,24 +55,24 @@ Unicode2Ascii (
IN CHAR16 *UnicodeStr IN CHAR16 *UnicodeStr
) )
/*++ /*++
Routine Description: Routine Description:
This function converts Unicode string to ASCII string. This function converts Unicode string to ASCII string.
Arguments: Arguments:
AsciieStr - NULL terminated ASCII output string. AsciieStr - NULL terminated ASCII output string.
UnicodeStr - NULL terminated Unicode input string. UnicodeStr - NULL terminated Unicode input string.
Returns: Returns:
Start of the ASCII ouput string. Start of the ASCII ouput string.
--*/ --*/
{ {
CHAR8 *Str = AsciiStr; CHAR8 *Str = AsciiStr;
while (TRUE) { while (TRUE) {
*(AsciiStr++) = (CHAR8) *UnicodeStr; *(AsciiStr++) = (CHAR8) *UnicodeStr;
if (*(UnicodeStr++) == '\0') { if (*(UnicodeStr++) == '\0') {
@ -96,10 +91,10 @@ ExtractDevicePathData (
/*++ /*++
Routine Description: Routine Description:
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -141,22 +136,22 @@ ExtractVariableData (
Routine Description: Routine Description:
This function extract the EFI_HII_VARIABLE_PACK portion from the This function extract the EFI_HII_VARIABLE_PACK portion from the
each of the EFI_HII_PACKAGE_INSTANCE in HII handle database. each of the EFI_HII_PACKAGE_INSTANCE in HII handle database.
Arguments: Arguments:
DataTable - On input, this parameter point to the EFI_HII_DATA_TABLE structure DataTable - On input, this parameter point to the EFI_HII_DATA_TABLE structure
of the final data buffer for the EFI_HII_EXPORT interface. This function of the final data buffer for the EFI_HII_EXPORT interface. This function
update the NumberOfVariableData attribute. update the NumberOfVariableData attribute.
IfrData - It points to a staring address of a EFI_HII_IFR_PACK structure. IfrData - It points to a staring address of a EFI_HII_IFR_PACK structure.
ExportBufferPtr - On input, it points the starting address of the data buffer to ExportBufferPtr - On input, it points the starting address of the data buffer to
host the variable pack. On output, it is the starting address host the variable pack. On output, it is the starting address
of data buffer for the next extraction operation. of data buffer for the next extraction operation.
Returns: Returns:
VOID VOID
--*/ --*/
{ {
EFI_HII_VARIABLE_PACK *VariableContents; EFI_HII_VARIABLE_PACK *VariableContents;
@ -356,13 +351,13 @@ HiiExportDatabase (
/*++ /*++
Routine Description: Routine Description:
This function allows a program to extract a form or form package that has This function allows a program to extract a form or form package that has
previously been registered with the EFI HII database. previously been registered with the EFI HII database.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -414,7 +409,7 @@ Returns:
// //
// Extract Size of Export Package // Extract Size of Export Package
// //
SizeNeeded = SizeNeeded + PackageInstance->IfrSize SizeNeeded = SizeNeeded + PackageInstance->IfrSize
+ PackageInstance->StringSize + PackageInstance->StringSize
+ sizeof (EFI_HII_DATA_TABLE) + sizeof (EFI_HII_DATA_TABLE)
+ sizeof (EFI_HII_DEVICE_PATH_PACK); + sizeof (EFI_HII_DEVICE_PATH_PACK);
@ -696,35 +691,35 @@ HiiGetForms (
/*++ /*++
Routine Description: Routine Description:
This function allows a program to extract a form or form package that has This function allows a program to extract a form or form package that has
previously been registered with the EFI HII database. previously been registered with the EFI HII database.
Arguments: Arguments:
This - A pointer to the EFI_HII_PROTOCOL instance. This - A pointer to the EFI_HII_PROTOCOL instance.
Handle - Handle on which the form resides. Type EFI_HII_HANDLE is defined in Handle - Handle on which the form resides. Type EFI_HII_HANDLE is defined in
EFI_HII_PROTOCOL.NewPack() in the Packages section. EFI_HII_PROTOCOL.NewPack() in the Packages section.
FormId - The ID of the form to return. If the ID is zero, the entire form package is returned. FormId - The ID of the form to return. If the ID is zero, the entire form package is returned.
Type EFI_FORM_ID is defined in "Related Definitions" below. Type EFI_FORM_ID is defined in "Related Definitions" below.
BufferLength - On input, the length of the Buffer. On output, the length of the returned buffer, if BufferLength - On input, the length of the Buffer. On output, the length of the returned buffer, if
the length was sufficient and, if it was not, the length that is required to fit the the length was sufficient and, if it was not, the length that is required to fit the
requested form(s). requested form(s).
Buffer - The buffer designed to receive the form(s). Buffer - The buffer designed to receive the form(s).
Returns: Returns:
EFI_SUCCESS - Buffer filled with the requested forms. BufferLength EFI_SUCCESS - Buffer filled with the requested forms. BufferLength
was updated. was updated.
EFI_INVALID_PARAMETER - The handle is unknown. EFI_INVALID_PARAMETER - The handle is unknown.
EFI_NOT_FOUND - A form on the requested handle cannot be found with the EFI_NOT_FOUND - A form on the requested handle cannot be found with the
requested FormId. requested FormId.
EFI_BUFFER_TOO_SMALL - The buffer provided was not large enough to allow the form to be stored. EFI_BUFFER_TOO_SMALL - The buffer provided was not large enough to allow the form to be stored.
--*/ --*/
@ -824,7 +819,7 @@ Returns:
*BufferLengthTemp = FormLength; *BufferLengthTemp = FormLength;
return EFI_BUFFER_TOO_SMALL; return EFI_BUFFER_TOO_SMALL;
} }
// //
// Rewind to start offset of the found Form // Rewind to start offset of the found Form
// //
@ -857,21 +852,21 @@ HiiGetDefaultImageInitPack (
IN EFI_IFR_VARSTORE *VarStore IN EFI_IFR_VARSTORE *VarStore
) )
/*++ /*++
Routine Description: Routine Description:
Initialize the EFI_HII_VARIABLE_PACK_LIST structure and Initialize the EFI_HII_VARIABLE_PACK_LIST structure and
prepare it ready to be used by HiiGetDefaultImagePopulateMap (). prepare it ready to be used by HiiGetDefaultImagePopulateMap ().
Arguments: Arguments:
VariablePackItem - Variable Package List. VariablePackItem - Variable Package List.
VarStore - IFR variable storage. VarStore - IFR variable storage.
Returns: Returns:
Return the pointer to the Map space. Return the pointer to the Map space.
--*/ --*/
{ {
CHAR16 *Name16; CHAR16 *Name16;
@ -900,7 +895,7 @@ HiiGetDefaultImageInitPack (
VariablePack->VariableId = VarStore->VarId; VariablePack->VariableId = VarStore->VarId;
CopyMem (&VariablePack->VariableGuid, &VarStore->Guid, sizeof (EFI_GUID)); CopyMem (&VariablePack->VariableGuid, &VarStore->Guid, sizeof (EFI_GUID));
VariablePack->VariableNameLength = (UINT32) ((StrLen (Name16) + 1) * 2); VariablePack->VariableNameLength = (UINT32) ((StrLen (Name16) + 1) * 2);
VariablePack->Header.Length = sizeof (*VariablePack) VariablePack->Header.Length = sizeof (*VariablePack)
+ VariablePack->VariableNameLength + VariablePack->VariableNameLength
+ VarStore->Size; + VarStore->Size;
// //
@ -914,28 +909,28 @@ HiiGetDefaultImageInitPack (
STATIC STATIC
VOID VOID
HiiGetDefaultImagePopulateMap ( HiiGetDefaultImagePopulateMap (
IN OUT UINT8 *Map, IN OUT UINT8 *Map,
IN EFI_IFR_OP_HEADER *FormSet, IN EFI_IFR_OP_HEADER *FormSet,
IN EFI_IFR_VARSTORE *VarStore, IN EFI_IFR_VARSTORE *VarStore,
IN UINTN DefaultMask IN UINTN DefaultMask
) )
/*++ /*++
Routine Description: Routine Description:
Fill the Map with all the default values either from NV or Hii database. Fill the Map with all the default values either from NV or Hii database.
Arguments: Arguments:
Map - Memory pointer to hold the default values. Map - Memory pointer to hold the default values.
FormSet - The starting EFI_IFR_OP_HEADER to begin retriving default values. FormSet - The starting EFI_IFR_OP_HEADER to begin retriving default values.
VarStore - IFR variable storage. VarStore - IFR variable storage.
DefaultMask - The mask used to get the default variable. DefaultMask - The mask used to get the default variable.
Returns: Returns:
VOID VOID
--*/ --*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -950,7 +945,7 @@ HiiGetDefaultImagePopulateMap (
EFI_IFR_NV_DATA *IfrNvData; EFI_IFR_NV_DATA *IfrNvData;
EFI_GUID Guid; EFI_GUID Guid;
CHAR16 *Name16; CHAR16 *Name16;
CHAR8 *Name8; CHAR8 *Name8;
EFI_HANDLE CallbackHandle; EFI_HANDLE CallbackHandle;
EFI_FORM_CALLBACK_PROTOCOL *FormCallbackProt; EFI_FORM_CALLBACK_PROTOCOL *FormCallbackProt;
@ -993,7 +988,7 @@ HiiGetDefaultImagePopulateMap (
} }
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
// //
// Either Defaults/Manufacturing variable exists and appears to be valid. // Either Defaults/Manufacturing variable exists and appears to be valid.
// The map is read, exit w/ success now. // The map is read, exit w/ success now.
// //
FreePool (Name16); FreePool (Name16);
@ -1002,10 +997,10 @@ HiiGetDefaultImagePopulateMap (
// //
// First, prime the map with what already is in the NV. // First, prime the map with what already is in the NV.
// This is needed to cover a situation where the IFR does not contain all the // This is needed to cover a situation where the IFR does not contain all the
// defaults; either deliberately not having appropriate IFR, or in case of IFR_STRING, there is no default. // defaults; either deliberately not having appropriate IFR, or in case of IFR_STRING, there is no default.
// Ignore status. Either it gets read or not. // Ignore status. Either it gets read or not.
// //
FormCallbackProt = NULL; FormCallbackProt = NULL;
CopyMem (&CallbackHandle, &((EFI_IFR_FORM_SET*) FormSet)->CallbackHandle, sizeof (CallbackHandle)); CopyMem (&CallbackHandle, &((EFI_IFR_FORM_SET*) FormSet)->CallbackHandle, sizeof (CallbackHandle));
if (CallbackHandle != NULL) { if (CallbackHandle != NULL) {
@ -1042,7 +1037,7 @@ HiiGetDefaultImagePopulateMap (
} }
} else { } else {
// //
// No callback available for this formset, read straight from NV. Deliberately ignore the Status. // No callback available for this formset, read straight from NV. Deliberately ignore the Status.
// The buffer will only be written if variable exists nd has correct size. // The buffer will only be written if variable exists nd has correct size.
// //
Status = EfiLibHiiVariableRetrieveFromNv ( Status = EfiLibHiiVariableRetrieveFromNv (
@ -1056,8 +1051,8 @@ HiiGetDefaultImagePopulateMap (
// //
// Iterate all IFR statements and for applicable, retrieve the default into the Map. // Iterate all IFR statements and for applicable, retrieve the default into the Map.
// //
for (IfrItem = FormSet, VarId = 0; for (IfrItem = FormSet, VarId = 0;
IfrItem->OpCode != EFI_IFR_END_FORM_SET_OP; IfrItem->OpCode != EFI_IFR_END_FORM_SET_OP;
IfrItem = (EFI_IFR_OP_HEADER *) ((UINT8*) IfrItem + IfrItem->Length) IfrItem = (EFI_IFR_OP_HEADER *) ((UINT8*) IfrItem + IfrItem->Length)
) { ) {
@ -1073,11 +1068,11 @@ HiiGetDefaultImagePopulateMap (
// //
// Skip opcodes that reference other VarStore than that specific to current map. // Skip opcodes that reference other VarStore than that specific to current map.
// //
if (VarId != VarStore->VarId) { if (VarId != VarStore->VarId) {
continue; continue;
} }
// //
// Extract the default value from this opcode if applicable, and apply it to the map. // Extract the default value from this opcode if applicable, and apply it to the map.
// //
@ -1089,7 +1084,7 @@ HiiGetDefaultImagePopulateMap (
// //
// Get to the first EFI_IFR_ONE_OF_OPTION_OP // Get to the first EFI_IFR_ONE_OF_OPTION_OP
// //
IfrItem = (EFI_IFR_OP_HEADER *) ((UINT8*) IfrItem + IfrItem->Length); IfrItem = (EFI_IFR_OP_HEADER *) ((UINT8*) IfrItem + IfrItem->Length);
ASSERT (EFI_IFR_ONE_OF_OPTION_OP == IfrItem->OpCode); ASSERT (EFI_IFR_ONE_OF_OPTION_OP == IfrItem->OpCode);
OneOfOpt = (EFI_IFR_ONE_OF_OPTION *)IfrItem; OneOfOpt = (EFI_IFR_ONE_OF_OPTION *)IfrItem;
@ -1126,7 +1121,7 @@ HiiGetDefaultImagePopulateMap (
case EFI_IFR_CHECKBOX_OP: case EFI_IFR_CHECKBOX_OP:
ASSERT (IfrNvData->QuestionId + IfrNvData->StorageWidth <= VarStore->Size); ASSERT (IfrNvData->QuestionId + IfrNvData->StorageWidth <= VarStore->Size);
CheckBox = (EFI_IFR_CHECK_BOX *)IfrItem; CheckBox = (EFI_IFR_CHECK_BOX *)IfrItem;
if (DefaultMask == EFI_IFR_FLAG_MANUFACTURING) { if (DefaultMask == EFI_IFR_FLAG_MANUFACTURING) {
if (0 != (CheckBox->Flags & EFI_IFR_FLAG_MANUFACTURING)) { if (0 != (CheckBox->Flags & EFI_IFR_FLAG_MANUFACTURING)) {
*(UINT8 *) (Map + IfrNvData->QuestionId) = TRUE; *(UINT8 *) (Map + IfrNvData->QuestionId) = TRUE;
@ -1168,25 +1163,25 @@ HiiGetDefaultImage (
OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
) )
/*++ /*++
Routine Description: Routine Description:
This function allows a program to extract the NV Image This function allows a program to extract the NV Image
that represents the default storage image that represents the default storage image
Arguments: Arguments:
This - A pointer to the EFI_HII_PROTOCOL instance. This - A pointer to the EFI_HII_PROTOCOL instance.
Handle - The HII handle from which will have default data retrieved. Handle - The HII handle from which will have default data retrieved.
UINTN - Mask used to retrieve the default image. UINTN - Mask used to retrieve the default image.
VariablePackList - Callee allocated, tightly-packed, link list data VariablePackList - Callee allocated, tightly-packed, link list data
structure that contain all default varaible packs structure that contain all default varaible packs
from the Hii Database. from the Hii Database.
Returns: Returns:
EFI_NOT_FOUND - If Hii database does not contain any default images. EFI_NOT_FOUND - If Hii database does not contain any default images.
EFI_INVALID_PARAMETER - Invalid input parameter. EFI_INVALID_PARAMETER - Invalid input parameter.
EFI_SUCCESS - Operation successful. EFI_SUCCESS - Operation successful.
--*/ --*/
{ {
EFI_HII_HANDLE_DATABASE *HandleDatabase; EFI_HII_HANDLE_DATABASE *HandleDatabase;
@ -1198,7 +1193,7 @@ HiiGetDefaultImage (
UINTN SetupMapNameSize; UINTN SetupMapNameSize;
UINTN SizeOfMaps; UINTN SizeOfMaps;
EFI_HII_VARIABLE_PACK_LIST *PackList; EFI_HII_VARIABLE_PACK_LIST *PackList;
EFI_HII_VARIABLE_PACK_LIST *PackListNext; EFI_HII_VARIABLE_PACK_LIST *PackListNext;
EFI_HII_VARIABLE_PACK_LIST *PackListLast; EFI_HII_VARIABLE_PACK_LIST *PackListLast;
UINT8 *Map; UINT8 *Map;
@ -1232,26 +1227,26 @@ HiiGetDefaultImage (
// //
// Size of the map // Size of the map
// //
SizeOfMaps += VarStore->Size; SizeOfMaps += VarStore->Size;
// //
// add the size of the string, in Unicode // add the size of the string, in Unicode
// //
SizeOfMaps += (VarStore->Header.Length - sizeof (*VarStore)) * 2; SizeOfMaps += (VarStore->Header.Length - sizeof (*VarStore)) * 2;
// //
// Space for node // Space for node
// //
SizeOfMaps += sizeof (EFI_HII_VARIABLE_PACK); SizeOfMaps += sizeof (EFI_HII_VARIABLE_PACK);
// //
// Space for linked list node // Space for linked list node
// //
SizeOfMaps += sizeof (EFI_HII_VARIABLE_PACK_LIST); SizeOfMaps += sizeof (EFI_HII_VARIABLE_PACK_LIST);
} }
IfrItem = (EFI_IFR_OP_HEADER *) ((UINT8 *) IfrItem + IfrItem->Length); IfrItem = (EFI_IFR_OP_HEADER *) ((UINT8 *) IfrItem + IfrItem->Length);
} }
// //
// If the FormSet OpCode has a non-zero NvDataSize. There is a default // If the FormSet OpCode has a non-zero NvDataSize. There is a default
// NvMap with ID=0, GUID that of the formset itself and "Setup" as name. // NvMap with ID=0, GUID that of the formset itself and "Setup" as name.
// //
SetupMapNameSize = StrLen (SETUP_MAP_NAME) + 1; SetupMapNameSize = StrLen (SETUP_MAP_NAME) + 1;
@ -1269,33 +1264,33 @@ HiiGetDefaultImage (
// //
// Size of the map // Size of the map
// //
SizeOfMaps += VarStoreDefault->Size; SizeOfMaps += VarStoreDefault->Size;
// //
// add the size of the string // add the size of the string
// //
SizeOfMaps += sizeof (SETUP_MAP_NAME); SizeOfMaps += sizeof (SETUP_MAP_NAME);
// //
// Space for node // Space for node
// //
SizeOfMaps += sizeof (EFI_HII_VARIABLE_PACK); SizeOfMaps += sizeof (EFI_HII_VARIABLE_PACK);
// //
// Space for linked list node // Space for linked list node
// //
SizeOfMaps += sizeof (EFI_HII_VARIABLE_PACK_LIST); SizeOfMaps += sizeof (EFI_HII_VARIABLE_PACK_LIST);
} }
if (0 == SizeOfMaps) { if (0 == SizeOfMaps) {
// //
// The IFR does not have any explicit or default map(s). // The IFR does not have any explicit or default map(s).
// //
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
// //
// Allocate the return buffer // Allocate the return buffer
// //
PackList = AllocateZeroPool (SizeOfMaps); PackList = AllocateZeroPool (SizeOfMaps);
ASSERT (NULL != PackList); ASSERT (NULL != PackList);
PackListNext = PackList; PackListNext = PackList;
PackListLast = PackList; PackListLast = PackList;
@ -1337,7 +1332,7 @@ HiiGetDefaultImage (
PackListLast->NextVariablePack = NULL; PackListLast->NextVariablePack = NULL;
*VariablePackList = PackList; *VariablePackList = PackList;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -1354,7 +1349,7 @@ HiiUpdateForm (
/*++ /*++
Routine Description: Routine Description:
This function allows the caller to update a form that has This function allows the caller to update a form that has
previously been registered with the EFI HII database. previously been registered with the EFI HII database.
Arguments: Arguments:
@ -1363,7 +1358,7 @@ Arguments:
AddData - If TRUE, add data. If FALSE, remove data AddData - If TRUE, add data. If FALSE, remove data
Data - If adding data, this is the pointer to the data to add Data - If adding data, this is the pointer to the data to add
Returns: Returns:
EFI_SUCCESS - Update success. EFI_SUCCESS - Update success.
Other - Update fail. Other - Update fail.

View File

@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006 - 2007, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -19,11 +19,6 @@ Abstract:
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "HiiDatabase.h" #include "HiiDatabase.h"
EFI_STATUS EFI_STATUS
@ -36,11 +31,11 @@ InitializeHiiDatabase (
Routine Description: Routine Description:
Initialize HII Database Initialize HII Database
Arguments: Arguments:
(Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT) (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
Returns: Returns:
EFI_SUCCESS - Setup loaded. EFI_SUCCESS - Setup loaded.
other - Setup Error other - Setup Error
@ -152,10 +147,10 @@ HiiFindHandles (
Routine Description: Routine Description:
Determines the handles that are currently active in the database. Determines the handles that are currently active in the database.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -221,12 +216,12 @@ HiiGetPrimaryLanguages (
/*++ /*++
Routine Description: Routine Description:
This function allows a program to determine what the primary languages that are supported on a given handle. This function allows a program to determine what the primary languages that are supported on a given handle.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -319,13 +314,13 @@ HiiGetSecondaryLanguages (
/*++ /*++
Routine Description: Routine Description:
This function allows a program to determine which secondary languages are supported This function allows a program to determine which secondary languages are supported
on a given handle for a given primary language. on a given handle for a given primary language.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {

View File

@ -1,30 +0,0 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
HiiDatabase.dxs
Abstract:
Dependency expression source file.
--*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include <DxeDepex.h>
DEPENDENCY_START
TRUE
DEPENDENCY_END

View File

@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -15,7 +15,7 @@ Module Name:
Abstract: Abstract:
This file contains global defines and prototype definitions This file contains global defines and prototype definitions
for the HII database. for the HII database.
--*/ --*/
@ -24,9 +24,26 @@ Abstract:
#define _HIIDATABASE_H #define _HIIDATABASE_H
// //
// Include common header file for this module. // The package level header files this module uses
// //
#include "CommonHeader.h" #include <PiDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Guid/GlobalVariable.h>
#include <Protocol/FormCallbackFramework.h>
#include <Protocol/HiiFramework.h>
//
// The Library classes this module consumes
//
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/IfrSupportLibFramework.h>
// //
// HII Database Global data // HII Database Global data

View File

@ -50,7 +50,6 @@
Forms.c Forms.c
HiiDatabase.h HiiDatabase.h
HiiDatabase.c HiiDatabase.c
CommonHeader.h
################################################################################ ################################################################################

View File

@ -1,12 +1,12 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -20,11 +20,6 @@ Abstract:
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "HiiDatabase.h" #include "HiiDatabase.h"
EFI_STATUS EFI_STATUS
@ -37,10 +32,10 @@ HiiGetKeyboardLayout (
/*++ /*++
Routine Description: Routine Description:
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {

View File

@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006 - 2007, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -20,11 +20,6 @@ Abstract:
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "HiiDatabase.h" #include "HiiDatabase.h"
EFI_STATUS EFI_STATUS
@ -37,10 +32,10 @@ GetPackSize (
Routine Description: Routine Description:
Determines the passed in Pack's size and returns the value. Determines the passed in Pack's size and returns the value.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -111,10 +106,10 @@ ValidatePack (
Routine Description: Routine Description:
Verifies that the package instance is using the correct handle for string operations. Verifies that the package instance is using the correct handle for string operations.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -227,14 +222,14 @@ HiiNewPack (
Routine Description: Routine Description:
Extracts the various packs from a package list. Extracts the various packs from a package list.
Arguments: Arguments:
This - Pointer of HII protocol. This - Pointer of HII protocol.
Packages - Pointer of HII packages. Packages - Pointer of HII packages.
Handle - Handle value to be returned. Handle - Handle value to be returned.
Returns: Returns:
EFI_SUCCESS - Pacakges has added to HII database successfully. EFI_SUCCESS - Pacakges has added to HII database successfully.
EFI_INVALID_PARAMETER - Invalid parameter. EFI_INVALID_PARAMETER - Invalid parameter.
@ -610,10 +605,10 @@ HiiRemovePack (
Routine Description: Routine Description:
Removes the various packs from a Handle Removes the various packs from a Handle
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {

View File

@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006 - 2007, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -20,11 +20,6 @@ Abstract:
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "HiiDatabase.h" #include "HiiDatabase.h"
STATIC STATIC
@ -56,10 +51,10 @@ HiiTestString (
Routine Description: Routine Description:
Test if all of the characters in a string have corresponding font characters. Test if all of the characters in a string have corresponding font characters.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -75,7 +70,7 @@ Returns:
HiiData = EFI_HII_DATA_FROM_THIS (This); HiiData = EFI_HII_DATA_FROM_THIS (This);
GlobalData = HiiData->GlobalData; GlobalData = HiiData->GlobalData;
// //
// Rewind through the string looking for a glyph width identifier // Rewind through the string looking for a glyph width identifier
// If no width identifier exists, we assume string has narrow width identifier // If no width identifier exists, we assume string has narrow width identifier
@ -155,18 +150,18 @@ Routine Description:
We will make a buffer the size of the package + EfiStrSize of the new string. We will We will make a buffer the size of the package + EfiStrSize of the new string. We will
copy the string package that first gets changed and the following language packages until copy the string package that first gets changed and the following language packages until
we encounter the NULL string package. All this time we will ensure that the offsets have we encounter the NULL string package. All this time we will ensure that the offsets have
been adjusted. been adjusted.
Arguments: Arguments:
This - Pointer to the HII protocol. This - Pointer to the HII protocol.
Language - Pointer to buffer which contains the language code of this NewString. Language - Pointer to buffer which contains the language code of this NewString.
Handle - Handle of the package instance to be processed. Handle - Handle of the package instance to be processed.
Reference - The token number for the string. If 0, new string token to be returned through this parameter. Reference - The token number for the string. If 0, new string token to be returned through this parameter.
NewString - Buffer pointer for the new string. NewString - Buffer pointer for the new string.
ResetStrings - Indicate if we are resetting a string. ResetStrings - Indicate if we are resetting a string.
Returns: Returns:
EFI_SUCCESS - The string has been added or reset to Hii database. EFI_SUCCESS - The string has been added or reset to Hii database.
EFI_INVALID_PARAMETER - Some parameter passed in is invalid. EFI_INVALID_PARAMETER - Some parameter passed in is invalid.
@ -661,11 +656,11 @@ Routine Description:
We will make a buffer the size of the package + StrSize of the new string. We will We will make a buffer the size of the package + StrSize of the new string. We will
copy the string package that first gets changed and the following language packages until copy the string package that first gets changed and the following language packages until
we encounter the NULL string package. All this time we will ensure that the offsets have we encounter the NULL string package. All this time we will ensure that the offsets have
been adjusted. been adjusted.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -730,12 +725,12 @@ HiiResetStrings (
/*++ /*++
Routine Description: Routine Description:
This function removes any new strings that were added after the initial string export for this handle. This function removes any new strings that were added after the initial string export for this handle.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {
@ -787,7 +782,7 @@ HiiGetString (
/*++ /*++
Routine Description: Routine Description:
This function extracts a string from a package already registered with the EFI HII database. This function extracts a string from a package already registered with the EFI HII database.
Arguments: Arguments:
@ -795,7 +790,7 @@ Arguments:
Handle - The HII handle on which the string resides. Handle - The HII handle on which the string resides.
Token - The string token assigned to the string. Token - The string token assigned to the string.
Raw - If TRUE, the string is returned unedited in the internal storage format described Raw - If TRUE, the string is returned unedited in the internal storage format described
above. If false, the string returned is edited by replacing <cr> with <space> above. If false, the string returned is edited by replacing <cr> with <space>
and by removing special characters such as the <wide> prefix. and by removing special characters such as the <wide> prefix.
LanguageString - Pointer to a NULL-terminated string containing a single ISO 639-2 language LanguageString - Pointer to a NULL-terminated string containing a single ISO 639-2 language
identifier, indicating the language to print. If the LanguageString is empty (starts identifier, indicating the language to print. If the LanguageString is empty (starts
@ -805,11 +800,11 @@ Arguments:
StringBuffer - The buffer designed to receive the characters in the string. Type EFI_STRING is StringBuffer - The buffer designed to receive the characters in the string. Type EFI_STRING is
defined in String. defined in String.
Returns: Returns:
EFI_INVALID_PARAMETER - If input parameter is invalid. EFI_INVALID_PARAMETER - If input parameter is invalid.
EFI_BUFFER_TOO_SMALL - If the *BufferLength is too small. EFI_BUFFER_TOO_SMALL - If the *BufferLength is too small.
EFI_SUCCESS - Operation is successful. EFI_SUCCESS - Operation is successful.
--*/ --*/
{ {
EFI_HII_PACKAGE_INSTANCE *PackageInstance; EFI_HII_PACKAGE_INSTANCE *PackageInstance;
@ -930,11 +925,11 @@ LangNotFound:
// //
// Back to the start of package. // Back to the start of package.
// //
StringPack = (VOID*)(((UINT8*)StringPack) - Length); StringPack = (VOID*)(((UINT8*)StringPack) - Length);
// //
// Terminating zero sub-pack. // Terminating zero sub-pack.
// //
Length += sizeof (EFI_HII_STRING_PACK); Length += sizeof (EFI_HII_STRING_PACK);
// //
// If trying to get the entire string package and have insufficient space. Return error. // If trying to get the entire string package and have insufficient space. Return error.
@ -1009,11 +1004,11 @@ LangNotFound:
// Skip "Narraw, Wide, NoBreak" // Skip "Narraw, Wide, NoBreak"
// //
if (CompareMem (Local, &Narrow, 2) && if (CompareMem (Local, &Narrow, 2) &&
CompareMem (Local, &Wide, 2) && CompareMem (Local, &Wide, 2) &&
CompareMem (Local, &NoBreak, 2)) { CompareMem (Local, &NoBreak, 2)) {
CopyMem (&StringBuffer[Count++], Local, 2); CopyMem (&StringBuffer[Count++], Local, 2);
} }
} }
// //
// Add "NULL" at the end. // Add "NULL" at the end.
// //
@ -1051,13 +1046,13 @@ HiiGetLine (
Routine Description: Routine Description:
This function allows a program to extract a part of a string of not more than a given width. This function allows a program to extract a part of a string of not more than a given width.
With repeated calls, this allows a calling program to extract "lines" of text that fit inside With repeated calls, this allows a calling program to extract "lines" of text that fit inside
columns. The effort of measuring the fit of strings inside columns is localized to this call. columns. The effort of measuring the fit of strings inside columns is localized to this call.
Arguments: Arguments:
Returns: Returns:
--*/ --*/
{ {

View File

@ -20,10 +20,6 @@ Abstract:
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "Setup.h" #include "Setup.h"
#include "Ui.h" #include "Ui.h"

View File

@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -23,11 +23,6 @@ Revision History
#ifndef _COLORS_H #ifndef _COLORS_H
#define _COLORS_H #define _COLORS_H
//
// Include common header file for this module.
//
#include "CommonHeader.h"
// //
// Screen Color Settings // Screen Color Settings
// //

View File

@ -1,44 +0,0 @@
/**@file
Common header file shared by all source files.
This file includes package header files, library classes and protocol, PPI & GUID definitions.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __COMMON_HEADER_H_
#define __COMMON_HEADER_H_
//
// The package level header files this module uses
//
#include <PiDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Protocol/FormCallbackFramework.h>
#include <Protocol/FormBrowserFramework.h>
#include <Protocol/HiiFramework.h>
#include <Protocol/Print.h>
//
// The Library classes this module consumes
//
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/HiiLibFramework.h>
#include <Library/GraphicsLib.h>
#endif

View File

@ -21,11 +21,6 @@ Revision History
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "Setup.h" #include "Setup.h"
#include "Ui.h" #include "Ui.h"
#include "Colors.h" #include "Colors.h"

View File

@ -19,11 +19,6 @@ Revision History:
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "Setup.h" #include "Setup.h"
#include "Ui.h" #include "Ui.h"
#include "Colors.h" #include "Colors.h"

View File

@ -32,11 +32,6 @@ Abstract:
--*/ --*/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "Print.h" #include "Print.h"
STATIC STATIC

View File

@ -1,12 +1,12 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -22,11 +22,6 @@ Abstract:
#ifndef _PRINT_H_ #ifndef _PRINT_H_
#define _PRINT_H_ #define _PRINT_H_
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "Setup.h" #include "Setup.h"
#define LEFT_JUSTIFY 0x01 #define LEFT_JUSTIFY 0x01

View File

@ -12,11 +12,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "Setup.h" #include "Setup.h"
#include "Ui.h" #include "Ui.h"

View File

@ -12,10 +12,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "Setup.h" #include "Setup.h"
#include "Ui.h" #include "Ui.h"

View File

@ -24,9 +24,30 @@ Revision History
#define _SETUP_H #define _SETUP_H
// //
// Include common header file for this module. // The package level header files this module uses
// //
#include "CommonHeader.h" #include <PiDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Protocol/FormCallbackFramework.h>
#include <Protocol/FormBrowserFramework.h>
#include <Protocol/HiiFramework.h>
#include <Protocol/Print.h>
//
// The Library classes this module consumes
//
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/HiiLibFramework.h>
#include <Library/GraphicsLib.h>
// //
// This is the generated header file which includes whatever needs to be exported (strings + IFR) // This is the generated header file which includes whatever needs to be exported (strings + IFR)

View File

@ -57,8 +57,6 @@
Setup.h Setup.h
Setup.c Setup.c
SetupBrowserStr.uni SetupBrowserStr.uni
CommonHeader.h
################################################################################ ################################################################################
# #
@ -68,10 +66,9 @@
################################################################################ ################################################################################
[Packages] [Packages]
IntelFrameworkPkg/IntelFrameworkPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec
################################################################################ ################################################################################
# #

View File

@ -12,10 +12,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "Setup.h" #include "Setup.h"
#include "Ui.h" #include "Ui.h"

View File

@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@ -24,10 +24,6 @@ Revision History
#ifndef _UI_H #ifndef _UI_H
#define _UI_H #define _UI_H
//
// Include common header file for this module.
//
#include "CommonHeader.h"
// //
// Globals // Globals

View File

@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
--*/ --*/
@ -46,7 +46,7 @@
#include <Library/OemHookStatusCodeLib.h> #include <Library/OemHookStatusCodeLib.h>
// //
// Data hub worker definition // Data hub worker definition
// //
#define MAX_NUMBER_DATAHUB_RECORDS 1000 #define MAX_NUMBER_DATAHUB_RECORDS 1000
#define DATAHUB_BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE #define DATAHUB_BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE
@ -56,8 +56,8 @@
// //
// Address type of pointer. // Address type of pointer.
// The point type always equal to PHYSICAL_MODE on IA32/X64/EBC architecture // The point type always equal to PHYSICAL_MODE on IA32/X64/EBC architecture
// Otherwise, VIRTUAL_MODE/PHYSICAL_MODE would be used on Ipf architecture, // Otherwise, VIRTUAL_MODE/PHYSICAL_MODE would be used on Ipf architecture,
// //
typedef enum { typedef enum {
PHYSICAL_MODE, PHYSICAL_MODE,
VIRTUAL_MODE VIRTUAL_MODE
@ -72,8 +72,8 @@ typedef struct {
// //
// Runtime memory status code worker definition // Runtime memory status code worker definition
// //
typedef struct { typedef struct {
UINT32 RecordIndex; UINT32 RecordIndex;
UINT32 NumberOfRecords; UINT32 NumberOfRecords;
@ -83,22 +83,22 @@ typedef struct {
typedef struct { typedef struct {
// //
// Report operation nest status. // Report operation nest status.
// If it is set, then the report operation has nested. // If it is set, then the report operation has nested.
// //
UINT32 StatusCodeNestStatus; UINT32 StatusCodeNestStatus;
// //
// Runtime status code management header, the records buffer is following it. // Runtime status code management header, the records buffer is following it.
// //
RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable[2]; RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable[2];
} DXE_STATUS_CODE_CONTROLLER; } DXE_STATUS_CODE_CONTROLLER;
/** /**
Dispatch initialization request to sub status code devices based on Dispatch initialization request to sub status code devices based on
customized feature flags. customized feature flags.
**/ **/
VOID VOID
InitializationDispatcherWorker ( InitializationDispatcherWorker (
@ -108,7 +108,7 @@ InitializationDispatcherWorker (
/** /**
Initialize serial status code worker. Initialize serial status code worker.
@return The function always return EFI_SUCCESS @return The function always return EFI_SUCCESS
**/ **/
@ -120,29 +120,29 @@ EfiSerialStatusCodeInitializeWorker (
/** /**
Convert status code value and extended data to readable ASCII string, send string to serial I/O device. Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to classify the entity This included information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
not meaningful, or not relevant. Valid instance numbers start with 1. not meaningful, or not relevant. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller. @param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to different callers. This parameter allows the status code driver to apply different rules to different callers.
Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification. Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
@param Data This optional parameter may be used to pass additional data @param Data This optional parameter may be used to pass additional data
@retval EFI_SUCCESS Success to report status code to serial I/O. @retval EFI_SUCCESS Success to report status code to serial I/O.
@retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called . @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .
@ -158,7 +158,7 @@ SerialStatusCodeReportWorker (
/** /**
Initialize runtime memory status code. Initialize runtime memory status code.
@return The function always return EFI_SUCCESS @return The function always return EFI_SUCCESS
**/ **/
@ -168,26 +168,26 @@ RtMemoryStatusCodeInitializeWorker (
); );
/** /**
Report status code into runtime memory. If the runtime pool is full, roll back to the Report status code into runtime memory. If the runtime pool is full, roll back to the
first record and overwrite it. first record and overwrite it.
@param RtMemoryStatusCodeTable @param RtMemoryStatusCodeTable
Point to Runtime memory table header. Point to Runtime memory table header.
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to classify the entity This included information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
not meaningful, or not relevant. Valid instance numbers start with 1. not meaningful, or not relevant. Valid instance numbers start with 1.
@return The function always return EFI_SUCCESS. @return The function always return EFI_SUCCESS.
**/ **/
@ -202,7 +202,7 @@ RtMemoryStatusCodeReportWorker (
/** /**
Initialize data hubstatus code. Initialize data hubstatus code.
Create a data hub listener. Create a data hub listener.
@return The function always return EFI_SUCCESS @return The function always return EFI_SUCCESS
**/ **/
@ -214,29 +214,29 @@ DataHubStatusCodeInitializeWorker (
/** /**
Report status code into DataHub. Report status code into DataHub.
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to classify the entity This included information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
not meaningful, or not relevant. Valid instance numbers start with 1. not meaningful, or not relevant. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller. @param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to different callers. This parameter allows the status code driver to apply different rules to different callers.
Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification. Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
@param Data This optional parameter may be used to pass additional data @param Data This optional parameter may be used to pass additional data
@retval EFI_OUT_OF_RESOURCES Can not acquire record buffer. @retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.
@retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called . @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .
@retval EFI_SUCCESS Success to cache status code and signal log data event. @retval EFI_SUCCESS Success to cache status code and signal log data event.
@ -274,7 +274,7 @@ DxeStatusCodeDriverEntry (
// //
// declaration of DXE status code controller. // declaration of DXE status code controller.
// //
extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode; extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode;
#endif #endif

View File

@ -30,7 +30,7 @@
EDK_RELEASE_VERSION = 0x00020000 EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000 EFI_SPECIFICATION_VERSION = 0x00020000
ENTRY_POINT = InitializeDxeStatusCode ENTRY_POINT = DxeStatusCodeDriverEntry
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.
@ -52,7 +52,6 @@
DataHubStatusCodeWorker.c DataHubStatusCodeWorker.c
DxeStatusCode.c DxeStatusCode.c
DxeStatusCode.h DxeStatusCode.h
EntryPoint.c
[Sources.Ia32] [Sources.Ia32]
DxeStatusCodeCommon.c DxeStatusCodeCommon.c

View File

@ -1,48 +1,52 @@
/** @file /** @file
Status code driver for IA32/X64/EBC architecture. Status code driver for IA32/X64/EBC architecture.
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#include "DxeStatusCode.h" #include "DxeStatusCode.h"
//
// Event for Exit Boot Services Callback
//
STATIC EFI_EVENT mExitBootServicesEvent = NULL;
/** /**
Report status code to all supported device. Report status code to all supported device.
Calls into the workers which dispatches the platform specific Calls into the workers which dispatches the platform specific
listeners. listeners.
@param Type Indicates the type of status code being reported. @param Type Indicates the type of status code being reported.
The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This includes information about the class and subclass that is used to classify the entity This includes information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance The instance differentiates between them. An instance of 0 indicates that instance
information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1. information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller. @param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to different callers. This parameter allows the status code driver to apply different rules to different callers.
@param Data This optional parameter may be used to pass additional data. @param Data This optional parameter may be used to pass additional data.
Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below. Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below.
The contents of this data type may have additional GUID-specific data. The standard GUIDs and The contents of this data type may have additional GUID-specific data. The standard GUIDs and
their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification. their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.
@return Always return EFI_SUCCESS. @return Always return EFI_SUCCESS.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
ReportDispatcher ( ReportDispatcher (
IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_TYPE Type,
@ -61,12 +65,12 @@ EFI_STATUS_CODE_PROTOCOL mEfiStatusCodeProtocol = {
}; };
// //
// Delaration of DXE status code controller // Delaration of DXE status code controller
// //
DXE_STATUS_CODE_CONTROLLER gDxeStatusCode = { DXE_STATUS_CODE_CONTROLLER gDxeStatusCode = {
// //
// Initialize nest status as non nested. // Initialize nest status as non nested.
// //
0, 0,
{NULL, NULL} {NULL, NULL}
}; };
@ -74,7 +78,7 @@ DXE_STATUS_CODE_CONTROLLER gDxeStatusCode = {
/** /**
Install the ReportStatusCode runtime service. Install the ReportStatusCode runtime service.
@param ImageHandle Image handle of the loaded driver @param ImageHandle Image handle of the loaded driver
@param SystemTable Pointer to the System Table @param SystemTable Pointer to the System Table
@ -107,37 +111,46 @@ DxeStatusCodeDriverEntry (
); );
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
Status = gBS->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY,
VirtualAddressChangeCallBack,
NULL,
&mExitBootServicesEvent
);
ASSERT_EFI_ERROR (Status);
return Status; return Status;
} }
/** /**
Report status code to all supported device. Report status code to all supported device.
Calls into the workers which dispatches the platform specific Calls into the workers which dispatches the platform specific
listeners. listeners.
@param CodeType Indicates the type of status code being reported. @param CodeType Indicates the type of status code being reported.
The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This includes information about the class and subclass that is used to classify the entity This includes information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance The instance differentiates between them. An instance of 0 indicates that instance
information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1. information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller. @param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to different callers. This parameter allows the status code driver to apply different rules to different callers.
@param Data This optional parameter may be used to pass additional data. @param Data This optional parameter may be used to pass additional data.
Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below. Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below.
The contents of this data type may have additional GUID-specific data. The standard GUIDs and The contents of this data type may have additional GUID-specific data. The standard GUIDs and
their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification. their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.
@return Always return EFI_SUCCESS. @return Always return EFI_SUCCESS.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
ReportDispatcher ( ReportDispatcher (
IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_TYPE CodeType,
@ -201,7 +214,7 @@ ReportDispatcher (
/** /**
Virtual address change notification call back. It converts global pointer Virtual address change notification call back. It converts global pointer
to virtual address. to virtual address.
@param Event Event whose notification function is being invoked. @param Event Event whose notification function is being invoked.
@ -220,7 +233,7 @@ VirtualAddressChangeCallBack (
// Convert memory status code table to virtual address; // Convert memory status code table to virtual address;
// //
EfiConvertPointer ( EfiConvertPointer (
0, 0,
(VOID **) &gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE] (VOID **) &gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE]
); );
} }

View File

@ -1,58 +0,0 @@
/**@file
Entry Point Source file.
This file contains the user entry point
Copyright (c) 2006, Intel Corporation.
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
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 "DxeStatusCode.h"
//
// Event for Exit Boot Services Callback
//
STATIC EFI_EVENT mExitBootServicesEvent = NULL;
/**
The user Entry Point for module DxeStatusCode. The user code starts with this function.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The entry point is executed successfully.
@retval other Some error occurs when executing this entry point.
**/
EFI_STATUS
EFIAPI
InitializeDxeStatusCode(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
Status = gBS->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY,
VirtualAddressChangeCallBack,
NULL,
&mExitBootServicesEvent
);
ASSERT_EFI_ERROR (Status);
//
// Call the original Entry Point
//
Status = DxeStatusCodeDriverEntry (ImageHandle, SystemTable);
return Status;
}

View File

@ -1,44 +0,0 @@
/**@file
Common header file shared by all source files.
This file includes package header files, library classes and protocol, PPI & GUID definitions.
Copyright (c) 2006, Intel Corporation.
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __COMMON_HEADER_H_
#define __COMMON_HEADER_H_
//
// The package level header files this module uses
//
#include <FrameworkPei.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Guid/MemoryStatusCodeRecord.h>
#include <Guid/StatusCodeDataTypeId.h>
#include <Ppi/StatusCode.h>
//
// The Library classes this module consumes
//
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/SerialPortLib.h>
#include <Library/HobLib.h>
#include <Library/PcdLib.h>
#include <Library/PeiServicesLib.h>
#include <Library/OemHookStatusCodeLib.h>
#include <Library/PeimEntryPoint.h>
#endif

View File

@ -1,32 +1,27 @@
/** @file /** @file
Memory status code worker in PEI. Memory status code worker in PEI.
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: MemoryStatusCodeWorker.c Module Name: MemoryStatusCodeWorker.c
**/ **/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "PeiStatusCode.h" #include "PeiStatusCode.h"
/** /**
Create one memory status code GUID'ed HOB, use PacketIndex Create one memory status code GUID'ed HOB, use PacketIndex
to identify the packet. to identify the packet.
@param PacketIndex Index of records packet. @param PacketIndex Index of records packet.
@return Always return pointer of memory status code packet. @return Always return pointer of memory status code packet.
**/ **/
@ -43,8 +38,8 @@ CreateMemoryStatusCodePacket (
// //
PacketHeader = PacketHeader =
(MEMORY_STATUSCODE_PACKET_HEADER *) BuildGuidHob ( (MEMORY_STATUSCODE_PACKET_HEADER *) BuildGuidHob (
&gMemoryStatusCodeRecordGuid, &gMemoryStatusCodeRecordGuid,
PcdGet16 (PcdStatusCodeMemorySize) * PcdGet16 (PcdStatusCodeMemorySize) *
1024 + 1024 +
sizeof (MEMORY_STATUSCODE_PACKET_HEADER) sizeof (MEMORY_STATUSCODE_PACKET_HEADER)
); );
@ -61,9 +56,9 @@ CreateMemoryStatusCodePacket (
/** /**
Initialize memory status code. Initialize memory status code.
Create one GUID'ed HOB with PCD defined size. If create required size Create one GUID'ed HOB with PCD defined size. If create required size
GUID'ed HOB failed, then ASSERT(). GUID'ed HOB failed, then ASSERT().
@return The function always return EFI_SUCCESS @return The function always return EFI_SUCCESS
**/ **/
@ -83,21 +78,21 @@ MemoryStatusCodeInitializeWorker (
/** /**
Report status code into GUID'ed HOB.. Report status code into GUID'ed HOB..
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to classify the entity This included information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
not meaningful, or not relevant. Valid instance numbers start with 1. not meaningful, or not relevant. Valid instance numbers start with 1.
@return The function always return EFI_SUCCESS. @return The function always return EFI_SUCCESS.
**/ **/
@ -140,11 +135,11 @@ MemoryStatusCodeReportWorker (
if (NULL == Record) { if (NULL == Record) {
// //
// In order to save status code , create new packet. // In order to save status code , create new packet.
// //
PacketHeader = CreateMemoryStatusCodePacket (PacketIndex); PacketHeader = CreateMemoryStatusCodePacket (PacketIndex);
Record = (MEMORY_STATUSCODE_RECORD *) (PacketHeader + 1); Record = (MEMORY_STATUSCODE_RECORD *) (PacketHeader + 1);
Record = &Record[PacketHeader->RecordIndex++]; Record = &Record[PacketHeader->RecordIndex++];
} }

View File

@ -2,28 +2,23 @@
/** @file /** @file
Generic PeiStatusCode Module. Generic PeiStatusCode Module.
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PeiStatusCode.c Module Name: PeiStatusCode.c
**/ **/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "PeiStatusCode.h" #include "PeiStatusCode.h"
STATIC STATIC
EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi = { EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi = {
ReportDispatcher ReportDispatcher
}; };
@ -36,27 +31,27 @@ EFI_PEI_PPI_DESCRIPTOR mStatusCodePpiDescriptor = {
/** /**
Report status code to all supported device. Report status code to all supported device.
@param PeiServices @param PeiServices
@param CodeType Indicates the type of status code being reported. @param CodeType Indicates the type of status code being reported.
The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This includes information about the class and subclass that is used to classify the entity This includes information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance The instance differentiates between them. An instance of 0 indicates that instance
information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1. information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller. @param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to different callers. This parameter allows the status code driver to apply different rules to different callers.
@param Data This optional parameter may be used to pass additional data. @param Data This optional parameter may be used to pass additional data.
Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below. Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below.
The contents of this data type may have additional GUID-specific data. The standard GUIDs and The contents of this data type may have additional GUID-specific data. The standard GUIDs and
their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification. their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.
@return Always return EFI_SUCCESS. @return Always return EFI_SUCCESS.
@ -103,12 +98,12 @@ ReportDispatcher (
} }
/** /**
Initialize PEI status codes and publish the status code Initialize PEI status codes and publish the status code
PPI. PPI.
@param FfsHeader FV this PEIM was loaded from. @param FfsHeader FV this PEIM was loaded from.
@param PeiServices General purpose services available to every PEIM. @param PeiServices General purpose services available to every PEIM.
@return The function always returns success. @return The function always returns success.
**/ **/
@ -140,12 +135,12 @@ PeiStatusCodeDriverEntry (
} }
// //
// Install PeiStatusCodePpi. // Install PeiStatusCodePpi.
// PeiServices use this Ppi to output status code. // PeiServices use this Ppi to output status code.
// use library // use library
Status = PeiServicesInstallPpi (&mStatusCodePpiDescriptor); Status = PeiServicesInstallPpi (&mStatusCodePpiDescriptor);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -2,14 +2,14 @@
/** @file /** @file
Heade file of status code PEIM Heade file of status code PEIM
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PeiStatusCode.h Module Name: PeiStatusCode.h
@ -20,35 +20,55 @@
// //
// Include common header file for this module. // The package level header files this module uses
// //
#include "CommonHeader.h" #include <FrameworkPei.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Guid/MemoryStatusCodeRecord.h>
#include <Guid/StatusCodeDataTypeId.h>
#include <Ppi/StatusCode.h>
//
// The Library classes this module consumes
//
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/SerialPortLib.h>
#include <Library/HobLib.h>
#include <Library/PcdLib.h>
#include <Library/PeiServicesLib.h>
#include <Library/OemHookStatusCodeLib.h>
#include <Library/PeimEntryPoint.h>
/** /**
Convert status code value and extended data to readable ASCII string, send string to serial I/O device. Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to classify the entity This included information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
not meaningful, or not relevant. Valid instance numbers start with 1. not meaningful, or not relevant. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller. @param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to different callers. This parameter allows the status code driver to apply different rules to different callers.
Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification. Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
@param Data This optional parameter may be used to pass additional data @param Data This optional parameter may be used to pass additional data
@return The function always return EFI_SUCCESS. @return The function always return EFI_SUCCESS.
**/ **/
@ -64,9 +84,9 @@ SerialStatusCodeReportWorker (
/** /**
Initialize memory status code. Initialize memory status code.
Create one GUID'ed HOB with PCD defined size. If create required size Create one GUID'ed HOB with PCD defined size. If create required size
GUID'ed HOB failed, then ASSERT(). GUID'ed HOB failed, then ASSERT().
@return The function always return EFI_SUCCESS @return The function always return EFI_SUCCESS
**/ **/
@ -77,21 +97,21 @@ MemoryStatusCodeInitializeWorker (
/** /**
Report status code into GUID'ed HOB. Report status code into GUID'ed HOB.
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to classify the entity This included information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
not meaningful, or not relevant. Valid instance numbers start with 1. not meaningful, or not relevant. Valid instance numbers start with 1.
@return The function always return EFI_SUCCESS. @return The function always return EFI_SUCCESS.
**/ **/
@ -104,27 +124,27 @@ MemoryStatusCodeReportWorker (
/** /**
Report status code to all supported device. Report status code to all supported device.
@param PeiServices @param PeiServices
@param Type Indicates the type of status code being reported. @param Type Indicates the type of status code being reported.
The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This includes information about the class and subclass that is used to classify the entity This includes information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance The instance differentiates between them. An instance of 0 indicates that instance
information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1. information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller. @param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to different callers. This parameter allows the status code driver to apply different rules to different callers.
@param Data This optional parameter may be used to pass additional data. @param Data This optional parameter may be used to pass additional data.
Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below. Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below.
The contents of this data type may have additional GUID-specific data. The standard GUIDs and The contents of this data type may have additional GUID-specific data. The standard GUIDs and
their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification. their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.
@return Always return EFI_SUCCESS. @return Always return EFI_SUCCESS.

View File

@ -47,7 +47,6 @@
MemoryStausCodeWorker.c MemoryStausCodeWorker.c
SerialStatusCodeWorker.c SerialStatusCodeWorker.c
PeiStatusCode.h PeiStatusCode.h
CommonHeader.h
################################################################################ ################################################################################

View File

@ -2,51 +2,46 @@
/** @file /** @file
Serial I/O status code reporting worker. Serial I/O status code reporting worker.
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: SerialStatusCodeWorker.c Module Name: SerialStatusCodeWorker.c
**/ **/
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "PeiStatusCode.h" #include "PeiStatusCode.h"
/** /**
Convert status code value and extended data to readable ASCII string, send string to serial I/O device. Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
@param Value Describes the current status of a hardware or software entity. @param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to classify the entity This included information about the class and subclass that is used to classify the entity
as well as an operation. For progress codes, the operation is the current activity. as well as an operation. For progress codes, the operation is the current activity.
For error codes, it is the exception. For debug codes, it is not defined at this time. For error codes, it is the exception. For debug codes, it is not defined at this time.
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
@param Instance The enumeration of a hardware or software entity within the system. @param Instance The enumeration of a hardware or software entity within the system.
A system may contain multiple entities that match a class/subclass pairing. A system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
not meaningful, or not relevant. Valid instance numbers start with 1. not meaningful, or not relevant. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller. @param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to different callers. This parameter allows the status code driver to apply different rules to different callers.
Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification. Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
@param Data This optional parameter may be used to pass additional data @param Data This optional parameter may be used to pass additional data
@return The function always return EFI_SUCCESS. @return The function always return EFI_SUCCESS.
**/ **/
@ -90,12 +85,12 @@ SerialStatusCodeReportWorker (
// Print DEBUG() information into output buffer. // Print DEBUG() information into output buffer.
// //
CharCount = AsciiVSPrint ( CharCount = AsciiVSPrint (
Buffer, Buffer,
EFI_STATUS_CODE_DATA_MAX_SIZE, EFI_STATUS_CODE_DATA_MAX_SIZE,
Format, Format,
Marker Marker
); );
} else if (Data != NULL && } else if (Data != NULL &&
CompareGuid (&Data->Type, &gEfiStatusCodeSpecificDataGuid) && CompareGuid (&Data->Type, &gEfiStatusCodeSpecificDataGuid) &&
(CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) { (CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {
// //
@ -111,18 +106,18 @@ SerialStatusCodeReportWorker (
// Print ERROR information into output buffer. // Print ERROR information into output buffer.
// //
CharCount = AsciiSPrint ( CharCount = AsciiSPrint (
Buffer, Buffer,
EFI_STATUS_CODE_DATA_MAX_SIZE, EFI_STATUS_CODE_DATA_MAX_SIZE,
"ERROR: C%x:V%x I%x", "ERROR: C%x:V%x I%x",
CodeType, CodeType,
Value, Value,
Instance Instance
); );
// //
// Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers. // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
// //
if (CallerId != NULL) { if (CallerId != NULL) {
CharCount += AsciiSPrint ( CharCount += AsciiSPrint (
&Buffer[CharCount - 1], &Buffer[CharCount - 1],
@ -148,19 +143,19 @@ SerialStatusCodeReportWorker (
); );
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) { } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
CharCount = AsciiSPrint ( CharCount = AsciiSPrint (
Buffer, Buffer,
EFI_STATUS_CODE_DATA_MAX_SIZE, EFI_STATUS_CODE_DATA_MAX_SIZE,
"PROGRESS CODE: V%x I%x\n\r", "PROGRESS CODE: V%x I%x\n\r",
Value, Value,
Instance Instance
); );
} else { } else {
CharCount = AsciiSPrint ( CharCount = AsciiSPrint (
Buffer, Buffer,
EFI_STATUS_CODE_DATA_MAX_SIZE, EFI_STATUS_CODE_DATA_MAX_SIZE,
"Undefined: C%x:V%x I%x\n\r", "Undefined: C%x:V%x I%x\n\r",
CodeType, CodeType,
Value, Value,
Instance Instance
); );
} }