summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Include/Guid/PiSmmCommunicationRegionTable.h
blob: 595003bfbcd4ab1b0532486f01695beaddfa711f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/** @file

Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#ifndef _PI_SMM_COMMUNICATION_REGION_TABLE_H_
#define _PI_SMM_COMMUNICATION_REGION_TABLE_H_

#define EDKII_PI_SMM_COMMUNICATION_REGION_TABLE_GUID {\
  0x4e28ca50, 0xd582, 0x44ac, {0xa1, 0x1f, 0xe3, 0xd5, 0x65, 0x26, 0xdb, 0x34} \
}

//
// This table to declare the generic SMM communication buffer location.
// If this table is present, it means the SMM communication buffer is restricted to
// EfiReservedMemoryType, EfiACPIMemoryNVS, or EfiRuntimeServicesData.
//
// This table is installed to UEFI configuration table by generic driver
// or platform driver, at early DXE phase.
//
// The EFI_MEMORY_DESCRIPTOR entry must contain at least one entry.
// The entries must be normal memory region in EfiReservedMemoryType, EfiACPIMemoryNVS,
// or EfiRuntimeServicesData.
// If the Entry.Type is EfiConventionalMemory, it means this entry is free to use.
// If the Entry.Type is other, it means this entry is occupied.
//
// Any non-SMM component may put communication data there, then use
// UEFI defined SMM Communication ACPI Table, or PI defined EFI_SMM_COMMUNICATION_PROTOCOL
// to communicate with SMI handler. The process is:
// 1) Find an entry whose type is EfiConventional.
// 2) Change type to be EfiReservedMemoryType before use.
// 3) Use it.
// 4) Restore type be EfiConventional.
//    The step 2) must be performed as an atomic transaction, if there might be conflict during runtime.
//    For example, on IA-32/x64 platforms, this can be done using the CMPXCHG CPU instruction.
//    If there is guarantee on no conflict during boot time, these steps can be skipped.
//    For example, DXE, UEFI driver and UEFI application runs in sequence.
//
// For example, FPDT driver can use this communication buffer to get SMM
// performance data in SMM. Profile driver can use this communication buffer
// to get SMM profile data in SMM.
//
typedef struct {
  UINT32                Version;
  UINT32                NumberOfEntries;
  UINT32                DescriptorSize;
  UINT32                Reserved;
//EFI_MEMORY_DESCRIPTOR Entry[1];
} EDKII_PI_SMM_COMMUNICATION_REGION_TABLE;

#define EDKII_PI_SMM_COMMUNICATION_REGION_TABLE_VERSION  0x00000001

extern EFI_GUID gEdkiiPiSmmCommunicationRegionTableGuid;

#endif