diff options
author | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
---|---|---|
committer | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
commit | b7c51c9cf4864df6aabb99a1ae843becd577237c (patch) | |
tree | eebe9b0d0ca03062955223097e57da84dd618b9a /Core/Protocol | |
download | zprj-master.tar.xz |
Diffstat (limited to 'Core/Protocol')
-rw-r--r-- | Core/Protocol/CustomizedDecompress.h | 139 | ||||
-rw-r--r-- | Core/Protocol/DebugMask.h | 69 | ||||
-rw-r--r-- | Core/Protocol/FileInfo.h | 36 | ||||
-rw-r--r-- | Core/Protocol/FirmwareVolumeDispatch.h | 36 | ||||
-rw-r--r-- | Core/Protocol/SectionExtraction.h | 83 | ||||
-rw-r--r-- | Core/Protocol/TianoDecompress.h | 139 | ||||
-rw-r--r-- | Core/Protocol/VariableWrite.h | 80 |
7 files changed, 582 insertions, 0 deletions
diff --git a/Core/Protocol/CustomizedDecompress.h b/Core/Protocol/CustomizedDecompress.h new file mode 100644 index 0000000..983821b --- /dev/null +++ b/Core/Protocol/CustomizedDecompress.h @@ -0,0 +1,139 @@ +/*++ + +Copyright (c) 2004, 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: + + CustomizedDecompress.h + +Abstract: + + The user Customized Decompress Protocol Interface + +--*/ + +#ifndef _CUSTOMIZED_DECOMPRESS_H_ +#define _CUSTOMIZED_DECOMPRESS_H_ +#include <EFI.h> + +#define EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL_GUID \ + { 0x9a44198e, 0xa4a2, 0x44e6, 0x8a, 0x1f, 0x39, 0xbe, 0xfd, 0xac, 0x89, 0x6f } + +EFI_FORWARD_DECLARATION (EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL); + +typedef +EFI_STATUS +(EFIAPI *EFI_CUSTOMIZED_DECOMPRESS_GET_INFO) ( + IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This, + IN VOID *Source, + IN UINT32 SourceSize, + OUT UINT32 *DestinationSize, + OUT UINT32 *ScratchSize + ); +/*++ + +Routine Description: + + The GetInfo() function retrieves the size of the uncompressed buffer + and the temporary scratch buffer required to decompress the buffer + specified by Source and SourceSize. If the size of the uncompressed + buffer or the size of the scratch buffer cannot be determined from + the compressed data specified by Source and SourceData, then + EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed + buffer is returned in DestinationSize, the size of the scratch buffer is + returned in ScratchSize, and EFI_SUCCESS is returned. + + The GetInfo() function does not have scratch buffer available to perform + a thorough checking of the validity of the source data. It just retrieves + the 'Original Size' field from the beginning bytes of the source data and + output it as DestinationSize. And ScratchSize is specific to the decompression + implementation. + +Arguments: + + This - The protocol instance pointer + Source - The source buffer containing the compressed data. + SourceSize - The size, in bytes, of source buffer. + DestinationSize - A pointer to the size, in bytes, of the uncompressed buffer + that will be generated when the compressed buffer specified + by Source and SourceSize is decompressed. + ScratchSize - A pointer to the size, in bytes, of the scratch buffer that + is required to decompress the compressed buffer specified by + Source and SourceSize. + +Returns: + EFI_SUCCESS - The size of the uncompressed data was returned in DestinationSize + and the size of the scratch buffer was returned in ScratchSize. + EFI_INVALID_PARAMETER - The size of the uncompressed data or the size of the scratch + buffer cannot be determined from the compressed data specified by + Source and SourceData. + +--*/ + + +typedef +EFI_STATUS +(EFIAPI *EFI_CUSTOMIZED_DECOMPRESS_DECOMPRESS) ( + IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This, + IN VOID* Source, + IN UINT32 SourceSize, + IN OUT VOID* Destination, + IN UINT32 DestinationSize, + IN OUT VOID* Scratch, + IN UINT32 ScratchSize + ); +/*++ + +Routine Description: + + The Decompress() function extracts decompressed data to its original form. + + This protocol is designed so that the decompression algorithm can be + implemented without using any memory services. As a result, the + Decompress() function is not allowed to call AllocatePool() or + AllocatePages() in its implementation. It is the caller's responsibility + to allocate and free the Destination and Scratch buffers. + + If the compressed source data specified by Source and SourceSize is + sucessfully decompressed into Destination, then EFI_SUCCESS is returned. + If the compressed source data specified by Source and SourceSize is not in + a valid compressed data format, then EFI_INVALID_PARAMETER is returned. + +Arguments: + + This - The protocol instance pointer + Source - The source buffer containing the compressed data. + SourceSize - The size of source data. + Destination - On output, the destination buffer that contains + the uncompressed data. + DestinationSize - The size of destination buffer. The size of destination + buffer needed is obtained from GetInfo(). + Scratch - A temporary scratch buffer that is used to perform the + decompression. + ScratchSize - The size of scratch buffer. The size of scratch buffer needed + is obtained from GetInfo(). + +Returns: + + EFI_SUCCESS - Decompression completed successfully, and the uncompressed + buffer is returned in Destination. + EFI_INVALID_PARAMETER + - The source buffer specified by Source and SourceSize is + corrupted (not in a valid compressed format). + +--*/ + +typedef struct _EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL { + EFI_CUSTOMIZED_DECOMPRESS_GET_INFO GetInfo; + EFI_CUSTOMIZED_DECOMPRESS_DECOMPRESS Decompress; +} EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL; + +GUID_VARIABLE_DECLARATION(gEfiCustomizedDecompressProtocolGuid, EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL_GUID); +#endif diff --git a/Core/Protocol/DebugMask.h b/Core/Protocol/DebugMask.h new file mode 100644 index 0000000..e5cfa22 --- /dev/null +++ b/Core/Protocol/DebugMask.h @@ -0,0 +1,69 @@ +/*++ + +Copyright (c) 2004, 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: + + DebugMask.h + +Abstract: + + This protocol is used to abstract the Debug Mask serivces for + the specific driver or application image. + +--*/ + +#ifndef _DEBUG_MASK_H_ +#define _DEBUG_MASK_H_ +#include <EFI.h> + + +// +//4C8A2451-C207-405b-9694-99EA13251341 +// +#define EFI_DEBUG_MASK_PROTOCOL_GUID \ + { 0x4c8a2451, 0xc207, 0x405b, 0x96, 0x94, 0x99, 0xea, 0x13, 0x25, 0x13, 0x41 } + + +#define EFI_DEBUG_MASK_REVISION 0x00010000 + +// +// Forward reference for pure ANSI compatability +// +EFI_FORWARD_DECLARATION (EFI_DEBUG_MASK_PROTOCOL); + +// +// DebugMask member functions definition +// +typedef +EFI_STATUS +(EFIAPI * EFI_GET_DEBUG_MASK) ( + IN EFI_DEBUG_MASK_PROTOCOL *This, // Calling context + IN OUT UINTN *CurrentDebugMask // Ptr to store current debug mask + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_SET_DEBUG_MASK) ( + IN EFI_DEBUG_MASK_PROTOCOL *This, // Calling context + IN UINTN NewDebugMask // New Debug Mask value to set + ); + +// +// DebugMask protocol definition +// +typedef struct _EFI_DEBUG_MASK_PROTOCOL { + INT64 Revision; + EFI_GET_DEBUG_MASK GetDebugMask; + EFI_SET_DEBUG_MASK SetDebugMask; +} EFI_DEBUG_MASK_PROTOCOL; + +GUID_VARIABLE_DECLARATION(gEfiDebugMaskProtocolGuid, EFI_DEBUG_MASK_PROTOCOL_GUID); +#endif diff --git a/Core/Protocol/FileInfo.h b/Core/Protocol/FileInfo.h new file mode 100644 index 0000000..cff5fc7 --- /dev/null +++ b/Core/Protocol/FileInfo.h @@ -0,0 +1,36 @@ +/*++ + +Copyright (c) 2004, 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: + + FileInfo.c + +Abstract: + + SimpleFileSystem protocol as defined in the EFI 1.0 specification. + + The SimpleFileSystem protocol is the programatic access to the FAT (12,16,32) + file system specified in EFI 1.0. It can also be used to abstract any + file system other than FAT. + + EFI 1.0 can boot from any valid EFI image contained in a SimpleFileSystem + +--*/ + +#ifndef _FILE_INFO_H_ +#define _FILE_INFO_H_ +#include <Protocol/SimpleFileSystem.h> + +#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET (EFI_FILE_INFO, FileName) + +GUID_VARIABLE_DECLARATION(gEfiFileInfoGuid,EFI_FILE_INFO_ID); + +#endif diff --git a/Core/Protocol/FirmwareVolumeDispatch.h b/Core/Protocol/FirmwareVolumeDispatch.h new file mode 100644 index 0000000..9b99874 --- /dev/null +++ b/Core/Protocol/FirmwareVolumeDispatch.h @@ -0,0 +1,36 @@ +/*++ + +Copyright (c) 2004, 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: + + FirmwareVolumeDispatch.h + +Abstract: + + Firmware Volume Dispatch protocol as defined in the Tiano Firmware Volume + specification. + + Presence of this protocol tells the dispatch to dispatch from this Firmware + Volume + +--*/ + +#ifndef __FIRMWARE_VOLUME_DISPATCH_H__ +#define __FIRMWARE_VOLUME_DISPATCH_H__ +#include <EFI.h> + + +#define EFI_FIRMWARE_VOLUME_DISPATCH_PROTOCOL_GUID \ + { 0x7aa35a69, 0x506c, 0x444f, 0xa7, 0xaf, 0x69, 0x4b, 0xf5, 0x6f, 0x71, 0xc8 } + +GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeDispatchProtocolGuid, EFI_FIRMWARE_VOLUME_DISPATCH_PROTOCOL_GUID); + +#endif diff --git a/Core/Protocol/SectionExtraction.h b/Core/Protocol/SectionExtraction.h new file mode 100644 index 0000000..4bb16eb --- /dev/null +++ b/Core/Protocol/SectionExtraction.h @@ -0,0 +1,83 @@ +/*++ + +Copyright (c) 2004, 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.h + +Abstract: + + Section extraction protocol as defined in the Tiano File Image Format specification. + + This interface provides a means of decoding a set of sections into a linked list of + leaf sections. This provides for an extensible and flexible file format. + +--*/ + +#ifndef _SECTION_EXTRACTION_PROTOCOL_H +#define _SECTION_EXTRACTION_PROTOCOL_H + +#include "EfiFirmwareFileSystem.h" + +// +// Protocol GUID definition +// +#define EFI_SECTION_EXTRACTION_PROTOCOL_GUID \ + { \ + 0x448F5DA4, 0x6DD7, 0x4FE1, 0x93, 0x07, 0x69, 0x22, 0x41, 0x92, 0x21, 0x5D \ + } + +EFI_FORWARD_DECLARATION (EFI_SECTION_EXTRACTION_PROTOCOL); + +// +// Protocol member functions +// +typedef +EFI_STATUS +(EFIAPI *EFI_OPEN_SECTION_STREAM) ( + IN EFI_SECTION_EXTRACTION_PROTOCOL * This, + IN UINTN SectionStreamLength, + IN VOID *SectionStream, + OUT UINTN *SectionStreamHandle + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_GET_SECTION) ( + IN EFI_SECTION_EXTRACTION_PROTOCOL * This, + IN UINTN SectionStreamHandle, + IN EFI_SECTION_TYPE * SectionType, + IN EFI_GUID * SectionDefinitionGuid, + IN UINTN SectionInstance, + IN VOID **Buffer, + IN OUT UINTN *BufferSize, + OUT UINT32 *AuthenticationStatus + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_CLOSE_SECTION_STREAM) ( + IN EFI_SECTION_EXTRACTION_PROTOCOL * This, + IN UINTN SectionStreamHandle + ); + +// +// Protocol definition +// +typedef struct _EFI_SECTION_EXTRACTION_PROTOCOL { + EFI_OPEN_SECTION_STREAM OpenSectionStream; + EFI_GET_SECTION GetSection; + EFI_CLOSE_SECTION_STREAM CloseSectionStream; +} EFI_SECTION_EXTRACTION_PROTOCOL; + +GUID_VARIABLE_DECLARATION(gEfiSectionExtractionProtocolGuid,EFI_SECTION_EXTRACTION_PROTOCOL_GUID); + +#endif diff --git a/Core/Protocol/TianoDecompress.h b/Core/Protocol/TianoDecompress.h new file mode 100644 index 0000000..de5cb54 --- /dev/null +++ b/Core/Protocol/TianoDecompress.h @@ -0,0 +1,139 @@ +/*++ + +Copyright (c) 2004, 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: + + TianoDecompress.h + +Abstract: + + The Tiano Decompress Protocol Interface + +--*/ + +#ifndef _TIANO_DECOMPRESS_H_ +#define _TIANO_DECOMPRESS_H_ +#include <EFI.h> + +#define EFI_TIANO_DECOMPRESS_PROTOCOL_GUID \ + { 0xe84cf29c, 0x191f, 0x4eae, 0x96, 0xe1, 0xf4, 0x6a, 0xec, 0xea, 0xea, 0x0b } + +EFI_FORWARD_DECLARATION (EFI_TIANO_DECOMPRESS_PROTOCOL); + +typedef +EFI_STATUS +(EFIAPI *EFI_TIANO_DECOMPRESS_GET_INFO) ( + IN EFI_TIANO_DECOMPRESS_PROTOCOL *This, + IN VOID *Source, + IN UINT32 SourceSize, + OUT UINT32 *DestinationSize, + OUT UINT32 *ScratchSize + ); +/*++ + +Routine Description: + + The GetInfo() function retrieves the size of the uncompressed buffer + and the temporary scratch buffer required to decompress the buffer + specified by Source and SourceSize. If the size of the uncompressed + buffer or the size of the scratch buffer cannot be determined from + the compressed data specified by Source and SourceData, then + EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed + buffer is returned in DestinationSize, the size of the scratch buffer is + returned in ScratchSize, and EFI_SUCCESS is returned. + + The GetInfo() function does not have scratch buffer available to perform + a thorough checking of the validity of the source data. It just retrieves + the 'Original Size' field from the beginning bytes of the source data and + output it as DestinationSize. And ScratchSize is specific to the decompression + implementation. + +Arguments: + + This - The protocol instance pointer + Source - The source buffer containing the compressed data. + SourceSize - The size, in bytes, of source buffer. + DestinationSize - A pointer to the size, in bytes, of the uncompressed buffer + that will be generated when the compressed buffer specified + by Source and SourceSize is decompressed. + ScratchSize - A pointer to the size, in bytes, of the scratch buffer that + is required to decompress the compressed buffer specified by + Source and SourceSize. + +Returns: + EFI_SUCCESS - The size of the uncompressed data was returned in DestinationSize + and the size of the scratch buffer was returned in ScratchSize. + EFI_INVALID_PARAMETER - The size of the uncompressed data or the size of the scratch + buffer cannot be determined from the compressed data specified by + Source and SourceData. + +--*/ + + +typedef +EFI_STATUS +(EFIAPI *EFI_TIANO_DECOMPRESS_DECOMPRESS) ( + IN EFI_TIANO_DECOMPRESS_PROTOCOL *This, + IN VOID* Source, + IN UINT32 SourceSize, + IN OUT VOID* Destination, + IN UINT32 DestinationSize, + IN OUT VOID* Scratch, + IN UINT32 ScratchSize + ); +/*++ + +Routine Description: + + The Decompress() function extracts decompressed data to its original form. + + This protocol is designed so that the decompression algorithm can be + implemented without using any memory services. As a result, the + Decompress() function is not allowed to call AllocatePool() or + AllocatePages() in its implementation. It is the caller's responsibility + to allocate and free the Destination and Scratch buffers. + + If the compressed source data specified by Source and SourceSize is + sucessfully decompressed into Destination, then EFI_SUCCESS is returned. + If the compressed source data specified by Source and SourceSize is not in + a valid compressed data format, then EFI_INVALID_PARAMETER is returned. + +Arguments: + + This - The protocol instance pointer + Source - The source buffer containing the compressed data. + SourceSize - The size of source data. + Destination - On output, the destination buffer that contains + the uncompressed data. + DestinationSize - The size of destination buffer. The size of destination + buffer needed is obtained from GetInfo(). + Scratch - A temporary scratch buffer that is used to perform the + decompression. + ScratchSize - The size of scratch buffer. The size of scratch buffer needed + is obtained from GetInfo(). + +Returns: + + EFI_SUCCESS - Decompression completed successfully, and the uncompressed + buffer is returned in Destination. + EFI_INVALID_PARAMETER + - The source buffer specified by Source and SourceSize is + corrupted (not in a valid compressed format). + +--*/ + +typedef struct _EFI_TIANO_DECOMPRESS_PROTOCOL { + EFI_TIANO_DECOMPRESS_GET_INFO GetInfo; + EFI_TIANO_DECOMPRESS_DECOMPRESS Decompress; +} EFI_TIANO_DECOMPRESS_PROTOCOL; + +GUID_VARIABLE_DECLARATION(gEfiTianoDecompressProtocolGuid, EFI_TIANO_DECOMPRESS_PROTOCOL_GUID); +#endif diff --git a/Core/Protocol/VariableWrite.h b/Core/Protocol/VariableWrite.h new file mode 100644 index 0000000..c87d1f4 --- /dev/null +++ b/Core/Protocol/VariableWrite.h @@ -0,0 +1,80 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Core/EDK/Protocol/VariableWrite.h 1 5/19/06 11:28p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 5/19/06 11:28p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Core/EDK/Protocol/VariableWrite.h $ +// +// 1 5/19/06 11:28p Felixp +// +// 1 3/13/06 1:57a Felixp +// +// 2 3/04/05 10:43a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 3/30/04 2:24a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: VariableWrite.h +// +// Description: Variable Architectural Protocol Definitions +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __VARIABLE_WRITE_ARCH_PROTOCOL_H__ +#define __VARIABLE_WRITE_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#ifndef EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID +#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \ + {0x6441f818,0x6362,0x4e44,0xb5,0x70,0x7d,0xba,0x31,0xdd,0x24,0x53} +#endif +GUID_VARIABLE_DECLARATION(gEfiVariableWriteArchProtocolGuid, EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID); +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** |