hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
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
58
59
60
61
/** @file
  PEI TBT Task Dispatch library Header file
 
 
  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#ifndef __PEI_TBT_TASK_DISPATCH_LIB_H__
#define __PEI_TBT_TASK_DISPATCH_LIB_H__
#include <Library/PeiServicesLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/GpioLib.h>
#include <Library/IoLib.h>
#include <Library/PciSegmentLib.h>
#include <Library/HobLib.h>
#include <Library/PcdLib.h>
#include <Ppi/PeiTbtPolicy.h>
 
typedef
EFI_STATUS
(EFIAPI *TBT_TASK) (
  PEI_TBT_POLICY  *PeiTbtConfig
);
 
typedef enum {
  TBT_NULL,                ///< All policy flags turned off.
  TBT_NORMAL   = (1 << 0), ///< Execute TBT function on cold reset.
  TBT_S3       = (1 << 1), ///< Execute TBT function on S3 exit.
  TBT_S4       = (1 << 2), ///< Execute TBT function on S4 exit.
  TBT_ALL      = MAX_UINTN ///< Execute TBT function always.
} TBT_BOOT_MODE;
 
typedef struct {
  TBT_TASK      TbtTask;         ///< Ptr to function to execute, with parameter list.
  TBT_BOOT_MODE TbtBootModeFlag; ///< Call table base on TbtBootModeFlag
  CHAR8         *String;         ///< Output string describing this task.
} TBT_CALL_TABLE_ENTRY;
 
/**
  Covert the current EFI_BOOT_MODE to TBT_BOOT_MODE
**/
TBT_BOOT_MODE
TbtGetBootMode (
  VOID
);
 
/**
  TbtTaskDistpach: Dispatch the TBT tasks according to TBT_CALL_TABLE_ENTRY
 
  @param[in] TBT_CALL_TABLE_ENTRY   TbtCallTable
 
**/
VOID
TbtTaskDistpach (
  IN TBT_CALL_TABLE_ENTRY *TbtCallTable
);
#endif