summaryrefslogtreecommitdiffstats
path: root/MdePkg/Include/Common/PcdTemp.h
blob: 3428b4f6fe661b856c94eac63d276b6a416de9e0 (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
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
/** @file

Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution.  The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

#ifndef __PCD_TEMP_H__
#define __PCD_TEMP_H__

#define PCD_INVALID_TOKEN     ((UINTN)(-1))

/*
 * The following structure will be removed soon after the real 
 * PCD service PEIM and DXE driver are implmented.
 */

///
/// I have rearranged the data so that the variable length items are at the end of the structure
/// and we have a reasonable change of interpreting the other stuff properly.
///
typedef struct {
  UINTN                 Token;

  //
  // HII Knowledge - non optimized for now
  //
  UINT8                 HiiData;          // If TRUE, use Variable Data
  UINT8                 SKUEnabled;       // If TRUE, there might be various SKU data entries for this Token
  UINT8                 MaxSKUCount;      // Up to 256 entries - limits the search space
  UINT8                 SKUId;            // ID of the SKU

  GUID                  VariableGuid;     // Variable GUID
  UINT32                DatumSize;
  UINT64                Datum;
  CHAR16                *VariableName;    // Null-terminated Variable Name (remember to calculate size)
                                          // We still need Offset information for the variable
                                          // So naturally we can use DatumSize as the Length Field
                                          // And we can overload the use of Datum for the Offset information
  VOID                  *ExtendedData;    // VOID* data of size DatumSize
} EMULATED_PCD_ENTRY;

typedef
VOID
(EFIAPI *PCD_TEMP_CALLBACK) (
  IN  CONST EFI_GUID   *CallBackGuid, OPTIONAL
  IN  UINTN            CallBackToken,
  IN  VOID             *TokenData,
  IN  UINTN            TokenDataSize
  );

///
/// Used by the PCD Database - never contained in an FFS file
///
typedef struct {
  UINTN                 Token;

  //
  // HII Knowledge - non optimized for now
  //
  UINT8                 HiiData;          // If TRUE, use Variable Data
  UINT8                 SKUEnabled;       // If TRUE, there might be various SKU data entries for this Token
  UINT8                 MaxSKUCount;      // Up to 256 entries - limits the search space
  UINT8                 SKUId;            // ID of the SKU

  GUID                  VariableGuid;     // Variable GUID
  UINT32                DatumSize;
  UINT64                Datum;
  CHAR16                *VariableName;    // Null-terminated Variable Name (remember to calculate size)
                                          // We still need Offset information for the variable
                                          // So naturally we can use DatumSize as the Length Field
                                          // And we can overload the use of Datum for the Offset information
  VOID                  *ExtendedData;    // VOID* data of size DatumSize

  PCD_TEMP_CALLBACK     *CallBackList;
  UINT32                CallBackEntries;
  UINT32                CallBackListSize;
} EMULATED_PCD_ENTRY_EX;                  // This exists to facilitate PCD Database implementation only

typedef struct {
  UINTN                   Count;
  EMULATED_PCD_ENTRY_EX   Entry[1];                  // This exists to facilitate PCD Database implementation only
} EMULATED_PCD_DATABASE_EX;

#endif