Update IntelFspWrapperPkg according to FSP1.1.
[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
a33a2f62
JY
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#include <Uefi.h>\r
16#include <FspApi.h>\r
17\r
18typedef\r
d8043ce9
JY
19EFI_STATUS\r
20(EFIAPI *FSP_FUNCTION) (\r
a33a2f62
JY
21 IN VOID *Param1\r
22 );\r
23\r
24/**\r
25 Wrapper for a thunk to transition from long mode to compatibility mode to execute 32-bit code and then transit back to\r
26 long mode.\r
27\r
28 @param[in] Function The 32bit code entry to be executed.\r
29 @param[in] Param1 The first parameter to pass to 32bit code.\r
30\r
d8043ce9 31 @return EFI_STATUS.\r
a33a2f62 32**/\r
d8043ce9 33EFI_STATUS\r
a33a2f62
JY
34Execute32BitCode (\r
35 IN UINT64 Function,\r
36 IN UINT64 Param1\r
37 )\r
38{\r
39 FSP_FUNCTION EntryFunc;\r
d8043ce9 40 EFI_STATUS Status;\r
a33a2f62
JY
41\r
42 EntryFunc = (FSP_FUNCTION) (UINTN) (Function);\r
43 Status = EntryFunc ((VOID *)(UINTN)Param1);\r
44\r
45 return Status;\r
46}\r
47\r