]>
Commit | Line | Data |
---|---|---|
ab7017fe | 1 | /** @file\r |
2 | Common header file.\r | |
3 | \r | |
4 | Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
4e4f13d2 | 15 | #ifndef _CAPSULE_COMMON_HEADER_\r |
16 | #define _CAPSULE_COMMON_HEADER_\r | |
ab7017fe | 17 | \r |
18 | //\r | |
19 | // This capsule PEIM puts its private data at the start of the\r | |
20 | // coalesced capsule. Here's the structure definition.\r | |
21 | //\r | |
22 | #define EFI_CAPSULE_PEIM_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('C', 'a', 'p', 'D')\r | |
23 | \r | |
24 | typedef struct {\r | |
25 | UINT32 Signature;\r | |
26 | UINTN CapsuleSize;\r | |
27 | } EFI_CAPSULE_PEIM_PRIVATE_DATA;\r | |
28 | \r | |
29 | #define CAPSULE_TEST_SIGNATURE SIGNATURE_32('T', 'E', 'S', 'T')\r | |
30 | \r | |
4e4f13d2 | 31 | #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)\r |
ab7017fe | 32 | typedef struct {\r |
33 | EFI_PHYSICAL_ADDRESS EntryPoint;\r | |
34 | EFI_PHYSICAL_ADDRESS StackBufferBase;\r | |
35 | UINT64 StackBufferLength;\r | |
36 | EFI_PHYSICAL_ADDRESS JumpBuffer;\r | |
37 | EFI_PHYSICAL_ADDRESS BlockListAddr;\r | |
38 | EFI_PHYSICAL_ADDRESS MemoryBase64Ptr;\r | |
39 | EFI_PHYSICAL_ADDRESS MemorySize64Ptr;\r | |
40 | } SWITCH_32_TO_64_CONTEXT;\r | |
41 | \r | |
42 | typedef struct {\r | |
43 | UINT16 ReturnCs;\r | |
44 | EFI_PHYSICAL_ADDRESS ReturnEntryPoint;\r | |
45 | UINT64 ReturnStatus;\r | |
46 | IA32_DESCRIPTOR Gdtr;\r | |
47 | } SWITCH_64_TO_32_CONTEXT;\r | |
4e4f13d2 | 48 | #endif\r |
ab7017fe | 49 | \r |
50 | /**\r | |
51 | The function to coalesce a fragmented capsule in memory.\r | |
52 | \r | |
53 | @param PeiServices General purpose services available to every PEIM.\r | |
54 | @param BlockListBuffer Point to the buffer of Capsule Descriptor Variables.\r | |
55 | @param MemoryBase Pointer to the base of a block of memory that we can walk\r | |
56 | all over while trying to coalesce our buffers.\r | |
57 | On output, this variable will hold the base address of\r | |
58 | a coalesced capsule.\r | |
59 | @param MemorySize Size of the memory region pointed to by MemoryBase.\r | |
60 | On output, this variable will contain the size of the\r | |
61 | coalesced capsule.\r | |
62 | \r | |
63 | @retval EFI_NOT_FOUND if we can't determine the boot mode\r | |
64 | if the boot mode is not flash-update\r | |
65 | if we could not find the capsule descriptors\r | |
66 | \r | |
67 | @retval EFI_BUFFER_TOO_SMALL\r | |
68 | if we could not coalesce the capsule in the memory\r | |
69 | region provided to us\r | |
70 | \r | |
71 | @retval EFI_SUCCESS if there's no capsule, or if we processed the\r | |
72 | capsule successfully.\r | |
73 | **/\r | |
74 | EFI_STATUS\r | |
75 | EFIAPI\r | |
76 | CapsuleDataCoalesce (\r | |
77 | IN EFI_PEI_SERVICES **PeiServices,\r | |
78 | IN IN EFI_PHYSICAL_ADDRESS *BlockListBuffer,\r | |
79 | IN OUT VOID **MemoryBase,\r | |
80 | IN OUT UINTN *MemorySize\r | |
81 | );\r | |
82 | \r | |
83 | #endif\r |