]>
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 | |
15 | #ifndef _CAPSULE_THUNK_32_TO_64_\r | |
16 | #define _CAPSULE_THUNK_32_TO_64_\r | |
17 | \r | |
18 | #include <Uefi.h>\r | |
19 | #include "PiPei.h"\r | |
20 | \r | |
21 | //\r | |
22 | // This capsule PEIM puts its private data at the start of the\r | |
23 | // coalesced capsule. Here's the structure definition.\r | |
24 | //\r | |
25 | #define EFI_CAPSULE_PEIM_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('C', 'a', 'p', 'D')\r | |
26 | \r | |
27 | typedef struct {\r | |
28 | UINT32 Signature;\r | |
29 | UINTN CapsuleSize;\r | |
30 | } EFI_CAPSULE_PEIM_PRIVATE_DATA;\r | |
31 | \r | |
32 | #define CAPSULE_TEST_SIGNATURE SIGNATURE_32('T', 'E', 'S', 'T')\r | |
33 | \r | |
34 | typedef struct {\r | |
35 | EFI_PHYSICAL_ADDRESS EntryPoint;\r | |
36 | EFI_PHYSICAL_ADDRESS StackBufferBase;\r | |
37 | UINT64 StackBufferLength;\r | |
38 | EFI_PHYSICAL_ADDRESS JumpBuffer;\r | |
39 | EFI_PHYSICAL_ADDRESS BlockListAddr;\r | |
40 | EFI_PHYSICAL_ADDRESS MemoryBase64Ptr;\r | |
41 | EFI_PHYSICAL_ADDRESS MemorySize64Ptr;\r | |
42 | } SWITCH_32_TO_64_CONTEXT;\r | |
43 | \r | |
44 | typedef struct {\r | |
45 | UINT16 ReturnCs;\r | |
46 | EFI_PHYSICAL_ADDRESS ReturnEntryPoint;\r | |
47 | UINT64 ReturnStatus;\r | |
48 | IA32_DESCRIPTOR Gdtr;\r | |
49 | } SWITCH_64_TO_32_CONTEXT;\r | |
50 | \r | |
51 | /**\r | |
52 | The function to coalesce a fragmented capsule in memory.\r | |
53 | \r | |
54 | @param PeiServices General purpose services available to every PEIM.\r | |
55 | @param BlockListBuffer Point to the buffer of Capsule Descriptor Variables.\r | |
56 | @param MemoryBase Pointer to the base of a block of memory that we can walk\r | |
57 | all over while trying to coalesce our buffers.\r | |
58 | On output, this variable will hold the base address of\r | |
59 | a coalesced capsule.\r | |
60 | @param MemorySize Size of the memory region pointed to by MemoryBase.\r | |
61 | On output, this variable will contain the size of the\r | |
62 | coalesced capsule.\r | |
63 | \r | |
64 | @retval EFI_NOT_FOUND if we can't determine the boot mode\r | |
65 | if the boot mode is not flash-update\r | |
66 | if we could not find the capsule descriptors\r | |
67 | \r | |
68 | @retval EFI_BUFFER_TOO_SMALL\r | |
69 | if we could not coalesce the capsule in the memory\r | |
70 | region provided to us\r | |
71 | \r | |
72 | @retval EFI_SUCCESS if there's no capsule, or if we processed the\r | |
73 | capsule successfully.\r | |
74 | **/\r | |
75 | EFI_STATUS\r | |
76 | EFIAPI\r | |
77 | CapsuleDataCoalesce (\r | |
78 | IN EFI_PEI_SERVICES **PeiServices,\r | |
79 | IN IN EFI_PHYSICAL_ADDRESS *BlockListBuffer,\r | |
80 | IN OUT VOID **MemoryBase,\r | |
81 | IN OUT UINTN *MemorySize\r | |
82 | );\r | |
83 | \r | |
84 | #endif\r |