]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFspWrapperPkg/Library/BaseFspApiLib/IA32/DispatchExecute.c
IntelFspWrapperPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFspWrapperPkg / Library / BaseFspApiLib / IA32 / DispatchExecute.c
CommitLineData
a33a2f62
JY
1/** @file\r
2 Execute 32-bit code in Protected Mode.\r
3\r
d8043ce9 4 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
19486360 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
a33a2f62
JY
6\r
7**/\r
8\r
9#include <Uefi.h>\r
10#include <FspApi.h>\r
11\r
12typedef\r
d8043ce9
JY
13EFI_STATUS\r
14(EFIAPI *FSP_FUNCTION) (\r
a33a2f62
JY
15 IN VOID *Param1\r
16 );\r
17\r
18/**\r
19 Wrapper for a thunk to transition from long mode to compatibility mode to execute 32-bit code and then transit back to\r
20 long mode.\r
21\r
22 @param[in] Function The 32bit code entry to be executed.\r
23 @param[in] Param1 The first parameter to pass to 32bit code.\r
24\r
d8043ce9 25 @return EFI_STATUS.\r
a33a2f62 26**/\r
d8043ce9 27EFI_STATUS\r
a33a2f62
JY
28Execute32BitCode (\r
29 IN UINT64 Function,\r
30 IN UINT64 Param1\r
31 )\r
32{\r
33 FSP_FUNCTION EntryFunc;\r
d8043ce9 34 EFI_STATUS Status;\r
a33a2f62
JY
35\r
36 EntryFunc = (FSP_FUNCTION) (UINTN) (Function);\r
37 Status = EntryFunc ((VOID *)(UINTN)Param1);\r
38\r
39 return Status;\r
40}\r
41\r