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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/** @file
  uba central config database Protocol
 
  @copyright
  Copyright 2012 - 2021 Intel Corporation. <BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#ifndef _UBA_CONFIG_DATABASE_H_
#define _UBA_CONFIG_DATABASE_H_
 
// {E03E0D46-5263-4845-B0A4-58D57B3177E2}
#define UBA_CONFIG_DATABASE_PROTOCOL_GUID \
  { 0xe03e0d46, 0x5263, 0x4845, { 0xb0, 0xa4, 0x58, 0xd5, 0x7b, 0x31, 0x77, 0xe2 } }
 
 
typedef struct _UBA_CONFIG_DATABASE_PROTOCOL UBA_CONFIG_DATABASE_PROTOCOL;
 
#define UBA_CONFIG_PROTOCOL_SIGNATURE  SIGNATURE_32('M', 'S', 'K', 'P')
#define UBA_CONFIG_PROTOCOL_VERSION    0x01
 
/**
  Get platform's GUID and user friendly name by PlatformType.
 
  This is used when you need a PlatformId to Add/Get platform data
 
  Core will create a new platform for you if the PlatformType is not
  recorded in database, and assgin a unique GUID for this platform.
 
  @param This                   uba Protocol instance.
  @param PlatformType           The platform type, same define as Platform.h.
  @param PlatformId             The GUID for this platform.
  @param PlatformName           The user friendly name for this platform.
 
  @retval EFI_ALREADY_STARTED   Create new for an exist platform.
  @retval EFI_OUT_OF_RESOURCES  Resource not enough.
  @retval EFI_NOT_FOUND         Platform not found.
  @retval EFI_SUCCESS           Operation success.
 
**/
typedef
EFI_STATUS
(EFIAPI *UBA_CONFIG_GET_PLATFORM) (
  IN  UBA_CONFIG_DATABASE_PROTOCOL          *This,
  OUT UINT32                                *PlatformType,
  OUT EFI_GUID                              *PlatformId,
  OUT CHAR8                                 *PlatformName
  );
 
/**
  Add configuration data to uba configuration database.
 
  @param This                   uba Protocol instance.
  @param PlatformId             The GUID for this platform.
  @param ResId                  The configuration data resource id.
  @param Data                   The data buffer pointer.
  @param DataSize               Size of data want to add into database.
 
  @retval EFI_INVALID_PARAMETER Required parameters not correct.
  @retval EFI_OUT_OF_RESOURCES  Resource not enough.
  @retval EFI_NOT_FOUND         Platform not found.
  @retval EFI_SUCCESS           Operation success.
 
**/
typedef
EFI_STATUS
(EFIAPI *UBA_CONFIG_ADD_DATA) (
  IN  UBA_CONFIG_DATABASE_PROTOCOL          *This,
  IN  EFI_GUID                              *ResId,
  IN  VOID                                  *Data,
  IN  UINTN                                 DataSize
  );
 
/**
  Get configuration data from uba configuration database.
 
  @param This                   uba Protocol instance.
  @param ResId                  The configuration data resource id.
  @param Data                   The data buffer pointer.
  @param DataSize               IN:Size of data want to get, OUT: Size of data in database.
 
  @retval EFI_INVALID_PARAMETER Required parameters not correct.
  @retval EFI_BUFFER_TOO_SMALL  The DataSize of Data buffer is too small to get this configuration data
  @retval EFI_OUT_OF_RESOURCES  Resource not enough.
  @retval EFI_NOT_FOUND         Platform or data not found.
  @retval EFI_SUCCESS           Operation success.
 
**/
typedef
EFI_STATUS
(EFIAPI *UBA_CONFIG_GET_DATA) (
  IN  UBA_CONFIG_DATABASE_PROTOCOL          *This,
  IN  EFI_GUID                              *ResId,
  OUT VOID                                  *Data,
  OUT UINTN                                 *DataSize
  );
 
 
//
// UbaConfigDatabaseProtocol
//
struct _UBA_CONFIG_DATABASE_PROTOCOL {
  UINT32                                Signature;
  UINT32                                Version;
 
  UBA_CONFIG_GET_PLATFORM               GetSku;
  UBA_CONFIG_ADD_DATA                   AddData;
  UBA_CONFIG_GET_DATA                   GetData;
};
 
extern EFI_GUID gUbaConfigDatabaseProtocolGuid;
 
#endif // __UBA_CONFIG_DATABASE_H_