summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/Include/Guid/SmmS3CommunicationInfoGuid.h
blob: ee621b25f40dd893eff8d414e9201dab8980c569 (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
/** @file
  This file defines the SMM S3 communication hob structure.

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

**/

#ifndef PAYLOAD_S3_COMMUNICATION_GUID_H_
#define PAYLOAD_S3_COMMUNICATION_GUID_H_

extern EFI_GUID gS3CommunicationGuid;

#pragma pack(1)

typedef struct {
  EFI_SMRAM_DESCRIPTOR  CommBuffer;
  BOOLEAN               PldAcpiS3Enable;
} PLD_S3_COMMUNICATION;

///
/// The information below is used for communication between bootloader and payload.
/// It is used to save/store some registers in S3 path
///
/// This region exists only when gEfiAcpiVariableGuid HOB exist.
/// when PLD_S3_INFO.PldAcpiS3Enable is false, the communication buffer is defined as below.
///

typedef struct {
  UINT32             ApicId;
  UINT32             SmmBase;
} CPU_SMMBASE;

typedef struct {
  UINT8              SwSmiData;
  UINT8              SwSmiTriggerValue;
  UINT16             Reserved;
  UINT32             CpuCount;
  CPU_SMMBASE        SmmBase[0];
} SMM_S3_INFO;

//
// Payload would save this structure to S3 communication area in normal boot.
// In S3 path, bootloader need restore SMM base and writie IO port 0xB2 with SwSmiTriggerValue
// to trigger SMI to let payload to restore S3.
//
typedef struct {
  EFI_HOB_GUID_TYPE  Header;
  SMM_S3_INFO        S3Info;
} PLD_TO_BL_SMM_INFO;

#pragma pack()

#endif