]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c
Update capsule pei module to pass IPF build.
[mirror_edk2.git] / MdeModulePkg / Universal / CapsulePei / X64 / X64Entry.c
CommitLineData
ab7017fe 1/** @file\r
2 The X64 entrypoint is used to process capsule in long mode.\r
3\r
4Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
ab7017fe 15#include <Library/DebugLib.h>\r
16#include "CommonHeader.h"\r
17\r
18/**\r
19 The X64 entrypoint is used to process capsule in long mode then\r
20 return to 32-bit protected mode.\r
21\r
22 @param EntrypointContext Pointer to the context of long mode.\r
23 @param ReturnContext Pointer to the context of 32-bit protected mode.\r
24\r
25 @retval This function should never return actually.\r
26\r
27**/\r
28EFI_STATUS\r
29EFIAPI\r
30_ModuleEntryPoint (\r
31 SWITCH_32_TO_64_CONTEXT *EntrypointContext,\r
32 SWITCH_64_TO_32_CONTEXT *ReturnContext\r
33)\r
34{\r
35 EFI_STATUS Status;\r
36\r
37 //\r
38 // Call CapsuleDataCoalesce to process capsule.\r
39 //\r
40 Status = CapsuleDataCoalesce (\r
41 NULL,\r
42 (EFI_PHYSICAL_ADDRESS *) (UINTN) EntrypointContext->BlockListAddr,\r
43 (VOID **) (UINTN) EntrypointContext->MemoryBase64Ptr,\r
44 (UINTN *) (UINTN) EntrypointContext->MemorySize64Ptr\r
45 );\r
46 \r
47 ReturnContext->ReturnStatus = Status;\r
48\r
49 //\r
50 // Finish to coalesce capsule, and return to 32-bit mode.\r
51 //\r
52 AsmDisablePaging64 (\r
53 ReturnContext->ReturnCs,\r
54 (UINT32) ReturnContext->ReturnEntryPoint,\r
55 (UINT32) (UINTN) EntrypointContext,\r
56 (UINT32) (UINTN) ReturnContext,\r
57 (UINT32) (EntrypointContext->StackBufferBase + EntrypointContext->StackBufferLength)\r
58 ); \r
59 \r
60 //\r
61 // Should never be here.\r
62 //\r
63 ASSERT (FALSE);\r
64 return EFI_SUCCESS;\r
65}