Coding style modification.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5058 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2
2008-04-14 03:12:57 +00:00
parent e1a09a0eaa
commit bcd7041487
61 changed files with 3405 additions and 4718 deletions

View File

@@ -82,7 +82,7 @@ VgaClassDriverBindingSupported (
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
/*++
/**
Routine Description:
@@ -98,7 +98,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -108,7 +108,7 @@ VgaClassDriverBindingStart (
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
/*++
/**
Routine Description:
@@ -124,7 +124,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -135,7 +135,7 @@ VgaClassDriverBindingStop (
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
)
/*++
/**
Routine Description:
@@ -152,7 +152,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
//
@@ -164,7 +164,7 @@ VgaClassReset (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
)
/*++
/**
Routine Description:
@@ -179,7 +179,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -188,7 +188,7 @@ VgaClassOutputString (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN CHAR16 *WString
)
/*++
/**
Routine Description:
@@ -203,7 +203,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -212,7 +212,7 @@ VgaClassTestString (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN CHAR16 *WString
)
/*++
/**
Routine Description:
@@ -227,7 +227,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -235,7 +235,7 @@ EFIAPI
VgaClassClearScreen (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
)
/*++
/**
Routine Description:
@@ -249,7 +249,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -258,7 +258,7 @@ VgaClassSetAttribute (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN Attribute
)
/*++
/**
Routine Description:
@@ -273,7 +273,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -283,7 +283,7 @@ VgaClassSetCursorPosition (
IN UINTN Column,
IN UINTN Row
)
/*++
/**
Routine Description:
@@ -299,7 +299,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -308,7 +308,7 @@ VgaClassEnableCursor (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN BOOLEAN Visible
)
/*++
/**
Routine Description:
@@ -323,7 +323,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -334,7 +334,7 @@ VgaClassQueryMode (
OUT UINTN *Columns,
OUT UINTN *Rows
)
/*++
/**
Routine Description:
@@ -351,7 +351,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
EFI_STATUS
@@ -360,7 +360,7 @@ VgaClassSetMode (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN ModeNumber
)
/*++
/**
Routine Description:
@@ -375,7 +375,7 @@ Returns:
GC_TODO: add return values
--*/
**/
;
#endif

View File

@@ -54,7 +54,7 @@ PciCfgRead (
UINTN PciLibAddress;
PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &Address);
switch (Width) {
switch (Width) {
case EfiPeiPciCfgWidthUint8:
* (UINT8 *) Buffer = PciRead8 (PciLibAddress);
break;
@@ -70,7 +70,7 @@ PciCfgRead (
default:
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
return EFI_SUCCESS;
}
@@ -119,8 +119,8 @@ PciCfgWrite (
default:
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
return EFI_SUCCESS;
}
@@ -154,7 +154,7 @@ PciCfgModify (
UINTN PciLibAddress;
PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &Address);
switch (Width) {
switch (Width) {
case EfiPeiPciCfgWidthUint8:
PciAndThenOr8 (PciLibAddress, (UINT8)~ClearBits, (UINT8)SetBits);
break;
@@ -170,5 +170,6 @@ PciCfgModify (
default:
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
return EFI_SUCCESS;
}

View File

@@ -260,7 +260,15 @@ PciCfg2Modify (
return EFI_SUCCESS;
}
/**
Module's entry function.
This routine will install EFI_PEI_PCI_CFG2_PPI or EFI_PEI_PCI_CFG_PPI
according to PeiServices's version.
@param FfsHeader Image's header
@param PeiServices Pointer of EFI_PEI_SERVICES
@return Whether success to install service
**/
EFI_STATUS
EFIAPI
PeimInitializePciCfg (
@@ -298,3 +306,4 @@ PeimInitializePciCfg (
return Status;
}

View File

@@ -1,20 +1,4 @@
/**@file
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:
SectionExtraction.c
Abstract:
Section Extraction Protocol implementation.
Stream database is implemented as a linked list of section streams,
@@ -42,7 +26,17 @@ Abstract:
3) A support protocol is not found, and the data is not available to be read
without it. This results in EFI_PROTOCOL_ERROR.
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 "SectionExtraction.h"
@@ -235,27 +229,23 @@ EFI_SECTION_EXTRACTION_PROTOCOL mSectionExtraction = {
CloseSectionStream
};
/**
Entry point of the section extraction code. Initializes an instance of the
section extraction interface and installs it on a new handle.
@param ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver
@param SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table
@retval EFI_SUCCESS Driver initialized successfully
@retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
**/
EFI_STATUS
EFIAPI
SectionExtractionEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
Routine Description:
Entry point of the section extraction code. Initializes an instance of the
section extraction interface and installs it on a new handle.
Arguments:
ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver
SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table
Returns:
EFI_SUCCESS: Driver initialized successfully
EFI_OUT_OF_RESOURCES: Could not allocate needed resources
--*/
{
EFI_STATUS Status;
@@ -273,6 +263,22 @@ Returns:
return Status;
}
/**
SEP member function. This function creates and returns a new section stream
handle to represent the new section stream.
@param This Indicates the calling context.
@param SectionStreamLength Size in bytes of the section stream.
@param SectionStream Buffer containing the new section stream.
@param SectionStreamHandle A pointer to a caller allocated UINTN that on output
contains the new section stream handle.
@retval EFI_SUCCESS
@retval EFI_OUT_OF_RESOURCES memory allocation failed.
@retval EFI_INVALID_PARAMETER section stream does not end concident with end of
last section.
**/
STATIC
EFI_STATUS
EFIAPI
@@ -282,26 +288,6 @@ OpenSectionStream (
IN VOID *SectionStream,
OUT UINTN *SectionStreamHandle
)
/*++
Routine Description:
SEP member function. This function creates and returns a new section stream
handle to represent the new section stream.
Arguments:
This - Indicates the calling context.
SectionStreamLength - Size in bytes of the section stream.
SectionStream - Buffer containing the new section stream.
SectionStreamHandle - A pointer to a caller allocated UINTN that on output
contains the new section stream handle.
Returns:
EFI_SUCCESS
EFI_OUT_OF_RESOURCES - memory allocation failed.
EFI_INVALID_PARAMETER - section stream does not end concident with end of
last section.
--*/
{
//
// Check to see section stream looks good...
@@ -319,6 +305,49 @@ Returns:
);
}
/**
SEP member function. Retrieves requested section from section stream.
@param This: Pointer to SEP instance.
@param SectionStreamHandle: The section stream from which to extract the requested
section.
@param SectionType: A pointer to the type of section to search for.
@param SectionDefinitionGuid: If the section type is EFI_SECTION_GUID_DEFINED, then
SectionDefinitionGuid indicates which of these types
of sections to search for.
@param SectionInstance: Indicates which instance of the requested section to
return.
@param Buffer: Double indirection to buffer. If *Buffer is non-null on
input, then the buffer is caller allocated. If
*Buffer is NULL, then the buffer is callee allocated.
In either case, the requried buffer size is returned
in *BufferSize.
@param BufferSize: On input, indicates the size of *Buffer if *Buffer is
non-null on input. On output, indicates the required
size (allocated size if callee allocated) of *Buffer.
@param AuthenticationStatus: Indicates the authentication status of the retrieved
section.
@retval EFI_SUCCESS: Section was retrieved successfully
@retval EFI_PROTOCOL_ERROR: A GUID defined section was encountered in the section
stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED
bit set, but there was no corresponding GUIDed Section
Extraction Protocol in the handle database. *Buffer is
unmodified.
@retval EFI_NOT_FOUND: An error was encountered when parsing the SectionStream.
This indicates the SectionStream is not correctly
formatted.
@retval EFI_NOT_FOUND: The requested section does not exist.
@retval EFI_OUT_OF_RESOURCES: The system has insufficient resources to process the
request.
@retval EFI_INVALID_PARAMETER: The SectionStreamHandle does not exist.
@retval EFI_WARN_TOO_SMALL: The size of the caller allocated input buffer is
insufficient to contain the requested section. The
input buffer is filled and contents are section contents
are truncated.
**/
STATIC
EFI_STATUS
EFIAPI
@@ -332,52 +361,7 @@ GetSection (
IN OUT UINTN *BufferSize,
OUT UINT32 *AuthenticationStatus
)
/*++
Routine Description:
SEP member function. Retrieves requested section from section stream.
Arguments:
This: Pointer to SEP instance.
SectionStreamHandle: The section stream from which to extract the requested
section.
SectionType: A pointer to the type of section to search for.
SectionDefinitionGuid: If the section type is EFI_SECTION_GUID_DEFINED, then
SectionDefinitionGuid indicates which of these types
of sections to search for.
SectionInstance: Indicates which instance of the requested section to
return.
Buffer: Double indirection to buffer. If *Buffer is non-null on
input, then the buffer is caller allocated. If
*Buffer is NULL, then the buffer is callee allocated.
In either case, the requried buffer size is returned
in *BufferSize.
BufferSize: On input, indicates the size of *Buffer if *Buffer is
non-null on input. On output, indicates the required
size (allocated size if callee allocated) of *Buffer.
AuthenticationStatus: Indicates the authentication status of the retrieved
section.
Returns:
EFI_SUCCESS: Section was retrieved successfully
EFI_PROTOCOL_ERROR: A GUID defined section was encountered in the section
stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED
bit set, but there was no corresponding GUIDed Section
Extraction Protocol in the handle database. *Buffer is
unmodified.
EFI_NOT_FOUND: An error was encountered when parsing the SectionStream.
This indicates the SectionStream is not correctly
formatted.
EFI_NOT_FOUND: The requested section does not exist.
EFI_OUT_OF_RESOURCES: The system has insufficient resources to process the
request.
EFI_INVALID_PARAMETER: The SectionStreamHandle does not exist.
EFI_WARN_TOO_SMALL: The size of the caller allocated input buffer is
insufficient to contain the requested section. The
input buffer is filled and contents are section contents
are truncated.
--*/
{
CORE_SECTION_STREAM_NODE *StreamNode;
EFI_TPL OldTpl;
@@ -461,7 +445,18 @@ GetSection_Done:
return Status;
}
/**
SEP member function. Deletes an existing section stream
@param This - Indicates the calling context.
@param StreamHandleToClose - Indicates the stream to close
@retval EFI_SUCCESS
@retval EFI_OUT_OF_RESOURCES - memory allocation failed.
@retval EFI_INVALID_PARAMETER - section stream does not end concident with end of
last section.
**/
STATIC
EFI_STATUS
EFIAPI
@@ -469,22 +464,7 @@ CloseSectionStream (
IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
IN UINTN StreamHandleToClose
)
/*++
Routine Description:
SEP member function. Deletes an existing section stream
Arguments:
This - Indicates the calling context.
StreamHandleToClose - Indicates the stream to close
Returns:
EFI_SUCCESS
EFI_OUT_OF_RESOURCES - memory allocation failed.
EFI_INVALID_PARAMETER - section stream does not end concident with end of
last section.
--*/
{
CORE_SECTION_STREAM_NODE *StreamNode;
EFI_TPL OldTpl;
@@ -519,7 +499,19 @@ Returns:
return Status;
}
/**
Worker function. Determine if the input stream:child matches the input type.
@param Stream - Indicates the section stream associated with the child
@param Child - Indicates the child to check
@param SearchType - Indicates the type of section to check against for
@param SectionDefinitionGuid - Indicates the GUID to check against if the type is
EFI_SECTION_GUID_DEFINED
@retval TRUE - The child matches
@retval FALSE - The child doesn't match
**/
STATIC
BOOLEAN
ChildIsType (
@@ -528,22 +520,6 @@ ChildIsType (
IN EFI_SECTION_TYPE SearchType,
IN EFI_GUID *SectionDefinitionGuid
)
/*++
Routine Description:
Worker function. Determine if the input stream:child matches the input type.
Arguments:
Stream - Indicates the section stream associated with the child
Child - Indicates the child to check
SearchType - Indicates the type of section to check against for
SectionDefinitionGuid - Indicates the GUID to check against if the type is
EFI_SECTION_GUID_DEFINED
Returns:
TRUE - The child matches
FALSE - The child doesn't match
--*/
{
EFI_GUID_DEFINED_SECTION *GuidedSection;
@@ -560,7 +536,30 @@ Returns:
return CompareGuid (&GuidedSection->SectionDefinitionGuid, SectionDefinitionGuid);
}
/**
Worker function Recursively searches / builds section stream database
looking for requested section.
@param SourceStream - Indicates the section stream in which to do the search.
@param SearchType - Indicates the type of section to search for.
@param SectionInstance - Indicates which instance of section to find. This is
an in/out parameter to deal with recursions.
@param SectionDefinitionGuid - Guid of section definition
@param FoundChild - Output indicating the child node that is found.
@param FoundStream - Output indicating which section stream the child was
found in. If this stream was generated as a result of
an encapsulation section, the streamhandle is visible
within the SEP driver only.
@param AuthenticationStatus- Indicates the authentication status of the found section.
@retval EFI_SUCCESS - Child node was found and returned.
@retval EFI_OUT_OF_RESOURCES- Memory allocation failed.
@retval EFI_NOT_FOUND - Requested child node does not exist.
@retval EFI_PROTOCOL_ERROR - a required GUIDED section extraction protocol does not
exist
**/
STATIC
EFI_STATUS
FindChildNode (
@@ -572,33 +571,7 @@ FindChildNode (
OUT CORE_SECTION_STREAM_NODE **FoundStream,
OUT UINT32 *AuthenticationStatus
)
/*++
Routine Description:
Worker function Recursively searches / builds section stream database
looking for requested section.
Arguments:
SourceStream - Indicates the section stream in which to do the search.
SearchType - Indicates the type of section to search for.
SectionInstance - Indicates which instance of section to find. This is
an in/out parameter to deal with recursions.
SectionDefinitionGuid - Guid of section definition
FoundChild - Output indicating the child node that is found.
FoundStream - Output indicating which section stream the child was
found in. If this stream was generated as a result of
an encapsulation section, the streamhandle is visible
within the SEP driver only.
AuthenticationStatus- Indicates the authentication status of the found section.
Returns:
EFI_SUCCESS - Child node was found and returned.
EFI_OUT_OF_RESOURCES- Memory allocation failed.
EFI_NOT_FOUND - Requested child node does not exist.
EFI_PROTOCOL_ERROR - a required GUIDED section extraction protocol does not
exist
--*/
{
CORE_SECTION_CHILD_NODE *CurrentChildNode;
CORE_SECTION_CHILD_NODE *RecursedChildNode;
@@ -715,7 +688,24 @@ Returns:
}
}
/**
Worker function. Constructor for new child nodes.
@param Stream - Indicates the section stream in which to add the child.
@param ChildOffset - Indicates the offset in Stream that is the beginning
of the child section.
@param ChildNode - Indicates the Callee allocated and initialized child.
@retval EFI_SUCCESS - Child node was found and returned.
@retval EFI_OUT_OF_RESOURCES- Memory allocation failed.
@retval EFI_PROTOCOL_ERROR - Encapsulation sections produce new stream handles when
the child node is created. If the section type is GUID
defined, and the extraction GUID does not exist, and
producing the stream requires the GUID, then a protocol
error is generated and no child is produced.
Values returned by OpenSectionStreamEx.
**/
STATIC
EFI_STATUS
CreateChildNode (
@@ -723,28 +713,6 @@ CreateChildNode (
IN UINT32 ChildOffset,
OUT CORE_SECTION_CHILD_NODE **ChildNode
)
/*++
Routine Description:
Worker function. Constructor for new child nodes.
Arguments:
Stream - Indicates the section stream in which to add the child.
ChildOffset - Indicates the offset in Stream that is the beginning
of the child section.
ChildNode - Indicates the Callee allocated and initialized child.
Returns:
EFI_SUCCESS - Child node was found and returned.
EFI_OUT_OF_RESOURCES- Memory allocation failed.
EFI_PROTOCOL_ERROR - Encapsulation sections produce new stream handles when
the child node is created. If the section type is GUID
defined, and the extraction GUID does not exist, and
producing the stream requires the GUID, then a protocol
error is generated and no child is produced.
Values returned by OpenSectionStreamEx.
--*/
{
EFI_STATUS Status;
EFI_COMMON_SECTION_HEADER *SectionHeader;
@@ -997,27 +965,20 @@ Returns:
return EFI_SUCCESS;
}
/**
Worker function. Constructor for RPN event if needed to keep AuthenticationStatus
cache correct when a missing GUIDED_SECTION_EXTRACTION_PROTOCOL appears...
@param ParentStream - Indicates the parent of the ecnapsulation section (child)
@param ChildNode - Indicates the child node that is the encapsulation section.
**/
STATIC
VOID
CreateGuidedExtractionRpnEvent (
IN CORE_SECTION_STREAM_NODE *ParentStream,
IN CORE_SECTION_CHILD_NODE *ChildNode
)
/*++
Routine Description:
Worker function. Constructor for RPN event if needed to keep AuthenticationStatus
cache correct when a missing GUIDED_SECTION_EXTRACTION_PROTOCOL appears...
Arguments:
ParentStream - Indicates the parent of the ecnapsulation section (child)
ChildNode - Indicates the child node that is the encapsulation section.
Returns:
None
--*/
{
RPN_EVENT_CONTEXT *Context;
@@ -1040,7 +1001,15 @@ Returns:
);
}
/**
RPN callback function. Removes a stale section stream and re-initializes it
with an updated AuthenticationStatus.
@param Event - The event that fired
@param RpnContext - A pointer to the context that allows us to identify
the relevent encapsulation...
**/
STATIC
VOID
EFIAPI
@@ -1048,21 +1017,6 @@ NotifyGuidedExtraction (
IN EFI_EVENT Event,
IN VOID *RpnContext
)
/*++
Routine Description:
RPN callback function. Removes a stale section stream and re-initializes it
with an updated AuthenticationStatus.
Arguments:
Event - The event that fired
RpnContext - A pointer to the context that allows us to identify
the relevent encapsulation...
Returns:
None
--*/
{
EFI_STATUS Status;
EFI_GUID_DEFINED_SECTION *GuidedHeader;
@@ -1120,24 +1074,18 @@ Returns:
gBS->FreePool (Context);
}
/**
Worker function. Destructor for child nodes.
@param ChildNode - Indicates the node to destroy
**/
STATIC
VOID
FreeChildNode (
IN CORE_SECTION_CHILD_NODE *ChildNode
)
/*++
Routine Description:
Worker function. Destructor for child nodes.
Arguments:
ChildNode - Indicates the node to destroy
Returns:
none
--*/
{
ASSERT (ChildNode->Signature == CORE_SECTION_CHILD_SIGNATURE);
//
@@ -1158,7 +1106,22 @@ Returns:
gBS->FreePool (ChildNode);
}
/**
Worker function. Constructor for section streams.
@param SectionStreamLength - Size in bytes of the section stream.
@param SectionStream - Buffer containing the new section stream.
@param AllocateBuffer - Indicates whether the stream buffer is to be copied
or the input buffer is to be used in place.
@param AuthenticationStatus- Indicates the default authentication status for the
new stream.
@param SectionStreamHandle - A pointer to a caller allocated section stream handle.
@retval EFI_SUCCESS - Stream was added to stream database.
@retval EFI_OUT_OF_RESOURCES - memory allocation failed.
**/
STATIC
EFI_STATUS
OpenSectionStreamEx (
@@ -1168,25 +1131,7 @@ OpenSectionStreamEx (
IN UINT32 AuthenticationStatus,
OUT UINTN *SectionStreamHandle
)
/*++
Routine Description:
Worker function. Constructor for section streams.
Arguments:
SectionStreamLength - Size in bytes of the section stream.
SectionStream - Buffer containing the new section stream.
AllocateBuffer - Indicates whether the stream buffer is to be copied
or the input buffer is to be used in place.
AuthenticationStatus- Indicates the default authentication status for the
new stream.
SectionStreamHandle - A pointer to a caller allocated section stream handle.
Returns:
EFI_SUCCESS - Stream was added to stream database.
EFI_OUT_OF_RESOURCES - memory allocation failed.
--*/
{
CORE_SECTION_STREAM_NODE *NewStream;
EFI_TPL OldTpl;
@@ -1250,28 +1195,24 @@ OpenSectionStreamEx (
return EFI_SUCCESS;
}
/**
Worker function. Search stream database for requested stream handle.
@param SearchHandle - Indicates which stream to look for.
@param FoundStream - Output pointer to the found stream.
@retval EFI_SUCCESS - StreamHandle was found and *FoundStream contains
the stream node.
@retval EFI_NOT_FOUND - SearchHandle was not found in the stream database.
**/
STATIC
EFI_STATUS
FindStreamNode (
IN UINTN SearchHandle,
OUT CORE_SECTION_STREAM_NODE **FoundStream
)
/*++
Routine Description:
Worker function. Search stream database for requested stream handle.
Arguments:
SearchHandle - Indicates which stream to look for.
FoundStream - Output pointer to the found stream.
Returns:
EFI_SUCCESS - StreamHandle was found and *FoundStream contains
the stream node.
EFI_NOT_FOUND - SearchHandle was not found in the stream database.
--*/
{
CORE_SECTION_STREAM_NODE *StreamNode;
@@ -1292,27 +1233,22 @@ FindStreamNode (
return EFI_NOT_FOUND;
}
/**
Check if a stream is valid.
@param SectionStream - The section stream to be checked
@param SectionStreamLength - The length of section stream
@return if a stream is valid.
**/
STATIC
BOOLEAN
IsValidSectionStream (
IN VOID *SectionStream,
IN UINTN SectionStreamLength
)
/*++
Routine Description:
Check if a stream is valid.
Arguments:
SectionStream - The section stream to be checked
SectionStreamLength - The length of section stream
Returns:
TRUE
FALSE
--*/
{
UINTN TotalLength;
UINTN SectionLength;
@@ -1348,6 +1284,25 @@ Returns:
return FALSE;
}
/**
Create a protocol notification event and return it.
@param ProtocolGuid - Protocol to register notification event on.
@param NotifyTpl - Maximum TPL to signal the NotifyFunction.
@param NotifyFuncition - EFI notification routine.
@param NotifyContext - Context passed into Event when it is created.
@param Registration - Registration key returned from RegisterProtocolNotify().
@param SignalFlag - Boolean value to decide whether kick the event after register or not.
@Return The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
is added to the system.
**/
EFI_EVENT
CoreCreateProtocolNotifyEvent (
IN EFI_GUID *ProtocolGuid,
@@ -1357,32 +1312,6 @@ CoreCreateProtocolNotifyEvent (
OUT VOID **Registration,
IN BOOLEAN SignalFlag
)
/*++
Routine Description:
Create a protocol notification event and return it.
Arguments:
ProtocolGuid - Protocol to register notification event on.
NotifyTpl - Maximum TPL to signal the NotifyFunction.
NotifyFuncition - EFI notification routine.
NotifyContext - Context passed into Event when it is created.
Registration - Registration key returned from RegisterProtocolNotify().
SignalFlag - Boolean value to decide whether kick the event after register or not.
Returns:
The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
is added to the system.
--*/
{
EFI_STATUS Status;
EFI_EVENT Event;

View File

@@ -1,20 +1,4 @@
/**@file
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:
SectionExtraction.c
Abstract:
Section Extraction Protocol implementation.
Stream database is implemented as a linked list of section streams,
@@ -42,7 +26,16 @@ Abstract:
3) A support protocol is not found, and the data is not available to be read
without it. This results in EFI_PROTOCOL_ERROR.
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 _SECION_EXTRACTION_H_

View File

@@ -1,4 +1,3 @@
/** @file
Serial I/O status code reporting worker.
@@ -220,3 +219,4 @@ SerialStatusCodeReportWorker (
return EFI_SUCCESS;
}

View File

@@ -149,3 +149,4 @@ MemoryStatusCodeReportWorker (
return EFI_SUCCESS;
}

View File

@@ -1,4 +1,3 @@
/** @file
Generic PeiStatusCode Module.

View File

@@ -1,4 +1,3 @@
/** @file
Heade file of status code PEIM
@@ -11,8 +10,6 @@
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: PeiStatusCode.h
**/
#ifndef __PEI_STATUS_CODE_H__
@@ -155,4 +152,6 @@ ReportDispatcher (
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
);
#endif
#endif //__PEI_STATUS_CODE_H__

View File

@@ -1,4 +1,3 @@
/** @file
Serial I/O status code reporting worker.
@@ -10,9 +9,6 @@
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: SerialStatusCodeWorker.c
**/
#include "PeiStatusCode.h"
@@ -168,3 +164,4 @@ SerialStatusCodeReportWorker (
return EFI_SUCCESS;
}

View File

@@ -1,5 +1,6 @@
/** @file
Framework PEIM to provide the Variable functionality
Copyright (c) 2006 - 2008 Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -10,12 +11,6 @@ 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:
Variable.c
Abstract:
Framework PEIM to provide the Variable functionality
**/
@@ -49,29 +44,22 @@ static EFI_PEI_PPI_DESCRIPTOR mPpiListVariable[] = {
EFI_GUID mEfiVariableIndexTableGuid = EFI_VARIABLE_INDEX_TABLE_GUID;
/**
Provide the functionality of the variable services.
@param FfsHeadher - The FFS file header
@param PeiServices - General purpose services available to every PEIM.
@return Status - EFI_SUCCESS if the interface could be successfully
installed
**/
EFI_STATUS
EFIAPI
PeimInitializeVariableServices (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
)
/*++
Routine Description:
Provide the functionality of the variable services.
Arguments:
FfsHeadher - The FFS file header
PeiServices - General purpose services available to every PEIM.
Returns:
Status - EFI_SUCCESS if the interface could be successfully
installed
--*/
{
//
// Publish the variable capability to other modules
@@ -80,25 +68,18 @@ Returns:
}
/**
This code gets the pointer to the first variable memory pointer byte
@param VarStoreHeader Pointer to the Variable Store Header.
@Return VARIABLE_HEADER* Pointer to last unavailable Variable Header
**/
VARIABLE_HEADER *
GetStartPointer (
IN VARIABLE_STORE_HEADER *VarStoreHeader
)
/*++
Routine Description:
This code gets the pointer to the first variable memory pointer byte
Arguments:
VarStoreHeader Pointer to the Variable Store Header.
Returns:
VARIABLE_HEADER* Pointer to last unavailable Variable Header
--*/
{
//
// The end of variable store
@@ -106,25 +87,19 @@ Returns:
return (VARIABLE_HEADER *) HEADER_ALIGN (VarStoreHeader + 1);
}
/**
This code gets the pointer to the last variable memory pointer byte
@param VarStoreHeader Pointer to the Variable Store Header.
@Return VARIABLE_HEADER* Pointer to last unavailable Variable Header
**/
VARIABLE_HEADER *
GetEndPointer (
IN VARIABLE_STORE_HEADER *VarStoreHeader
)
/*++
Routine Description:
This code gets the pointer to the last variable memory pointer byte
Arguments:
VarStoreHeader Pointer to the Variable Store Header.
Returns:
VARIABLE_HEADER* Pointer to last unavailable Variable Header
--*/
{
//
// The end of variable store
@@ -132,26 +107,22 @@ Returns:
return (VARIABLE_HEADER *) HEADER_ALIGN ((UINTN) VarStoreHeader + VarStoreHeader->Size);
}
/**
This code checks if variable header is valid or not.
@param Variable Pointer to the Variable Header.
@retval TRUE Variable header is valid.
@retval FALSE Variable header is not valid.
**/
STATIC
BOOLEAN
EFIAPI
IsValidVariableHeader (
IN VARIABLE_HEADER *Variable
)
/*++
Routine Description:
This code checks if variable header is valid or not.
Arguments:
Variable Pointer to the Variable Header.
Returns:
TRUE Variable header is valid.
FALSE Variable header is not valid.
--*/
{
if (Variable == NULL || Variable->StartId != VARIABLE_DATA ) {
return FALSE;
@@ -160,26 +131,18 @@ Returns:
return TRUE;
}
/**
This code gets the size of name of variable.
@param Variable Pointer to the Variable Header.
@Return UINTN Size of variable in bytes
**/
UINTN
NameSizeOfVariable (
IN VARIABLE_HEADER *Variable
)
/*++
Routine Description:
This code gets the size of name of variable.
Arguments:
Variable Pointer to the Variable Header.
Returns:
UINTN Size of variable in bytes
--*/
{
if (Variable->State == (UINT8) (-1) ||
Variable->DataSize == (UINT32) -1 ||
@@ -190,25 +153,18 @@ Returns:
return (UINTN) Variable->NameSize;
}
/**
This code gets the size of name of variable.
@param Variable Pointer to the Variable Header.
@Return UINTN Size of variable in bytes
**/
UINTN
DataSizeOfVariable (
IN VARIABLE_HEADER *Variable
)
/*++
Routine Description:
This code gets the size of name of variable.
Arguments:
Variable Pointer to the Variable Header.
Returns:
UINTN Size of variable in bytes
--*/
{
if (Variable->State == (UINT8) -1 ||
Variable->DataSize == (UINT32) -1 ||
@@ -219,50 +175,36 @@ Returns:
return (UINTN) Variable->DataSize;
}
/**
This code gets the pointer to the variable name.
@param Variable Pointer to the Variable Header.
@Return CHAR16* Pointer to Variable Name
**/
CHAR16 *
GetVariableNamePtr (
IN VARIABLE_HEADER *Variable
)
/*++
Routine Description:
This code gets the pointer to the variable name.
Arguments:
Variable Pointer to the Variable Header.
Returns:
CHAR16* Pointer to Variable Name
--*/
{
return (CHAR16 *) (Variable + 1);
}
/**
This code gets the pointer to the variable data.
@param Variable Pointer to the Variable Header.
@Return UINT8* Pointer to Variable Data
**/
UINT8 *
GetVariableDataPtr (
IN VARIABLE_HEADER *Variable
)
/*++
Routine Description:
This code gets the pointer to the variable data.
Arguments:
Variable Pointer to the Variable Header.
Returns:
UINT8* Pointer to Variable Data
--*/
{
UINTN Value;
@@ -276,25 +218,19 @@ Returns:
return (UINT8 *) Value;
}
/**
This code gets the pointer to the next variable header.
@param Variable Pointer to the Variable Header.
@Return VARIABLE_HEADER* Pointer to next variable header.
**/
VARIABLE_HEADER *
GetNextVariablePtr (
IN VARIABLE_HEADER *Variable
)
/*++
Routine Description:
This code gets the pointer to the next variable header.
Arguments:
Variable Pointer to the Variable Header.
Returns:
VARIABLE_HEADER* Pointer to next variable header.
--*/
{
UINTN Value;
@@ -312,30 +248,23 @@ Returns:
return (VARIABLE_HEADER *) HEADER_ALIGN (Value);
}
/**
This code gets the pointer to the variable name.
@param VarStoreHeader Pointer to the Variable Store Header.
@retval EfiRaw Variable store is raw
@retval EfiValid Variable store is valid
@retval EfiInvalid Variable store is invalid
**/
STATIC
VARIABLE_STORE_STATUS
EFIAPI
GetVariableStoreStatus (
IN VARIABLE_STORE_HEADER *VarStoreHeader
)
/*++
Routine Description:
This code gets the pointer to the variable name.
Arguments:
VarStoreHeader Pointer to the Variable Store Header.
Returns:
EfiRaw Variable store is raw
EfiValid Variable store is valid
EfiInvalid Variable store is invalid
--*/
{
if (VarStoreHeader->Signature == VARIABLE_STORE_SIGNATURE &&
VarStoreHeader->Format == VARIABLE_STORE_FORMATTED &&
@@ -357,6 +286,19 @@ Returns:
}
}
/**
This function compares a variable with variable entries in database
@param Variable - Pointer to the variable in our database
@param VariableName - Name of the variable to compare to 'Variable'
@param VendorGuid - GUID of the variable to compare to 'Variable'
@param PtrTrack - Variable Track Pointer structure that contains
Variable Information.
@Retval EFI_SUCCESS - Found match variable
@retval EFI_NOT_FOUND - Variable not found
**/
STATIC
EFI_STATUS
CompareWithValidVariable (
@@ -365,26 +307,7 @@ CompareWithValidVariable (
IN CONST EFI_GUID *VendorGuid,
OUT VARIABLE_POINTER_TRACK *PtrTrack
)
/*++
Routine Description:
This function compares a variable with variable entries in database
Arguments:
Variable - Pointer to the variable in our database
VariableName - Name of the variable to compare to 'Variable'
VendorGuid - GUID of the variable to compare to 'Variable'
PtrTrack - Variable Track Pointer structure that contains
Variable Information.
Returns:
EFI_SUCCESS - Found match variable
EFI_NOT_FOUND - Variable not found
--*/
{
VOID *Point;
@@ -414,6 +337,20 @@ Returns:
return EFI_NOT_FOUND;
}
/**
This code finds variable in storage blocks (Non-Volatile)
@param PeiServices - General purpose services available to every PEIM.
@param VariableName - Name of the variable to be found
@param VendorGuid - Vendor GUID to be found.
@param PtrTrack - Variable Track Pointer structure that contains
Variable Information.
@retval EFI_SUCCESS - Variable found successfully
@retval EFI_NOT_FOUND - Variable not found
@retval EFI_INVALID_PARAMETER - Invalid variable name
**/
STATIC
EFI_STATUS
EFIAPI
@@ -423,27 +360,7 @@ FindVariable (
IN CONST EFI_GUID *VendorGuid,
OUT VARIABLE_POINTER_TRACK *PtrTrack
)
/*++
Routine Description:
This code finds variable in storage blocks (Non-Volatile)
Arguments:
PeiServices - General purpose services available to every PEIM.
VariableName - Name of the variable to be found
VendorGuid - Vendor GUID to be found.
PtrTrack - Variable Track Pointer structure that contains
Variable Information.
Returns:
EFI_SUCCESS - Variable found successfully
EFI_NOT_FOUND - Variable not found
EFI_INVALID_PARAMETER - Invalid variable name
--*/
{
EFI_HOB_GUID_TYPE *GuidHob;
VARIABLE_STORE_HEADER *VariableStoreHeader;
@@ -554,6 +471,28 @@ Returns:
return EFI_NOT_FOUND;
}
/**
Provide the read variable functionality of the variable services.
@param PeiServices - General purpose services available to every PEIM.
@param VariableName - The variable name
@param VendorGuid - The vendor's GUID
@param Attributes - Pointer to the attribute
@param DataSize - Size of data
@param Data - Pointer to data
@retval EFI_SUCCESS - The interface could be successfully installed
@retval EFI_NOT_FOUND - The variable could not be discovered
@retval EFI_BUFFER_TOO_SMALL - The caller buffer is not large enough
**/
EFI_STATUS
EFIAPI
PeiGetVariable (
@@ -564,35 +503,7 @@ PeiGetVariable (
IN OUT UINTN *DataSize,
OUT VOID *Data
)
/*++
Routine Description:
Provide the read variable functionality of the variable services.
Arguments:
PeiServices - General purpose services available to every PEIM.
VariableName - The variable name
VendorGuid - The vendor's GUID
Attributes - Pointer to the attribute
DataSize - Size of data
Data - Pointer to data
Returns:
EFI_SUCCESS - The interface could be successfully installed
EFI_NOT_FOUND - The variable could not be discovered
EFI_BUFFER_TOO_SMALL - The caller buffer is not large enough
--*/
{
VARIABLE_POINTER_TRACK Variable;
UINTN VarDataSize;
@@ -635,7 +546,28 @@ Returns:
}
}
/**
Provide the read variable functionality of the variable services.
@param PeiServices - General purpose services available to every PEIM.
@param VariableName - The variable name
@param VendorGuid - The vendor's GUID
@param Attributes - Pointer to the attribute
@param DataSize - Size of data
@param Data - Pointer to data
@retval EFI_SUCCESS - The interface could be successfully installed
@retval EFI_NOT_FOUND - The variable could not be discovered
@retval EFI_BUFFER_TOO_SMALL - The caller buffer is not large enough
**/
EFI_STATUS
EFIAPI
PeiGetVariable2 (
@@ -646,35 +578,7 @@ PeiGetVariable2 (
IN OUT UINTN *DataSize,
OUT VOID *Data
)
/*++
Routine Description:
Provide the read variable functionality of the variable services.
Arguments:
PeiServices - General purpose services available to every PEIM.
VariableName - The variable name
VendorGuid - The vendor's GUID
Attributes - Pointer to the attribute
DataSize - Size of data
Data - Pointer to data
Returns:
EFI_SUCCESS - The interface could be successfully installed
EFI_NOT_FOUND - The variable could not be discovered
EFI_BUFFER_TOO_SMALL - The caller buffer is not large enough
--*/
{
return PeiGetVariable (
GetPeiServicesTablePointer (),
@@ -686,6 +590,25 @@ Returns:
);
}
/**
Provide the get next variable functionality of the variable services.
@param PeiServices - General purpose services available to every PEIM.
@param VariabvleNameSize - The variable name's size.
@param VariableName - A pointer to the variable's name.
@param VendorGuid - A pointer to the EFI_GUID structure.
@param VariableNameSize - Size of the variable name
@param VariableName - The variable name
@param VendorGuid - The vendor's GUID
@retval EFI_SUCCESS - The interface could be successfully installed
@retval EFI_NOT_FOUND - The variable could not be discovered
**/
EFI_STATUS
EFIAPI
PeiGetNextVariableName (
@@ -694,32 +617,7 @@ PeiGetNextVariableName (
IN OUT CHAR16 *VariableName,
IN OUT EFI_GUID *VendorGuid
)
/*++
Routine Description:
Provide the get next variable functionality of the variable services.
Arguments:
PeiServices - General purpose services available to every PEIM.
VariabvleNameSize - The variable name's size.
VariableName - A pointer to the variable's name.
VendorGuid - A pointer to the EFI_GUID structure.
VariableNameSize - Size of the variable name
VariableName - The variable name
VendorGuid - The vendor's GUID
Returns:
EFI_SUCCESS - The interface could be successfully installed
EFI_NOT_FOUND - The variable could not be discovered
--*/
{
VARIABLE_POINTER_TRACK Variable;
UINTN VarNameSize;
@@ -774,6 +672,26 @@ Returns:
return EFI_NOT_FOUND;
}
/**
Provide the get next variable functionality of the variable services.
@param PeiServices - General purpose services available to every PEIM.
@param VariabvleNameSize - The variable name's size.
@param VariableName - A pointer to the variable's name.
@param VariableGuid - A pointer to the EFI_GUID structure.
@param VariableNameSize - Size of the variable name
@param VariableName - The variable name
@param VendorGuid - The vendor's GUID
@retval EFI_SUCCESS - The interface could be successfully installed
@retval EFI_NOT_FOUND - The variable could not be discovered
**/
EFI_STATUS
EFIAPI
PeiGetNextVariableName2 (
@@ -782,32 +700,7 @@ PeiGetNextVariableName2 (
IN OUT CHAR16 *VariableName,
IN OUT EFI_GUID *VariableGuid
)
/*++
Routine Description:
Provide the get next variable functionality of the variable services.
Arguments:
PeiServices - General purpose services available to every PEIM.
VariabvleNameSize - The variable name's size.
VariableName - A pointer to the variable's name.
VariableGuid - A pointer to the EFI_GUID structure.
VariableNameSize - Size of the variable name
VariableName - The variable name
VendorGuid - The vendor's GUID
Returns:
EFI_SUCCESS - The interface could be successfully installed
EFI_NOT_FOUND - The variable could not be discovered
--*/
{
return PeiGetNextVariableName (
GetPeiServicesTablePointer (),
@@ -816,3 +709,4 @@ Returns:
VariableGuid
);
}

View File

@@ -9,14 +9,6 @@ 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:
Variable.h
Abstract:
Tiano PEIM to provide the variable functionality
**/
#ifndef _PEI_VARIABLE_H
@@ -73,22 +65,6 @@ PeimInitializeVariableServices (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
)
/*++
Routine Description:
TODO: Add function description
Arguments:
FfsHeader - TODO: add argument description
PeiServices - TODO: add argument description
Returns:
TODO: add return values
--*/
;
EFI_STATUS
@@ -101,26 +77,6 @@ PeiGetVariable (
IN OUT UINTN *DataSize,
OUT VOID *Data
)
/*++
Routine Description:
TODO: Add function description
Arguments:
PeiServices - TODO: add argument description
VariableName - TODO: add argument description
VendorGuid - TODO: add argument description
Attributes - TODO: add argument description
DataSize - TODO: add argument description
Data - TODO: add argument description
Returns:
TODO: add return values
--*/
;
EFI_STATUS
@@ -133,35 +89,6 @@ PeiGetVariable2 (
IN OUT UINTN *DataSize,
OUT VOID *Data
)
/*++
Routine Description:
Provide the read variable functionality of the variable services.
Arguments:
PeiServices - General purpose services available to every PEIM.
VariableName - The variable name
VendorGuid - The vendor's GUID
Attributes - Pointer to the attribute
DataSize - Size of data
Data - Pointer to data
Returns:
EFI_SUCCESS - The interface could be successfully installed
EFI_NOT_FOUND - The variable could not be discovered
EFI_BUFFER_TOO_SMALL - The caller buffer is not large enough
--*/
;
EFI_STATUS
@@ -172,32 +99,6 @@ PeiGetNextVariableName2 (
IN OUT CHAR16 *VariableName,
IN OUT EFI_GUID *VariableGuid
)
/*++
Routine Description:
Provide the get next variable functionality of the variable services.
Arguments:
PeiServices - General purpose services available to every PEIM.
VariabvleNameSize - The variable name's size.
VariableName - A pointer to the variable's name.
VariableGuid - A pointer to the EFI_GUID structure.
VariableNameSize - Size of the variable name
VariableName - The variable name
VendorGuid - The vendor's GUID
Returns:
EFI_SUCCESS - The interface could be successfully installed
EFI_NOT_FOUND - The variable could not be discovered
--*/
;
EFI_STATUS
@@ -208,24 +109,6 @@ PeiGetNextVariableName (
IN OUT CHAR16 *VariableName,
IN OUT EFI_GUID *VendorGuid
)
/*++
Routine Description:
TODO: Add function description
Arguments:
PeiServices - TODO: add argument description
VariableNameSize - TODO: add argument description
VariableName - TODO: add argument description
VendorGuid - TODO: add argument description
Returns:
TODO: add return values
--*/
;
/**