]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.c
Initial import.
[mirror_edk2.git] / EdkModulePkg / Universal / FirmwareVolume / GuidedSectionExtraction / Crc32SectionExtract / Dxe / GuidedSection.c
CommitLineData
878ddf1f 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 GuidedSection.c\r
15 \r
16Abstract:\r
17\r
18 GUIDed section extraction protocol implementation. \r
19 This contains the common constructor of GUIDed section\r
20 extraction protocol. GUID specific implementation of each\r
21 GUIDed section extraction protocol can be found in other\r
22 files under the same directory.\r
23 \r
24 Please refer to the Tiano File Image Format Specification, \r
25 FV spec 0.3.6\r
26 \r
27 Acronyms used Meaning\r
28\r
29 \r
30--*/\r
31\r
32\r
33#include "Common/FirmwareFileSystem.h"\r
34\r
35EFI_STATUS\r
36GuidedSectionExtractionProtocolConstructor (\r
37 OUT EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL **GuidedSep,\r
38 IN EFI_EXTRACT_GUIDED_SECTION ExtractSection\r
39 )\r
40/*++\r
41\r
42Routine Description:\r
43\r
44 Constructor for the GUIDed section extraction protocol. Initializes\r
45 instance data.\r
46\r
47Arguments:\r
48\r
49 This Instance to construct\r
50\r
51Returns:\r
52\r
53 EFI_SUCCESS: Instance initialized.\r
54\r
55--*/\r
56// TODO: GuidedSep - add argument and description to function comment\r
57// TODO: ExtractSection - add argument and description to function comment\r
58// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment\r
59{\r
60 EFI_STATUS Status;\r
61\r
62 *GuidedSep = NULL;\r
63 Status = gBS->AllocatePool (\r
64 EfiBootServicesData,\r
65 sizeof (EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL),\r
66 (VOID **) GuidedSep\r
67 );\r
68 if (EFI_ERROR (Status)) {\r
69 return EFI_OUT_OF_RESOURCES;\r
70 }\r
71\r
72 (*GuidedSep)->ExtractSection = ExtractSection;\r
73\r
74 return EFI_SUCCESS;\r
75}\r