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