]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.h
b372f700fab2a1adc9ab155949afe97a5ed71102
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / SmmBaseHelper / SmmBaseHelper.h
1 /** @file
2 Include file for SMM Base Helper SMM driver.
3
4 Copyright (c) 2009, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _SMM_BASE_HELPER_H_
16 #define _SMM_BASE_HELPER_H_
17
18 #include <PiSmm.h>
19 #include <Library/DebugLib.h>
20 #include <Library/UefiBootServicesTableLib.h>
21 #include <Library/SmmServicesTableLib.h>
22 #include <Library/BaseLib.h>
23 #include <Library/BaseMemoryLib.h>
24 #include <Library/PeCoffLib.h>
25 #include <Library/DevicePathLib.h>
26 #include <Library/CacheMaintenanceLib.h>
27 #include <Guid/SmmBaseThunkCommunication.h>
28 #include <Protocol/SmmBaseHelperReady.h>
29 #include <Protocol/SmmCpu.h>
30 #include <Protocol/LoadedImage.h>
31 #include <Common/CpuSaveState.h>
32
33 ///
34 /// Structure for tracking paired information of registered Framework SMI handler
35 /// and correpsonding dispatch handle for SMI handler thunk.
36 ///
37 typedef struct {
38 LIST_ENTRY Link;
39 EFI_HANDLE DispatchHandle;
40 EFI_HANDLE SmmImageHandle;
41 EFI_SMM_CALLBACK_ENTRY_POINT CallbackAddress;
42 } CALLBACK_INFO;
43
44 typedef struct {
45 ///
46 /// PI SMM CPU Save State register index
47 ///
48 EFI_SMM_SAVE_STATE_REGISTER Register;
49 ///
50 /// Offset in Framework SMST
51 ///
52 UINTN Offset;
53 } CPU_SAVE_STATE_CONVERSION;
54
55 #define CPU_SAVE_STATE_GET_OFFSET(Field) (UINTN)(&(((EFI_SMM_CPU_SAVE_STATE *) 0)->Ia32SaveState.Field))
56
57 #endif