]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/IA32/DispatchExecute.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / IntelFsp2WrapperPkg / Library / BaseFspWrapperApiLib / IA32 / DispatchExecute.c
CommitLineData
cf1d4549
JY
1/** @file\r
2 Execute 32-bit code in Protected Mode.\r
3\r
86a2f3c4 4 Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>\r
512e23a3 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
cf1d4549
JY
6\r
7**/\r
8\r
9#include <Uefi.h>\r
10#include <FspEas.h>\r
11\r
12/**\r
13 FSP API functions.\r
14\r
15 @param[in] Param1 The first parameter to pass to 32bit code.\r
16 @param[in] Param2 The second parameter to pass to 32bit code.\r
17\r
18 @return EFI_STATUS.\r
19**/\r
20typedef\r
21EFI_STATUS\r
7c7184e2 22(EFIAPI *FSP_FUNCTION)(\r
cf1d4549
JY
23 IN VOID *Param1,\r
24 IN VOID *Param2\r
25 );\r
26\r
27/**\r
28 Wrapper for a thunk to transition from long mode to compatibility mode to execute 32-bit code and then transit back to\r
29 long mode.\r
30\r
31 @param[in] Function The 32bit code entry to be executed.\r
32 @param[in] Param1 The first parameter to pass to 32bit code.\r
33 @param[in] Param2 The second parameter to pass to 32bit code.\r
34\r
35 @return EFI_STATUS.\r
36**/\r
37EFI_STATUS\r
38Execute32BitCode (\r
7c7184e2
MK
39 IN UINT64 Function,\r
40 IN UINT64 Param1,\r
41 IN UINT64 Param2\r
cf1d4549
JY
42 )\r
43{\r
7c7184e2
MK
44 FSP_FUNCTION EntryFunc;\r
45 EFI_STATUS Status;\r
cf1d4549 46\r
7c7184e2 47 EntryFunc = (FSP_FUNCTION)(UINTN)(Function);\r
cf1d4549
JY
48 Status = EntryFunc ((VOID *)(UINTN)Param1, (VOID *)(UINTN)Param2);\r
49\r
50 return Status;\r
51}\r
86a2f3c4
TK
52\r
53/**\r
54 Wrapper for a thunk to transition from compatibility mode to long mode to execute 64-bit code and then transit back to\r
55 compatibility mode.\r
56\r
57 @param[in] Function The 64bit code entry to be executed.\r
58 @param[in] Param1 The first parameter to pass to 64bit code.\r
59 @param[in] Param2 The second parameter to pass to 64bit code.\r
60\r
61 @return EFI_STATUS.\r
62**/\r
63EFI_STATUS\r
64Execute64BitCode (\r
65 IN UINT64 Function,\r
66 IN UINT64 Param1,\r
67 IN UINT64 Param2\r
68 )\r
69{\r
70 return EFI_UNSUPPORTED;\r
71}\r