VirtualBox

Ignore:
Timestamp:
Mar 12, 2019 12:40:12 PM (6 years ago)
Author:
vboxsync
Message:

EFI: First step in UDK2018 merge. Does not build yet.

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
56 added
3 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/FirmwarePerformance.h

    r58459 r77662  
    22  ACPI Firmware Performance Data Table (FPDT) implementation specific definitions.
    33
    4   Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
    55  This program and the accompanying materials
    66  are licensed and made available under the terms and conditions of the BSD License
     
    9696
    9797///
     98/// Boot performance table for the performance record in SMM phase.
     99///
     100///
     101typedef struct {
     102  EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER   Header;     ///< Common ACPI table header.
     103  //
     104  // one or more boot performance records.
     105  //
     106} SMM_BOOT_PERFORMANCE_TABLE;
     107
     108///
    98109/// Performance data pointed by Performance Pointer Record.
    99110///
     
    117128// Log BOOT RECORD from SMM driver on boot time.
    118129//
    119 #define SMM_FPDT_FUNCTION_GET_BOOT_RECORD_SIZE          1
    120 #define SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA          2
     130#define SMM_FPDT_FUNCTION_GET_BOOT_RECORD_SIZE           1
     131#define SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA           2
     132#define SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET 3
    121133
    122134typedef struct {
     
    125137  UINTN             BootRecordSize;
    126138  VOID              *BootRecordData;
     139  UINTN             BootRecordOffset;
    127140} SMM_BOOT_RECORD_COMMUNICATE;
    128141
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/MdeModuleHii.h

    r58466 r77662  
    22  EDKII extented HII IFR guid opcodes.
    33
    4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials are licensed and made available under
    66the terms and conditions of the BSD License that accompanies this distribution.
     
    212212} EFI_IFR_GUID_VAREQNAME;
    213213
     214///
     215/// EDKII implementation extension GUID, used to indaicate there are bit fields in the varstore.
     216///
     217#define EDKII_IFR_BIT_VARSTORE_GUID \
     218  {0x82DDD68B, 0x9163, 0x4187, {0x9B, 0x27, 0x20, 0xA8, 0xFD, 0x60,0xA7, 0x1D}}
     219
     220///
     221/// EDKII implementation extension flags, used to indaicate the disply style and bit width for bit filed storage.
     222/// Two high bits for display style and the low six bits for bit width.
     223///
     224#define EDKII_IFR_DISPLAY_BIT            0xC0
     225#define EDKII_IFR_DISPLAY_INT_DEC_BIT    0x00
     226#define EDKII_IFR_DISPLAY_UINT_DEC_BIT   0x40
     227#define EDKII_IFR_DISPLAY_UINT_HEX_BIT   0x80
     228
     229#define EDKII_IFR_NUMERIC_SIZE_BIT       0x3F
     230
    214231#pragma pack()
    215232
    216233extern EFI_GUID gEfiIfrTianoGuid;
    217234extern EFI_GUID gEfiIfrFrameworkGuid;
     235extern EFI_GUID gEdkiiIfrBitVarstoreGuid;
    218236
    219237#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/MemoryProfile.h

    r58466 r77662  
    22  Memory profile data structure.
    33
    4   Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
    55  This program and the accompanying materials
    66  are licensed and made available under the terms and conditions of the BSD License
     
    1616#define _MEMORY_PROFILE_H_
    1717
    18 //
    19 // For BIOS MemoryType (0 ~ EfiMaxMemoryType), it is recorded in UsageByType[MemoryType]. (Each valid entry has one entry)
     18#include <Pi/PiFirmwareFile.h>
     19
     20//
     21// For BIOS MemoryType (0 ~ EfiMaxMemoryType - 1), it is recorded in UsageByType[MemoryType]. (Each valid entry has one entry)
    2022// For OS MemoryType (0x80000000 ~ 0xFFFFFFFF), it is recorded in UsageByType[EfiMaxMemoryType]. (All types are combined into one entry)
     23// For OEM MemoryType (0x70000000 ~ 0x7FFFFFFF), it is recorded in UsageByType[EfiMaxMemoryType + 1]. (All types are combined into one entry)
    2124//
    2225
     
    2831
    2932#define MEMORY_PROFILE_CONTEXT_SIGNATURE SIGNATURE_32 ('M','P','C','T')
    30 #define MEMORY_PROFILE_CONTEXT_REVISION 0x0001
     33#define MEMORY_PROFILE_CONTEXT_REVISION 0x0002
    3134
    3235typedef struct {
     
    3437  UINT64                        CurrentTotalUsage;
    3538  UINT64                        PeakTotalUsage;
    36   UINT64                        CurrentTotalUsageByType[EfiMaxMemoryType + 1];
    37   UINT64                        PeakTotalUsageByType[EfiMaxMemoryType + 1];
     39  UINT64                        CurrentTotalUsageByType[EfiMaxMemoryType + 2];
     40  UINT64                        PeakTotalUsageByType[EfiMaxMemoryType + 2];
    3841  UINT64                        TotalImageSize;
    3942  UINT32                        ImageCount;
     
    4245
    4346#define MEMORY_PROFILE_DRIVER_INFO_SIGNATURE SIGNATURE_32 ('M','P','D','I')
    44 #define MEMORY_PROFILE_DRIVER_INFO_REVISION 0x0001
     47#define MEMORY_PROFILE_DRIVER_INFO_REVISION 0x0003
    4548
    4649typedef struct {
     
    5659  UINT64                        CurrentUsage;
    5760  UINT64                        PeakUsage;
    58   UINT64                        CurrentUsageByType[EfiMaxMemoryType + 1];
    59   UINT64                        PeakUsageByType[EfiMaxMemoryType + 1];
     61  UINT64                        CurrentUsageByType[EfiMaxMemoryType + 2];
     62  UINT64                        PeakUsageByType[EfiMaxMemoryType + 2];
     63  UINT16                        PdbStringOffset;
     64  UINT8                         Reserved2[6];
     65//CHAR8                         PdbString[];
    6066} MEMORY_PROFILE_DRIVER_INFO;
    6167
     
    6773} MEMORY_PROFILE_ACTION;
    6874
     75//
     76// Below is the detailed MEMORY_PROFILE_ACTION definition.
     77//
     78//  31       15      9  8  8 7  7 6   6 5-4  3 - 0
     79// +----------------------------------------------+
     80// |User |  |Lib|   |Re|Copy|Zero|Align|Type|Basic|
     81// +----------------------------------------------+
     82//
     83
     84//
     85// Basic Action
     86//      1 : AllocatePages
     87//      2 : FreePages
     88//      3 : AllocatePool
     89//      4 : FreePool
     90//
     91#define MEMORY_PROFILE_ACTION_BASIC_MASK 0xF
     92
     93//
     94// Extension
     95//
     96#define MEMORY_PROFILE_ACTION_EXTENSION_MASK               0xFFF0
     97#define MEMORY_PROFILE_ACTION_EXTENSION_LIB_MASK           0x8000
     98#define MEMORY_PROFILE_ACTION_EXTENSION_REALLOC_MASK       0x0200
     99#define MEMORY_PROFILE_ACTION_EXTENSION_COPY_MASK          0x0100
     100#define MEMORY_PROFILE_ACTION_EXTENSION_ZERO_MASK          0x0080
     101#define MEMORY_PROFILE_ACTION_EXTENSION_ALIGN_MASK         0x0040
     102#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_MASK      0x0030
     103#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_BASIC     0x0000
     104#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RUNTIME   0x0010
     105#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RESERVED  0x0020
     106
     107//
     108// Extension (used by memory allocation lib)
     109//
     110#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES                    0x8001
     111#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES            0x8011
     112#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES           0x8021
     113#define MEMORY_PROFILE_ACTION_LIB_FREE_PAGES                        0x8002
     114#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_PAGES            0x8041
     115#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RUNTIME_PAGES    0x8051
     116#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RESERVED_PAGES   0x8061
     117#define MEMORY_PROFILE_ACTION_LIB_FREE_ALIGNED_PAGES                0x8042
     118#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_POOL                     0x8003
     119#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_POOL             0x8013
     120#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_POOL            0x8023
     121#define MEMORY_PROFILE_ACTION_LIB_FREE_POOL                         0x8004
     122#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ZERO_POOL                0x8083
     123#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_ZERO_POOL        0x8093
     124#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_ZERO_POOL       0x80a3
     125#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_COPY_POOL                0x8103
     126#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_COPY_POOL        0x8113
     127#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_COPY_POOL       0x8123
     128#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_POOL                   0x8203
     129#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RUNTIME_POOL           0x8213
     130#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL          0x8223
     131
     132//
     133// User defined: 0x80000000~0xFFFFFFFF
     134//
     135// NOTE: User defined action MUST OR the basic action,
     136//       so that core can know the action is allocate or free,
     137//       and the type is pages (can be freed partially)
     138//       or pool (cannot be freed partially).
     139//
     140#define MEMORY_PROFILE_ACTION_USER_DEFINED_MASK           0x80000000
     141
    69142#define MEMORY_PROFILE_ALLOC_INFO_SIGNATURE SIGNATURE_32 ('M','P','A','I')
    70 #define MEMORY_PROFILE_ALLOC_INFO_REVISION 0x0001
     143#define MEMORY_PROFILE_ALLOC_INFO_REVISION 0x0002
    71144
    72145typedef struct {
     
    74147  PHYSICAL_ADDRESS              CallerAddress;
    75148  UINT32                        SequenceId;
    76   UINT8                         Reserved[4];
     149  UINT8                         Reserved[2];
     150  UINT16                        ActionStringOffset;
    77151  MEMORY_PROFILE_ACTION         Action;
    78152  EFI_MEMORY_TYPE               MemoryType;
    79153  PHYSICAL_ADDRESS              Buffer;
    80154  UINT64                        Size;
     155//CHAR8                         ActionString[];
    81156} MEMORY_PROFILE_ALLOC_INFO;
    82157
     
    141216
    142217  @return EFI_SUCCESS               Get the memory profile data successfully.
     218  @return EFI_UNSUPPORTED           Memory profile is unsupported.
    143219  @return EFI_BUFFER_TO_SMALL       The ProfileSize is too small for the resulting data.
    144220                                    ProfileSize is updated with the size required.
     
    162238  @param[in] FileType           File type of the image.
    163239
    164   @return EFI_SUCCESS           Register success.
    165   @return EFI_OUT_OF_RESOURCE   No enough resource for this register.
     240  @return EFI_SUCCESS           Register successfully.
     241  @return EFI_UNSUPPORTED       Memory profile is unsupported,
     242                                or memory profile for the image is not required.
     243  @return EFI_OUT_OF_RESOURCES  No enough resource for this register.
    166244
    167245**/
     
    184262  @param[in] ImageSize          Image size.
    185263
    186   @return EFI_SUCCESS           Unregister success.
     264  @return EFI_SUCCESS           Unregister successfully.
     265  @return EFI_UNSUPPORTED       Memory profile is unsupported,
     266                                or memory profile for the image is not required.
    187267  @return EFI_NOT_FOUND         The image is not found.
    188268
     
    197277  );
    198278
     279#define MEMORY_PROFILE_RECORDING_ENABLE     TRUE
     280#define MEMORY_PROFILE_RECORDING_DISABLE    FALSE
     281
     282/**
     283  Get memory profile recording state.
     284
     285  @param[in]  This              The EDKII_MEMORY_PROFILE_PROTOCOL instance.
     286  @param[out] RecordingState    Recording state.
     287
     288  @return EFI_SUCCESS           Memory profile recording state is returned.
     289  @return EFI_UNSUPPORTED       Memory profile is unsupported.
     290  @return EFI_INVALID_PARAMETER RecordingState is NULL.
     291
     292**/
     293typedef
     294EFI_STATUS
     295(EFIAPI *EDKII_MEMORY_PROFILE_GET_RECORDING_STATE) (
     296  IN EDKII_MEMORY_PROFILE_PROTOCOL      *This,
     297  OUT BOOLEAN                           *RecordingState
     298  );
     299
     300/**
     301  Set memory profile recording state.
     302
     303  @param[in] This               The EDKII_MEMORY_PROFILE_PROTOCOL instance.
     304  @param[in] RecordingState     Recording state.
     305
     306  @return EFI_SUCCESS           Set memory profile recording state successfully.
     307  @return EFI_UNSUPPORTED       Memory profile is unsupported.
     308
     309**/
     310typedef
     311EFI_STATUS
     312(EFIAPI *EDKII_MEMORY_PROFILE_SET_RECORDING_STATE) (
     313  IN EDKII_MEMORY_PROFILE_PROTOCOL      *This,
     314  IN BOOLEAN                            RecordingState
     315  );
     316
     317/**
     318  Record memory profile of multilevel caller.
     319
     320  @param[in] This               The EDKII_MEMORY_PROFILE_PROTOCOL instance.
     321  @param[in] CallerAddress      Address of caller.
     322  @param[in] Action             Memory profile action.
     323  @param[in] MemoryType         Memory type.
     324                                EfiMaxMemoryType means the MemoryType is unknown.
     325  @param[in] Buffer             Buffer address.
     326  @param[in] Size               Buffer size.
     327  @param[in] ActionString       String for memory profile action.
     328                                Only needed for user defined allocate action.
     329
     330  @return EFI_SUCCESS           Memory profile is updated.
     331  @return EFI_UNSUPPORTED       Memory profile is unsupported,
     332                                or memory profile for the image is not required,
     333                                or memory profile for the memory type is not required.
     334  @return EFI_ACCESS_DENIED     It is during memory profile data getting.
     335  @return EFI_ABORTED           Memory profile recording is not enabled.
     336  @return EFI_OUT_OF_RESOURCES  No enough resource to update memory profile for allocate action.
     337  @return EFI_NOT_FOUND         No matched allocate info found for free action.
     338
     339**/
     340typedef
     341EFI_STATUS
     342(EFIAPI *EDKII_MEMORY_PROFILE_RECORD) (
     343  IN EDKII_MEMORY_PROFILE_PROTOCOL      *This,
     344  IN PHYSICAL_ADDRESS                   CallerAddress,
     345  IN MEMORY_PROFILE_ACTION              Action,
     346  IN EFI_MEMORY_TYPE                    MemoryType,
     347  IN VOID                               *Buffer,
     348  IN UINTN                              Size,
     349  IN CHAR8                              *ActionString OPTIONAL
     350  );
     351
    199352struct _EDKII_MEMORY_PROFILE_PROTOCOL {
    200   EDKII_MEMORY_PROFILE_GET_DATA         GetData;
    201   EDKII_MEMORY_PROFILE_REGISTER_IMAGE   RegisterImage;
    202   EDKII_MEMORY_PROFILE_UNREGISTER_IMAGE UnregisterImage;
     353  EDKII_MEMORY_PROFILE_GET_DATA             GetData;
     354  EDKII_MEMORY_PROFILE_REGISTER_IMAGE       RegisterImage;
     355  EDKII_MEMORY_PROFILE_UNREGISTER_IMAGE     UnregisterImage;
     356  EDKII_MEMORY_PROFILE_GET_RECORDING_STATE  GetRecordingState;
     357  EDKII_MEMORY_PROFILE_SET_RECORDING_STATE  SetRecordingState;
     358  EDKII_MEMORY_PROFILE_RECORD               Record;
    203359};
    204360
     
    237393// SMRAM profile command
    238394//
    239 #define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO         0x1
    240 #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA         0x2
     395#define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO           0x1
     396#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA           0x2
    241397//
    242398// Below 2 commands are now used by ECP only and only valid before SmmReadyToLock
    243399//
    244 #define SMRAM_PROFILE_COMMAND_REGISTER_IMAGE           0x3
    245 #define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE         0x4
     400#define SMRAM_PROFILE_COMMAND_REGISTER_IMAGE             0x3
     401#define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE           0x4
     402
     403#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET 0x5
     404#define SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE        0x6
     405#define SMRAM_PROFILE_COMMAND_SET_RECORDING_STATE        0x7
    246406
    247407typedef struct {
     
    264424typedef struct {
    265425  SMRAM_PROFILE_PARAMETER_HEADER    Header;
     426  //
     427  // On input, profile buffer size.
     428  // On output, actual profile data size copied.
     429  //
     430  UINT64                            ProfileSize;
     431  PHYSICAL_ADDRESS                  ProfileBuffer;
     432  //
     433  // On input, profile buffer offset to copy.
     434  // On output, next time profile buffer offset to copy.
     435  //
     436  UINT64                            ProfileOffset;
     437} SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA_BY_OFFSET;
     438
     439typedef struct {
     440  SMRAM_PROFILE_PARAMETER_HEADER    Header;
     441  BOOLEAN                           RecordingState;
     442} SMRAM_PROFILE_PARAMETER_RECORDING_STATE;
     443
     444typedef struct {
     445  SMRAM_PROFILE_PARAMETER_HEADER    Header;
    266446  EFI_GUID                          FileName;
    267447  PHYSICAL_ADDRESS                  ImageBuffer;
     
    278458
    279459#define EDKII_MEMORY_PROFILE_GUID { \
    280   0x821c9a09, 0x541a, 0x40f6, 0x9f, 0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe \
     460  0x821c9a09, 0x541a, 0x40f6, { 0x9f, 0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe } \
    281461}
    282462
    283463extern EFI_GUID gEdkiiMemoryProfileGuid;
    284464
     465typedef EDKII_MEMORY_PROFILE_PROTOCOL EDKII_SMM_MEMORY_PROFILE_PROTOCOL;
     466
     467#define EDKII_SMM_MEMORY_PROFILE_GUID { \
     468  0xe22bbcca, 0x516a, 0x46a8, { 0x80, 0xe2, 0x67, 0x45, 0xe8, 0x36, 0x93, 0xbd } \
     469}
     470
     471extern EFI_GUID gEdkiiSmmMemoryProfileGuid;
     472
    285473#endif
    286474
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h

    r58466 r77662  
    33
    44Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
     5(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
    56This program and the accompanying materials are licensed and made available under
    67the terms and conditions of the BSD License that accompanies this distribution.
     
    5758
    5859///
     60/// A header structure that is followed by an array of records that contain the
     61/// parameters passed into the ReportStatusCode() service in the DXE Services Table.
     62///
     63typedef struct {
     64  ///
     65  /// The index pointing to the last recored being stored.
     66  ///
     67  UINT32   RecordIndex;
     68  ///
     69  /// The number of records being stored.
     70  ///
     71  UINT32   NumberOfRecords;
     72  ///
     73  /// The maximum number of records that can be stored.
     74  ///
     75  UINT32   MaxRecordsNumber;
     76} RUNTIME_MEMORY_STATUSCODE_HEADER;
     77
     78///
    5979/// A structure that contains the parameters passed into the ReportStatusCode()
    6080/// service in the PEI Services Table.
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h

    r58466 r77662  
    22  Guid for Pcd DataBase Signature.
    33
    4 Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials are licensed and made available under
    66the terms and conditions of the BSD License that accompanies this distribution.
     
    2424// Common definitions
    2525//
    26 typedef UINT8 SKU_ID;
     26typedef UINT64 SKU_ID;
    2727
    2828#define PCD_TYPE_SHIFT        28
     
    3131#define PCD_TYPE_HII          (0x8U << PCD_TYPE_SHIFT)
    3232#define PCD_TYPE_VPD          (0x4U << PCD_TYPE_SHIFT)
    33 #define PCD_TYPE_SKU_ENABLED  (0x2U << PCD_TYPE_SHIFT)
    3433#define PCD_TYPE_STRING       (0x1U << PCD_TYPE_SHIFT)
    3534
    36 #define PCD_TYPE_ALL_SET      (PCD_TYPE_DATA | PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED | PCD_TYPE_STRING)
     35#define PCD_TYPE_ALL_SET      (PCD_TYPE_DATA | PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_STRING)
    3736
    3837#define PCD_DATUM_TYPE_SHIFT  24
     
    6362
    6463typedef struct {
    65   UINT32  SkuDataStartOffset;   // Offset(with TYPE info) from the PCD_DB.
    66   UINT32  SkuIdTableOffset;     // Offset from the PCD_DB.
    67 } SKU_HEAD;
    68 
    69 typedef struct {
    7064  UINT32  StringIndex;          // Offset in String Table in units of UINT8.
    7165  UINT32  DefaultValueOffset;   // Offset of the Default Value.
    7266  UINT16  GuidTableIndex;       // Offset in Guid Table in units of GUID.
    7367  UINT16  Offset;               // Offset in Variable.
     68  UINT32  Attributes;           // Variable attributes.
     69  UINT16  Property;             // Variable property.
     70  UINT16  Reserved;
    7471} VARIABLE_HEAD;
    7572
     
    9289    GUID                  Signature;            // PcdDataBaseGuid.
    9390    UINT32                BuildVersion;
    94     UINT32                Length;
     91    UINT32                Length;               // Length of DEFAULT SKU PCD DB
     92    SKU_ID                SystemSkuId;          // Current SkuId value.
     93    UINT32                LengthForAllSkus;     // Length of all SKU PCD DB
    9594    UINT32                UninitDataBaseSize;   // Total size for PCD those default value with 0.
    9695    TABLE_OFFSET          LocalTokenNumberTableOffset;
     
    104103    UINT16                ExTokenCount;         // EX_TOKEN_NUMBER for DynamicEx.
    105104    UINT16                GuidTableCount;       // The Number of Guid in GuidTable.
    106     SKU_ID                SystemSkuId;          // Current SkuId value.
    107     UINT8                 Pad;                  // Pad bytes to satisfy the alignment.
     105    UINT8                 Pad[6];               // Pad bytes to satisfy the alignment.
    108106
    109107    //
     
    112110    // Padding is needed to keep necessary alignment
    113111    //
     112    //SKU_ID                         SkuIdTable[];            // SkuIds system supports.
    114113    //UINT64                         ValueUint64[];
    115114    //UINT32                         ValueUint32[];
     
    121120    //PCD_NAME_INDEX                 PcdNameTable[];          // PCD name index info. It can be accessed by the PcdNameTableOffset.
    122121    //VARIABLE_HEAD                  VariableHead[];          // HII PCD
    123     //SKU_HEAD                       SkuHead[];               // Store SKU info for each PCD with SKU enable.
    124122    //UINT8                          StringTable[];           // String for String PCD value and HII PCD Variable Name. It can be accessed by StringTableOffset.
    125123    //SIZE_INFO                      SizeTable[];             // MaxSize and CurSize for String PCD. It can be accessed by SizeTableOffset.
     
    127125    //UINT8                          ValueUint8[];
    128126    //BOOLEAN                        ValueBoolean[];
    129     //UINT8                          SkuIdTable[];            // SkuIds system supports.
    130     //UINT8                          SkuIndexTable[];         // SkuIds for each PCD with SKU enable.
    131127
    132128} PCD_DATABASE_INIT;
     
    144140} PCD_DATABASE;
    145141
     142typedef struct {
     143  UINT32 Offset:24;
     144  UINT32 Value:8;
     145} PCD_DATA_DELTA;
     146
     147typedef struct {
     148  SKU_ID SkuId;
     149  UINT16 DefaultId;
     150  UINT8  Reserved[6];
     151} PCD_DEFAULT_INFO;
     152
     153typedef struct {
     154  //
     155  // Full size, it must be at 8 byte alignment.
     156  //
     157  UINT32 DataSize;
     158  //
     159  // HeaderSize includes HeaderSize fields and DefaultInfo arrays
     160  //
     161  UINT32 HeaderSize;
     162  //
     163  // DefaultInfo arrays those have the same default setting.
     164  //
     165  PCD_DEFAULT_INFO DefaultInfo[1];
     166  //
     167  // Default data is stored as variable storage or the array of DATA_DELTA.
     168  //
     169} PCD_DEFAULT_DATA;
     170
     171#define PCD_NV_STORE_DEFAULT_BUFFER_SIGNATURE SIGNATURE_32('N', 'S', 'D', 'B')
     172
     173typedef struct {
     174  //
     175  // PCD_NV_STORE_DEFAULT_BUFFER_SIGNATURE
     176  //
     177  UINT32    Signature;
     178  //
     179  // Length of the taken default buffer
     180  //
     181  UINT32    Length;
     182  //
     183  // Length of the total reserved buffer
     184  //
     185  UINT32    MaxLength;
     186  //
     187  // Reserved for 8 byte alignment
     188  //
     189  UINT32    Reserved;
     190  // one or more PCD_DEFAULT_DATA
     191} PCD_NV_STORE_DEFAULT_BUFFER_HEADER;
     192
     193//
     194// NvStoreDefaultValueBuffer layout:
     195// +-------------------------------------+
     196// | PCD_NV_STORE_DEFAULT_BUFFER_HEADER  |
     197// +-------------------------------------+
     198// | PCD_DEFAULT_DATA (DEFAULT, Standard)|
     199// +-------------------------------------+
     200// | PCD_DATA_DELTA   (DEFAULT, Standard)|
     201// +-------------------------------------+
     202// | ......                              |
     203// +-------------------------------------+
     204// | PCD_DEFAULT_DATA (SKU A, Standard)  |
     205// +-------------------------------------+
     206// | PCD_DATA_DELTA   (SKU A, Standard)  |
     207// +-------------------------------------+
     208// | ......                              |
     209// +-------------------------------------+
     210//
     211
     212#pragma pack(1)
     213typedef struct {
     214  SKU_ID    SkuId;
     215  SKU_ID    SkuIdCompared;
     216  UINT32    Length;
     217  // PCD_DATA_DELTA   DeltaData[]
     218} PCD_DATABASE_SKU_DELTA;
     219
     220//
     221// PCD database layout:
     222// +---------------------------------+
     223// | PCD_DATABASE_INIT (DEFAULT SKU) |
     224// +---------------------------------+
     225// | PCD_DATABASE_SKU_DELTA (SKU A)  |
     226// +---------------------------------+
     227// | PCD_DATABASE_SKU_DELTA (SKU B)  |
     228// +---------------------------------+
     229// | ......                          |
     230// +---------------------------------+
     231//
     232#pragma pack()
    146233
    147234#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/Performance.h

    r58466 r77662  
    55  * performance variables.
    66
    7 Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
     7Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
    88This program and the accompanying materials are licensed and made available under
    99the terms and conditions of the BSD License that accompanies this distribution.
     
    1818#ifndef __PERFORMANCE_DATA_H__
    1919#define __PERFORMANCE_DATA_H__
     20
     21#define PERFORMANCE_PROPERTY_REVISION 0x1
     22
     23typedef struct {
     24  UINT32                Revision;
     25  UINT32                Reserved;
     26  UINT64                Frequency;
     27  UINT64                TimerStartValue;
     28  UINT64                TimerEndValue;
     29} PERFORMANCE_PROPERTY;
    2030
    2131//
     
    4151} PEI_PERFORMANCE_LOG_HEADER;
    4252
    43 
    44 //
    45 // The data structure for performance data in ACPI memory.
    46 //
    47 #define PERFORMANCE_SIGNATURE   SIGNATURE_32 ('P', 'e', 'r', 'f')
    48 #define PERF_TOKEN_SIZE         28
    49 #define PERF_TOKEN_LENGTH       (PERF_TOKEN_SIZE - 1)
    50 #define PERF_PEI_ENTRY_MAX_NUM  50
    51 #define PERF_DATA_MAX_LENGTH    0x4000
    52 
    53 typedef struct {
    54   CHAR8   Token[PERF_TOKEN_SIZE];
    55   UINT32  Duration;
    56 } PERF_DATA;
    57 
    58 typedef struct {
    59   UINT64        BootToOs;
    60   UINT64        S3Resume;
    61   UINT32        S3EntryNum;
    62   PERF_DATA     S3Entry[PERF_PEI_ENTRY_MAX_NUM];
    63   UINT64        CpuFreq;
    64   UINT64        BDSRaw;
    65   UINT32        Count;
    66   UINT32        Signiture;
    67 } PERF_HEADER;
    6853
    6954#define PERFORMANCE_PROTOCOL_GUID \
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/RecoveryDevice.h

    r48674 r77662  
    55  that convey the name of a given recovery module type.
    66
    7 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
     7Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
    88
    99This program and the accompanying materials
     
    2727  { \
    2828    0x5cac0099, 0x0dc9, 0x48e5, {0x80, 0x68, 0xbb, 0x95, 0xf5, 0x40, 0x0a, 0x9f } \
    29   };
     29  }
    3030
    3131///
     
    3535  { \
    3636    0x2e3d2e75, 0x9b2e, 0x412d, {0xb4, 0xb1, 0x70, 0x41, 0x6b, 0x87, 0x0, 0xff } \
    37   };
     37  }
    3838
    3939///
     
    4343  { \
    4444    0xb38573b6, 0x6200, 0x4ac5, {0xb5, 0x1d, 0x82, 0xe6, 0x59, 0x38, 0xd7, 0x83 } \
    45   };
     45  }
    4646
    4747///
     
    5151  { \
    5252    0x0ffbce19, 0x324c, 0x4690, {0xa0, 0x09, 0x98, 0xc6, 0xae, 0x2e, 0xb1, 0x86 } \
    53   };
     53  }
    5454
    5555extern EFI_GUID gRecoveryOnDataCdGuid;
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/SmmVariableCommon.h

    r58466 r77662  
    22  The file defined some common structures used for communicating between SMM variable module and SMM variable wrapper module.
    33
    4 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials are licensed and made available under
    66the terms and conditions of the BSD License that accompanies this distribution.
     
    1515#ifndef _SMM_VARIABLE_COMMON_H_
    1616#define _SMM_VARIABLE_COMMON_H_
     17
     18#include <Protocol/VarCheck.h>
    1719
    1820#define EFI_SMM_VARIABLE_WRITE_GUID \
     
    6668#define SMM_VARIABLE_FUNCTION_LOCK_VARIABLE           8
    6769
     70#define SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_SET  9
     71
     72#define SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_GET  10
     73
     74#define SMM_VARIABLE_FUNCTION_GET_PAYLOAD_SIZE        11
     75
    6876///
    6977/// Size of SMM communicate header, without including the payload.
     
    108116typedef SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME SMM_VARIABLE_COMMUNICATE_LOCK_VARIABLE;
    109117
     118typedef struct {
     119  EFI_GUID                      Guid;
     120  UINTN                         NameSize;
     121  VAR_CHECK_VARIABLE_PROPERTY   VariableProperty;
     122  CHAR16                        Name[1];
     123} SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY;
     124
     125typedef struct {
     126  UINTN                         VariablePayloadSize;
     127} SMM_VARIABLE_COMMUNICATE_GET_PAYLOAD_SIZE;
     128
    110129#endif // _SMM_VARIABLE_COMMON_H_
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/SystemNvDataGuid.h

    r58466 r77662  
    55  This file also defines WorkingBlockSignature GUID for FTW working block signature.
    66
    7 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
     7Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
    88This program and the accompanying materials are licensed and made available under
    99the terms and conditions of the BSD License that accompanies this distribution.
     
    4343  EFI_GUID  Signature;
    4444  ///
    45   /// 32bit CRC caculated for this header.
     45  /// 32bit CRC calculated for this header.
    4646  ///
    4747  UINT32    Crc;
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Guid/VariableFormat.h

    r58466 r77662  
    33  VariableFormat.h defines variable data headers and variable storage region headers.
    44
    5 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials are licensed and made available under
    77the terms and conditions of the BSD License that accompanies this distribution.
     
    2020  { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d } }
    2121
     22#define EFI_AUTHENTICATED_VARIABLE_GUID \
     23  { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 } }
     24
    2225extern EFI_GUID gEfiVariableGuid;
     26extern EFI_GUID gEfiAuthenticatedVariableGuid;
    2327
    2428///
     
    6165
    6266#define VARIABLE_STORE_SIGNATURE  EFI_VARIABLE_GUID
     67#define AUTHENTICATED_VARIABLE_STORE_SIGNATURE  EFI_AUTHENTICATED_VARIABLE_GUID
    6368
    6469///
     
    107112
    108113///
     114/// Variable Attribute combinations.
     115///
     116#define VARIABLE_ATTRIBUTE_NV_BS        (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)
     117#define VARIABLE_ATTRIBUTE_BS_RT        (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS)
     118#define VARIABLE_ATTRIBUTE_BS_RT_AT     (VARIABLE_ATTRIBUTE_BS_RT | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
     119#define VARIABLE_ATTRIBUTE_NV_BS_RT     (VARIABLE_ATTRIBUTE_BS_RT | EFI_VARIABLE_NON_VOLATILE)
     120#define VARIABLE_ATTRIBUTE_NV_BS_RT_HR  (VARIABLE_ATTRIBUTE_NV_BS_RT | EFI_VARIABLE_HARDWARE_ERROR_RECORD)
     121#define VARIABLE_ATTRIBUTE_NV_BS_RT_AT  (VARIABLE_ATTRIBUTE_NV_BS_RT | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
     122#define VARIABLE_ATTRIBUTE_AT           EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
     123#define VARIABLE_ATTRIBUTE_NV_BS_RT_HR_AT    (VARIABLE_ATTRIBUTE_NV_BS_RT_HR | VARIABLE_ATTRIBUTE_AT)
     124///
     125/// EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered as reserved
     126///
     127#define VARIABLE_ATTRIBUTE_AT_AW        (EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
     128#define VARIABLE_ATTRIBUTE_NV_BS_RT_AW  (VARIABLE_ATTRIBUTE_NV_BS_RT | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
     129#define VARIABLE_ATTRIBUTE_NV_BS_RT_HR_AT_AW    (VARIABLE_ATTRIBUTE_NV_BS_RT_HR | VARIABLE_ATTRIBUTE_AT_AW)
     130
     131///
    109132/// Single Variable Data Header Structure.
    110133///
     
    136159  EFI_GUID    VendorGuid;
    137160} VARIABLE_HEADER;
     161
     162///
     163/// Single Authenticated Variable Data Header Structure.
     164///
     165typedef struct {
     166  ///
     167  /// Variable Data Start Flag.
     168  ///
     169  UINT16      StartId;
     170  ///
     171  /// Variable State defined above.
     172  ///
     173  UINT8       State;
     174  UINT8       Reserved;
     175  ///
     176  /// Attributes of variable defined in UEFI specification.
     177  ///
     178  UINT32      Attributes;
     179  ///
     180  /// Associated monotonic count value against replay attack.
     181  ///
     182  UINT64      MonotonicCount;
     183  ///
     184  /// Associated TimeStamp value against replay attack.
     185  ///
     186  EFI_TIME    TimeStamp;
     187  ///
     188  /// Index of associated public key in database.
     189  ///
     190  UINT32      PubKeyIndex;
     191  ///
     192  /// Size of variable null-terminated Unicode string name.
     193  ///
     194  UINT32      NameSize;
     195  ///
     196  /// Size of the variable data without this header.
     197  ///
     198  UINT32      DataSize;
     199  ///
     200  /// A unique identifier for the vendor that produces and consumes this varaible.
     201  ///
     202  EFI_GUID    VendorGuid;
     203} AUTHENTICATED_VARIABLE_HEADER;
     204
     205typedef struct {
     206  EFI_GUID    *Guid;
     207  CHAR16      *Name;
     208  UINTN       VariableSize;
     209} VARIABLE_ENTRY_CONSISTENCY;
    138210
    139211#pragma pack()
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/CapsuleLib.h

    r58466 r77662  
    33  This library class defines a set of interfaces for how to process capsule image updates.
    44
    5 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials are licensed and made available under
    77the terms and conditions of the BSD License that accompanies this distribution.
     
    2222  the capsule image.
    2323
     24  Caution: This function may receive untrusted input.
     25
    2426  @param  CapsuleHeader    Pointer to the UEFI capsule image to be checked.
    2527
     
    3739  if it recognized the format of this capsule image.
    3840
     41  Caution: This function may receive untrusted input.
     42
    3943  @param  CapsuleHeader    Pointer to the UEFI capsule image to be processed.
    4044
     
    4852  );
    4953
     54/**
     55
     56  This routine is called to process capsules.
     57
     58  Caution: This function may receive untrusted input.
     59
     60  The capsules reported in EFI_HOB_UEFI_CAPSULE are processed.
     61  If there is no EFI_HOB_UEFI_CAPSULE, this routine does nothing.
     62
     63  This routine should be called twice in BDS.
     64  1) The first call must be before EndOfDxe. The system capsules is processed.
     65     If device capsule FMP protocols are exposted at this time and device FMP
     66     capsule has zero EmbeddedDriverCount, the device capsules are processed.
     67     Each individual capsule result is recorded in capsule record variable.
     68     System may reset in this function, if reset is required by capsule and
     69     all capsules are processed.
     70     If not all capsules are processed, reset will be defered to second call.
     71
     72  2) The second call must be after EndOfDxe and after ConnectAll, so that all
     73     device capsule FMP protocols are exposed.
     74     The system capsules are skipped. If the device capsules are NOT processed
     75     in first call, they are processed here.
     76     Each individual capsule result is recorded in capsule record variable.
     77     System may reset in this function, if reset is required by capsule
     78     processed in first call and second call.
     79
     80  @retval EFI_SUCCESS             There is no error when processing capsules.
     81  @retval EFI_OUT_OF_RESOURCES    No enough resource to process capsules.
     82
     83**/
     84EFI_STATUS
     85EFIAPI
     86ProcessCapsules (
     87  VOID
     88  );
     89
    5090#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h

    r58466 r77662  
    33  It also provides capability to register user interrupt/exception handler.
    44
    5   Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
     5  Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.<BR>
    66  This program and the accompanying materials
    77  are licensed and made available under the terms and conditions of the BSD License
     
    2020#include <Protocol/Cpu.h>
    2121
     22#define CPU_EXCEPTION_INIT_DATA_REV     1
     23
     24typedef union {
     25  struct {
     26    //
     27    // Revision number of this structure.
     28    //
     29    UINT32                    Revision;
     30    //
     31    // The address of top of known good stack reserved for *ALL* exceptions
     32    // listed in field StackSwitchExceptions.
     33    //
     34    UINTN                     KnownGoodStackTop;
     35    //
     36    // The size of known good stack for *ONE* exception only.
     37    //
     38    UINTN                     KnownGoodStackSize;
     39    //
     40    // Buffer of exception vector list for stack switch.
     41    //
     42    UINT8                     *StackSwitchExceptions;
     43    //
     44    // Number of exception vectors in StackSwitchExceptions.
     45    //
     46    UINTN                     StackSwitchExceptionNumber;
     47    //
     48    // Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR.
     49    // Normally there's no need to change IDT table size.
     50    //
     51    VOID                      *IdtTable;
     52    //
     53    // Size of buffer for IdtTable.
     54    //
     55    UINTN                     IdtTableSize;
     56    //
     57    // Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR.
     58    //
     59    VOID                      *GdtTable;
     60    //
     61    // Size of buffer for GdtTable.
     62    //
     63    UINTN                     GdtTableSize;
     64    //
     65    // Pointer to start address of descriptor of exception task gate in the
     66    // GDT table. It must be type of IA32_TSS_DESCRIPTOR.
     67    //
     68    VOID                      *ExceptionTssDesc;
     69    //
     70    // Size of buffer for ExceptionTssDesc.
     71    //
     72    UINTN                     ExceptionTssDescSize;
     73    //
     74    // Buffer of task-state segment for exceptions. It must be type of
     75    // IA32_TASK_STATE_SEGMENT.
     76    //
     77    VOID                      *ExceptionTss;
     78    //
     79    // Size of buffer for ExceptionTss.
     80    //
     81    UINTN                     ExceptionTssSize;
     82    //
     83    // Flag to indicate if default handlers should be initialized or not.
     84    //
     85    BOOLEAN                   InitDefaultHandlers;
     86  } Ia32, X64;
     87} CPU_EXCEPTION_INIT_DATA;
     88
    2289/**
    2390  Initializes all CPU exceptions entries and provides the default exception handlers.
     
    40107InitializeCpuExceptionHandlers (
    41108  IN EFI_VECTOR_HANDOFF_INFO       *VectorInfo OPTIONAL
     109  );
     110
     111/**
     112  Initializes all CPU exceptions entries with optional extra initializations.
     113
     114  By default, this method should include all functionalities implemented by
     115  InitializeCpuExceptionHandlers(), plus extra initialization works, if any.
     116  This could be done by calling InitializeCpuExceptionHandlers() directly
     117  in this method besides the extra works.
     118
     119  InitData is optional and its use and content are processor arch dependent.
     120  The typical usage of it is to convey resources which have to be reserved
     121  elsewhere and are necessary for the extra initializations of exception.
     122
     123  @param[in]  VectorInfo    Pointer to reserved vector list.
     124  @param[in]  InitData      Pointer to data optional for extra initializations
     125                            of exception.
     126
     127  @retval EFI_SUCCESS             The exceptions have been successfully
     128                                  initialized.
     129  @retval EFI_INVALID_PARAMETER   VectorInfo or InitData contains invalid
     130                                  content.
     131  @retval EFI_UNSUPPORTED         This function is not supported.
     132
     133**/
     134EFI_STATUS
     135EFIAPI
     136InitializeCpuExceptionHandlersEx (
     137  IN EFI_VECTOR_HANDOFF_INFO            *VectorInfo OPTIONAL,
     138  IN CPU_EXCEPTION_INIT_DATA            *InitData OPTIONAL
    42139  );
    43140
     
    94191  );
    95192
     193/**
     194  Display processor context.
     195
     196  @param[in] ExceptionType  Exception type.
     197  @param[in] SystemContext  Processor context to be display.
     198**/
     199VOID
     200EFIAPI
     201DumpCpuContext (
     202  IN EFI_EXCEPTION_TYPE   ExceptionType,
     203  IN EFI_SYSTEM_CONTEXT   SystemContext
     204  );
     205
    96206#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/CustomizedDisplayLib.h

    r58466 r77662  
    203203
    204204/**
    205   Prints a chracter to the default console, at
     205  Prints a character to the default console, at
    206206  the supplied cursor position, using L"%c" format.
    207207
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/DebugAgentLib.h

    r58459 r77662  
    4040  Caller provided function to be invoked at the end of InitializeDebugAgent().
    4141
    42   Refer to the descrption for InitializeDebugAgent() for more details.
     42  Refer to the description for InitializeDebugAgent() for more details.
    4343
    4444  @param[in] Context    The first input parameter of InitializeDebugAgent().
     
    6262  responsible to invoke the passing-in function at the end of InitializeDebugAgent().
    6363
    64   If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by
     64  If the parameter Function is not NULL, Debug Agent Library instance will invoke it by
    6565  passing in the Context to be its parameter.
    6666
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/HiiLib.h

    r58466 r77662  
    226226
    227227/**
     228  This function allows a caller to extract the form set opcode form the Hii Handle.
     229  The returned buffer is allocated using AllocatePool().The caller is responsible
     230  for freeing the allocated buffer using FreePool().
     231
     232  @param Handle            The HII handle.
     233  @param Buffer            On return, points to a pointer which point to the buffer that contain the formset opcode.
     234  @param BufferSize        On return, points to the length of the buffer.
     235
     236  @retval EFI_OUT_OF_RESOURCES   No enough memory resource is allocated.
     237  @retval EFI_NOT_FOUND          Can't find the package data for the input Handle.
     238  @retval EFI_INVALID_PARAMETER  The input parameters are not correct.
     239  @retval EFI_SUCCESS            Get the formset opcode from the hii handle successfully.
     240
     241**/
     242EFI_STATUS
     243EFIAPI
     244HiiGetFormSetFromHiiHandle(
     245  IN  EFI_HII_HANDLE     Handle,
     246  OUT EFI_IFR_FORM_SET   **Buffer,
     247  OUT UINTN              *BufferSize
     248  );
     249
     250/**
    228251  Retrieves a pointer to a Null-terminated ASCII string containing the list
    229252  of languages that an HII handle in the HII Database supports.  The returned
     
    237260
    238261  @retval NULL   HiiHandle is not registered in the HII database
    239   @retval NULL   There are not enough resources available to retrieve the suported
     262  @retval NULL   There are not enough resources available to retrieve the supported
    240263                 languages.
    241   @retval NULL   The list of suported languages could not be retrieved.
     264  @retval NULL   The list of supported languages could not be retrieved.
    242265  @retval Other  A pointer to the Null-terminated ASCII string of supported languages.
    243266
     
    262285  @param[in]  Guid          The pointer to an EFI_GUID that is the routing information
    263286                            GUID.  Each of the 16 bytes in Guid is converted to
    264                             a 2 Unicode character hexidecimal string.  This is
     287                            a 2 Unicode character hexadecimal string.  This is
    265288                            an optional parameter that may be NULL.
    266289  @param[in]  Name          The pointer to a Null-terminated Unicode string that is
     
    268291                            parameter that may be NULL.  Each 16-bit Unicode
    269292                            character in Name is converted to a 4 character Unicode
    270                             hexidecimal string.
     293                            hexadecimal string.
    271294  @param[in]  DriverHandle  The driver handle that supports a Device Path Protocol
    272295                            that is the routing information PATH.  Each byte of
    273296                            the Device Path associated with DriverHandle is converted
    274                             to a two (Unicode) character hexidecimal string.
     297                            to a two (Unicode) character hexadecimal string.
    275298
    276299  @retval NULL   DriverHandle does not support the Device Path Protocol.
     
    300323  @param DefaultId  Specifies the type of defaults to retrieve.
    301324
    302   @retval TURE    The default value was set successfully.
     325  @retval TRUE    The default value was set successfully.
    303326  @retval FALSE   The default value was not found.
    304327**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/IpIoLib.h

    r58466 r77662  
    33  It provides the combined IpIo layer on the EFI IP4 Protocol and EFI IP6 protocol.
    44
    5 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials are licensed and made available under
    77the terms and conditions of the BSD License that accompanies this distribution.
     
    262262  PKT_SENT_NOTIFY               PktSentNotify;   ///< See IP_IO_OPEN_DATA::PktSentNotify.
    263263  UINT8                         IpVersion;
     264  IP4_ADDR                      StationIp;
     265  IP4_ADDR                      SubnetMask;
    264266} IP_IO;
    265267
     
    310312  Create a new IP_IO instance.
    311313
     314  If IpVersion is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
     315
    312316  This function uses IP4/IP6 service binding protocol in Controller to create
    313317  an IP4/IP6 child (aka IP4/IP6 instance).
     
    353357  Stop an IP_IO instance.
    354358
     359  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
     360
    355361  This function is paired with IpIoOpen(). The IP_IO will be unconfigured, and all
    356362  pending send/receive tokens will be canceled.
     
    358364  @param[in, out]  IpIo            The pointer to the IP_IO instance that needs to stop.
    359365
    360   @retval          EFI_SUCCESS     The IP_IO instance stopped successfully.
    361   @retval          Others          Anrror condition occurred.
     366  @retval          EFI_SUCCESS            The IP_IO instance stopped successfully.
     367  @retval          EFI_INVALID_PARAMETER  Invalid input parameter.
     368  @retval          Others                 Anrror condition occurred.
    362369
    363370**/
     
    370377/**
    371378  Open an IP_IO instance for use.
     379
     380  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
    372381
    373382  This function is called after IpIoCreate(). It is used for configuring the IP
     
    380389                                      the IP_IO instance.
    381390
    382   @retval          EFI_SUCCESS        The IP_IO instance opened with OpenData
    383                                       successfully.
    384   @retval          EFI_ACCESS_DENIED  The IP_IO instance is configured; avoid
    385                                       reopening it.
    386   @retval          Others             An error condition occurred.
     391  @retval          EFI_SUCCESS            The IP_IO instance opened with OpenData
     392                                          successfully.
     393  @retval          EFI_ACCESS_DENIED      The IP_IO instance is configured, avoid to
     394                                          reopen it.
     395  @retval          EFI_UNSUPPORTED        IPv4 RawData mode is no supported.
     396  @retval          EFI_INVALID_PARAMETER  Invalid input parameter.
     397  @retval          Others                 Error condition occurred.
    387398
    388399**/
     
    397408  Send out an IP packet.
    398409
    399   This function is called after IpIoOpen(). The data to be sent are wrapped in
    400   Pkt. The IP instance wrapped in IpIo is used for sending by default, but can be
    401   overriden by Sender. Other sending configurations, such as source address and gateway
    402   address, are specified in OverrideData.
    403 
    404   @param[in, out]  IpIo                  The pointer to an IP_IO instance used for sending IP
     410  This function is called after IpIoOpen(). The data to be sent is wrapped in
     411  Pkt. The IP instance wrapped in IpIo is used for sending by default but can be
     412  overriden by Sender. Other sending configs, like source address and gateway
     413  address etc., are specified in OverrideData.
     414
     415  @param[in, out]  IpIo                  Pointer to an IP_IO instance used for sending IP
    405416                                         packet.
    406   @param[in, out]  Pkt                   The pointer to the IP packet to be sent.
    407   @param[in]       Sender                Optional. The IP protocol instance used for sending.
    408   @param[in]       Context               The optional context data.
    409   @param[in]       NotifyData            The optional notify data.
     417  @param[in, out]  Pkt                   Pointer to the IP packet to be sent.
     418  @param[in]       Sender                The IP protocol instance used for sending.
     419  @param[in]       Context               Optional context data.
     420  @param[in]       NotifyData            Optional notify data.
    410421  @param[in]       Dest                  The destination IP address to send this packet to.
     422                                         This parameter is optional when using IPv6.
    411423  @param[in]       OverrideData          The data to override some configuration of the IP
    412424                                         instance used for sending.
    413425
    414   @retval          EFI_SUCCESS           The operation completed successfully.
     426  @retval          EFI_SUCCESS           The operation is completed successfully.
     427  @retval          EFI_INVALID_PARAMETER The input parameter is not correct.
    415428  @retval          EFI_NOT_STARTED       The IpIo is not configured.
    416   @retval          EFI_OUT_OF_RESOURCES  Failed due to resource limitations.
     429  @retval          EFI_OUT_OF_RESOURCES  Failed due to resource limit.
     430  @retval          Others                Error condition occurred.
    417431
    418432**/
     
    425439  IN     VOID           *Context       OPTIONAL,
    426440  IN     VOID           *NotifyData    OPTIONAL,
    427   IN     EFI_IP_ADDRESS *Dest,
     441  IN     EFI_IP_ADDRESS *Dest          OPTIONAL,
    428442  IN     IP_IO_OVERRIDE *OverrideData  OPTIONAL
    429443  );
     
    431445/**
    432446  Cancel the IP transmit token that wraps this Packet.
     447
     448  If IpIo is NULL, then ASSERT().
     449  If Packet is NULL, then ASSERT().
    433450
    434451  @param[in]  IpIo                  The pointer to the IP_IO instance.
     
    446463  Add a new IP instance for sending data.
    447464
     465  If IpIo is NULL, then ASSERT().
     466  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
     467
    448468  The function is used to add the IP_IO to the IP_IO sending list. The caller
    449469  can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send
     
    465485  Configure the IP instance of this IpInfo and start the receiving if IpConfigData
    466486  is not NULL.
     487
     488  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
    467489
    468490  @param[in, out]  IpInfo          The pointer to the IP_IO_IP_INFO instance.
     
    489511  sending purpose.
    490512
     513  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
     514
    491515  This function pairs with IpIoAddIp(). The IpInfo is previously created by
    492516  IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance
     
    517541
    518542  @return The pointer to the IP protocol can be used for sending purpose and its local
    519           address is the same with Src.
     543          address is the same with Src. NULL if failed.
    520544
    521545**/
     
    540564  @param[out]  Notify                If TRUE, SockError needs to be notified.
    541565
     566  @retval EFI_UNSUPPORTED            Unrecognizable ICMP error code
    542567  @return The ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.
    543568
     
    573598  @retval      EFI_NOT_FOUND         The neighbor cache entry is not in the
    574599                                     neighbor table.
     600  @retval      EFI_UNSUPPORTED       IP version is IPv4, which doesn't support neighbor cache refresh.
    575601  @retval      EFI_OUT_OF_RESOURCES  Failed due to resource limitations.
    576602
    577603**/
    578604EFI_STATUS
     605EFIAPI
    579606IpIoRefreshNeighbor (
    580607  IN IP_IO           *IpIo,
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/LockBoxLib.h

    r58466 r77662  
    33  confidential information to LockBox and get it by PEI modules in S3 phase.
    44
    5 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
    66
    77This program and the accompanying materials
     
    6363
    6464//
    65 // With this flag, this LockBox can be restored to this Buffer with RestoreAllLockBoxInPlace()
     65// With this flag, this LockBox can be restored to this Buffer
     66// with RestoreAllLockBoxInPlace()
    6667//
    67 #define LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE  BIT0
     68#define LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE     BIT0
     69//
     70// With this flag, this LockBox can be restored in S3 resume only.
     71// This LockBox can not be restored after SmmReadyToLock in normal boot
     72// and after EndOfS3Resume in S3 resume.
     73// It can not be set together with LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE.
     74//
     75#define LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY   BIT1
    6876
    6977/**
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/NetLib.h

    r58466 r77662  
    33  It provides basic functions for the UEFI network stack.
    44
    5 Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials
    77are licensed and made available under the terms and conditions of the BSD License
     
    3838#define  IP4_PROTO_IGMP        0x02
    3939#define  IP6_ICMP              58
     40#define  DNS_MAX_NAME_SIZE     255
     41#define  DNS_MAX_MESSAGE_SIZE  512
    4042
    4143//
    4244// The address classification
    4345//
    44 #define  IP4_ADDR_CLASSA       1
    45 #define  IP4_ADDR_CLASSB       2
    46 #define  IP4_ADDR_CLASSC       3
     46#define  IP4_ADDR_CLASSA       1     // Deprecated
     47#define  IP4_ADDR_CLASSB       2     // Deprecated
     48#define  IP4_ADDR_CLASSC       3     // Deprecated
    4749#define  IP4_ADDR_CLASSD       4
    4850#define  IP4_ADDR_CLASSE       5
     
    5052#define  IP4_MASK_NUM          33
    5153#define  IP6_PREFIX_NUM        129
     54
     55#define  IP4_MASK_MAX          32
     56#define  IP6_PREFIX_MAX        128
    5257
    5358#define  IP6_HOP_BY_HOP        0
     
    6368
    6469#define  IP6_PREFIX_LENGTH     64
     70
     71//
     72// DNS QTYPE values
     73//
     74#define  DNS_TYPE_A            1
     75#define  DNS_TYPE_NS           2
     76#define  DNS_TYPE_CNAME        5
     77#define  DNS_TYPE_SOA          6
     78#define  DNS_TYPE_WKS          11
     79#define  DNS_TYPE_PTR          12
     80#define  DNS_TYPE_HINFO        13
     81#define  DNS_TYPE_MINFO        14
     82#define  DNS_TYPE_MX           15
     83#define  DNS_TYPE_TXT          16
     84#define  DNS_TYPE_AAAA         28
     85#define  DNS_TYPE_SRV_RR       33
     86#define  DNS_TYPE_AXFR         252
     87#define  DNS_TYPE_MAILB        253
     88#define  DNS_TYPE_ANY          255
     89
     90//
     91// DNS QCLASS values
     92//
     93#define  DNS_CLASS_INET        1
     94#define  DNS_CLASS_CH          3
     95#define  DNS_CLASS_HS          4
     96#define  DNS_CLASS_ANY         255
     97
     98//
     99// Number of 100ns units time Interval for network media state detect
     100//
     101#define MEDIA_STATE_DETECT_TIME_INTERVAL  1000000U
     102
    65103
    66104#pragma pack(1)
     
    200238//
    201239#define IP4_IS_MULTICAST(Ip)              (((Ip) & 0xF0000000) == 0xE0000000)
     240#define IP4_IS_UNSPECIFIED(Ip)            ((Ip) == 0)
    202241#define IP4_IS_LOCAL_BROADCAST(Ip)        ((Ip) == 0xFFFFFFFF)
    203242#define IP4_NET_EQUAL(Ip1, Ip2, NetMask)  (((Ip1) & (NetMask)) == ((Ip2) & (NetMask)))
    204 #define IP4_IS_VALID_NETMASK(Ip)          (NetGetMaskLength (Ip) != IP4_MASK_NUM)
     243#define IP4_IS_VALID_NETMASK(Ip)          (NetGetMaskLength (Ip) != (IP4_MASK_MAX + 1))
    205244
    206245#define IP6_IS_MULTICAST(Ip6)             (((Ip6)->Addr[0]) == 0xFF)
     
    221260//
    222261// The debug level definition. This value is also used as the
    223 // syslog's servity level. Don't change it.
     262// syslog's severity level. Don't change it.
    224263//
    225264#define NETDEBUG_LEVEL_TRACE   5
     
    304343  Because it isn't open the SNP BY_DRIVER, apply caution when using it.
    305344
    306   @param Level    The servity level of the message.
    307   @param Module   The Moudle that generates the log.
     345  @param Level    The severity level of the message.
     346  @param Module   The Module that generates the log.
    308347  @param File     The file that contains the log.
    309348  @param Line     The exact line that contains the log.
     
    347386  Return the class of the IP address, such as class A, B, C.
    348387  Addr is in host byte order.
     388
     389  [ATTENTION]
     390  Classful addressing (IP class A/B/C) has been deprecated according to RFC4632.
     391  Caller of this function could only check the returned value against
     392  IP4_ADDR_CLASSD (multicast) or IP4_ADDR_CLASSE (reserved) now.
    349393
    350394  The address of class A  starts with 0.
     
    373417/**
    374418  Check whether the IP is a valid unicast address according to
    375   the netmask. If NetMask is zero, use the IP address's class to get the default mask.
    376 
    377   If Ip is 0, IP is not a valid unicast address.
    378   Class D address is used for multicasting and class E address is reserved for future. If Ip
    379   belongs to class D or class E, Ip is not a valid unicast address.
    380   If all bits of the host address of Ip are 0 or 1, Ip is not a valid unicast address.
     419  the netmask.
     420
     421  ASSERT if NetMask is zero.
     422
     423  If all bits of the host address of IP are 0 or 1, IP is also not a valid unicast address,
     424  except when the originator is one of the endpoints of a point-to-point link with a 31-bit
     425  mask (RFC3021).
    381426
    382427  @param[in]  Ip                    The IP to check against.
    383428  @param[in]  NetMask               The mask of the IP.
    384429
    385   @return TRUE if Ip is a valid unicast address on the network, otherwise FALSE.
     430  @return TRUE if IP is a valid unicast address on the network, otherwise FALSE.
    386431
    387432**/
     
    395440/**
    396441  Check whether the incoming IPv6 address is a valid unicast address.
     442
     443  ASSERT if Ip6 is NULL.
    397444
    398445  If the address is a multicast address has binary 0xFF at the start, it is not
     
    417464  Check whether the incoming Ipv6 address is the unspecified address or not.
    418465
     466  ASSERT if Ip6 is NULL.
     467
    419468  @param[in] Ip6   - Ip6 address, in network order.
    420469
     
    432481  Check whether the incoming Ipv6 address is a link-local address.
    433482
     483  ASSERT if Ip6 is NULL.
     484
    434485  @param[in] Ip6   - Ip6 address, in network order.
    435486
     
    446497/**
    447498  Check whether the Ipv6 address1 and address2 are on the connected network.
     499
     500  ASSERT if Ip1 or Ip2 is NULL.
     501  ASSERT if PrefixLength exceeds or equals to IP6_PREFIX_MAX.
    448502
    449503  @param[in] Ip1          - Ip6 address1, in network order.
     
    466520  Switches the endianess of an IPv6 address.
    467521
     522  ASSERT if Ip6 is NULL.
     523
    468524  This function swaps the bytes in a 128-bit IPv6 address to switch the value
    469525  from little endian to big endian or vice versa. The byte swapped value is
     
    487543
    488544#define NET_IS_DIGIT(Ch)            (('0' <= (Ch)) && ((Ch) <= '9'))
     545#define NET_IS_HEX(Ch)              ((('0' <= (Ch)) && ((Ch) <= '9')) || (('A' <= (Ch)) && ((Ch) <= 'F')) || (('a' <= (Ch)) && ((Ch) <= 'f')))
    489546#define NET_ROUNDUP(size, unit)     (((size) + (unit) - 1) & (~((unit) - 1)))
    490547#define NET_IS_LOWER_CASE_CHAR(Ch)  (('a' <= (Ch)) && ((Ch) <= 'z'))
     
    499556  Extract a UINT32 from a byte stream.
    500557
     558  ASSERT if Buf is NULL.
     559
    501560  This function copies a UINT32 from a byte stream, and then converts it from Network
    502561  byte order to host byte order. Use this function to avoid alignment error.
     
    515574/**
    516575  Puts a UINT32 into the byte stream in network byte order.
     576
     577  ASSERT if Buf is NULL.
    517578
    518579  Converts a UINT32 from host byte order to network byte order, then copies it to the
     
    531592
    532593/**
    533   Initialize a random seed using current time.
    534 
    535   Get current time first. Then initialize a random seed based on some basic
    536   mathematical operations on the hour, day, minute, second, nanosecond and year
    537   of the current time.
    538 
    539   @return The random seed, initialized with current time.
     594  Initialize a random seed using current time and monotonic count.
     595
     596  Get current time and monotonic count first. Then initialize a random seed
     597  based on some basic mathematics operation on the hour, day, minute, second,
     598  nanosecond and year of the current time and the monotonic count value.
     599
     600  @return The random seed initialized with current time.
    540601
    541602**/
     
    632693  Insert a new node entry after a designated node entry of a doubly linked list.
    633694
     695  ASSERT if PrevEntry or NewEntry is NULL.
     696
    634697  Inserts a new node entry designated by NewEntry after the node entry designated by PrevEntry
    635698  of the doubly linked list.
     
    648711/**
    649712  Insert a new node entry before a designated node entry of a doubly linked list.
     713
     714  ASSERT if PostEntry or NewEntry is NULL.
    650715
    651716  Inserts a new node entry designated by NewEntry before the node entry designated by PostEntry
     
    719784                                 if NumberOfChildren is 0.
    720785
    721   @retval TURE                   Found the input Handle in ChildHandleBuffer.
     786  @retval TRUE                   Found the input Handle in ChildHandleBuffer.
    722787  @retval FALSE                  Can't find the input Handle in ChildHandleBuffer.
    723788
     
    794859  If Map is NULL, then ASSERT().
    795860
    796 
    797861  @param[in]  Map                   The net map to test.
    798862
     
    808872/**
    809873  Return the number of the <Key, Value> pairs in the netmap.
     874
     875  If Map is NULL, then ASSERT().
    810876
    811877  @param[in]  Map                   The netmap to get the entry number.
     
    828894
    829895  If Map is NULL, then ASSERT().
     896  If Key is NULL, then ASSERT().
    830897
    831898  @param[in, out]  Map                   The netmap to insert into.
     
    853920
    854921  If Map is NULL, then ASSERT().
     922  If Key is NULL, then ASSERT().
    855923
    856924  @param[in, out]  Map                   The netmap to insert into.
     
    877945
    878946  If Map is NULL, then ASSERT().
     947  If Key is NULL, then ASSERT().
    879948
    880949  @param[in]  Map                   The netmap to search within.
     
    9771046  Iterate through the netmap and call CallBack for each item.
    9781047
    979   It will contiue the traverse if CallBack returns EFI_SUCCESS, otherwise, break
     1048  It will continue the traverse if CallBack returns EFI_SUCCESS, otherwise, break
    9801049  from the loop. It returns the CallBack's last return value. This function is
    9811050  delete safe for the current item.
     
    11221191  Get MAC address associated with the network service handle.
    11231192
     1193  If MacAddress is NULL, then ASSERT().
     1194  If AddressSize is NULL, then ASSERT().
     1195
    11241196  There should be MNP Service Binding Protocol installed on the input ServiceHandle.
    11251197  If SNP is installed on the ServiceHandle or its parent handle, MAC address will
     
    11461218  Convert MAC address of the NIC associated with specified Service Binding Handle
    11471219  to a unicode string. Callers are responsible for freeing the string storage.
     1220
     1221  If MacString is NULL, then ASSERT().
    11481222
    11491223  Locate simple network protocol associated with the Service Binding Handle and
     
    11751249/**
    11761250  Detect media status for specified network device.
     1251
     1252  If MediaPresent is NULL, then ASSERT().
    11771253
    11781254  The underlying UNDI driver may or may not support reporting media status from
     
    12091285
    12101286/**
     1287  Detect media state for a network device. This routine will wait for a period of time at
     1288  a specified checking interval when a certain network is under connecting until connection
     1289  process finishes or timeout. If Aip protocol is supported by low layer drivers, three kinds
     1290  of media states can be detected: EFI_SUCCESS, EFI_NOT_READY and EFI_NO_MEDIA, represents
     1291  connected state, connecting state and no media state respectively. When function detects
     1292  the current state is EFI_NOT_READY, it will loop to wait for next time's check until state
     1293  turns to be EFI_SUCCESS or EFI_NO_MEDIA. If Aip protocol is not supported, function will
     1294  call NetLibDetectMedia() and return state directly.
     1295
     1296  @param[in]   ServiceHandle    The handle where network service binding protocols are
     1297                                installed on.
     1298  @param[in]   Timeout          The maximum number of 100ns units to wait when network
     1299                                is connecting. Zero value means detect once and return
     1300                                immediately.
     1301  @param[out]  MediaState       The pointer to the detected media state.
     1302
     1303  @retval EFI_SUCCESS           Media detection success.
     1304  @retval EFI_INVALID_PARAMETER ServiceHandle is not a valid network device handle or
     1305                                MediaState pointer is NULL.
     1306  @retval EFI_DEVICE_ERROR      A device error occurred.
     1307  @retval EFI_TIMEOUT           Network is connecting but timeout.
     1308
     1309**/
     1310EFI_STATUS
     1311EFIAPI
     1312NetLibDetectMediaWaitTimeout (
     1313  IN  EFI_HANDLE            ServiceHandle,
     1314  IN  UINT64                Timeout,
     1315  OUT EFI_STATUS            *MediaState
     1316  );
     1317
     1318
     1319/**
    12111320  Create an IPv4 device path node.
     1321
     1322  If Node is NULL, then ASSERT().
    12121323
    12131324  The header type of IPv4 device path node is MESSAGING_DEVICE_PATH.
     
    12421353  Create an IPv6 device path node.
    12431354
     1355  If Node is NULL, then ASSERT().
     1356  If LocalIp is NULL, then ASSERT().
     1357  If RemoteIp is NULL, then ASSERT().
     1358
    12441359  The header type of IPv6 device path node is MESSAGING_DEVICE_PATH.
    12451360  The header subtype of IPv6 device path node is MSG_IPv6_DP.
     
    12721387  Find the UNDI/SNP handle from controller and protocol GUID.
    12731388
     1389  If ProtocolGuid is NULL, then ASSERT().
     1390
    12741391  For example, IP will open an MNP child to transmit/receive
    12751392  packets. When MNP is stopped, IP should also be stopped. IP
     
    12771394  service binding instance that is installed on the UNDI/SNP handle.
    12781395  The controller is then either an MNP or an ARP child handle. Note that
    1279   IP opens these handles using BY_DRIVER. Use that infomation to get the
     1396  IP opens these handles using BY_DRIVER. Use that information to get the
    12801397  UNDI/SNP handle.
    12811398
     
    13181435
    13191436  @retval EFI_SUCCESS            Converted to an IPv4 address successfully.
    1320   @retval EFI_INVALID_PARAMETER  The string is malformated, or Ip4Address is NULL.
     1437  @retval EFI_INVALID_PARAMETER  The string is malformatted, or Ip4Address is NULL.
    13211438
    13221439**/
     
    13301447/**
    13311448  Convert one Null-terminated ASCII string to EFI_IPv6_ADDRESS. The format of the
    1332   string is defined in RFC 4291 - Text Pepresentation of Addresses.
     1449  string is defined in RFC 4291 - Text Representation of Addresses.
    13331450
    13341451  @param[in]      String         The pointer to the Ascii string.
     
    13361453
    13371454  @retval EFI_SUCCESS            Converted to an IPv6 address successfully.
    1338   @retval EFI_INVALID_PARAMETER  The string is malformated, or Ip6Address is NULL.
     1455  @retval EFI_INVALID_PARAMETER  The string is malformatted, or Ip6Address is NULL.
    13391456
    13401457**/
     
    13531470
    13541471  @retval EFI_SUCCESS            Converted to an IPv4 address successfully.
    1355   @retval EFI_INVALID_PARAMETER  The string is mal-formated or Ip4Address is NULL.
    1356   @retval EFI_OUT_OF_RESOURCES   Failed to perform the operation due to lack of resources.
     1472  @retval EFI_INVALID_PARAMETER  The string is mal-formatted or Ip4Address is NULL.
    13571473
    13581474**/
     
    13661482/**
    13671483  Convert one Null-terminated Unicode string to EFI_IPv6_ADDRESS.  The format of
    1368   the string is defined in RFC 4291 - Text Pepresentation of Addresses.
     1484  the string is defined in RFC 4291 - Text Representation of Addresses.
    13691485
    13701486  @param[in]      String         The pointer to the Ascii string.
     
    13721488
    13731489  @retval EFI_SUCCESS            Converted to an IPv6 address successfully.
    1374   @retval EFI_INVALID_PARAMETER  The string is malformated or Ip6Address is NULL.
    1375   @retval EFI_OUT_OF_RESOURCES   Failed to perform the operation due to a lack of resources.
     1490  @retval EFI_INVALID_PARAMETER  The string is malformatted or Ip6Address is NULL.
    13761491
    13771492**/
     
    13851500/**
    13861501  Convert one Null-terminated Unicode string to EFI_IPv6_ADDRESS and prefix length.
    1387   The format of the string is defined in RFC 4291 - Text Pepresentation of Addresses
     1502  The format of the string is defined in RFC 4291 - Text Representation of Addresses
    13881503  Prefixes: ipv6-address/prefix-length.
    13891504
     
    13931508
    13941509  @retval EFI_SUCCESS            Converted to an  IPv6 address successfully.
    1395   @retval EFI_INVALID_PARAMETER  The string is malformated, or Ip6Address is NULL.
    1396   @retval EFI_OUT_OF_RESOURCES   Failed to perform the operation due to a lack of resources.
     1510  @retval EFI_INVALID_PARAMETER  The string is malformatted, or Ip6Address is NULL.
    13971511
    13981512**/
     
    14621576  INTN                RefCnt;  // Reference count to share NET_VECTOR.
    14631577  NET_VECTOR_EXT_FREE Free;    // external function to free NET_VECTOR
    1464   VOID                *Arg;    // opeque argument to Free
     1578  VOID                *Arg;    // opaque argument to Free
    14651579  UINT32              Flag;    // Flags, NET_VECTOR_OWN_FIRST
    1466   UINT32              Len;     // Total length of the assocated BLOCKs
     1580  UINT32              Len;     // Total length of the associated BLOCKs
    14671581
    14681582  UINT32              BlockNum;
     
    15731687
    15741688#define NET_HEADSPACE(BlockOp)  \
    1575   (UINTN)((BlockOp)->Head - (BlockOp)->BlockHead)
     1689  ((UINTN)((BlockOp)->Head) - (UINTN)((BlockOp)->BlockHead))
    15761690
    15771691#define NET_TAILSPACE(BlockOp)  \
    1578   (UINTN)((BlockOp)->BlockTail - (BlockOp)->Tail)
     1692  ((UINTN)((BlockOp)->BlockTail) - (UINTN)((BlockOp)->Tail))
    15791693
    15801694/**
     
    21182232  This function obtains the system guid from the smbios table.
    21192233
     2234  If SystemGuid is NULL, then ASSERT().
     2235
    21202236  @param[out]  SystemGuid     The pointer of the returned system guid.
    21212237
     
    21302246  );
    21312247
     2248/**
     2249  Create Dns QName according the queried domain name.
     2250
     2251  If DomainName is NULL, then ASSERT().
     2252
     2253  QName is a domain name represented as a sequence of labels,
     2254  where each label consists of a length octet followed by that
     2255  number of octets. The QName terminates with the zero
     2256  length octet for the null label of the root. Caller should
     2257  take responsibility to free the buffer in returned pointer.
     2258
     2259  @param  DomainName    The pointer to the queried domain name string.
     2260
     2261  @retval NULL          Failed to fill QName.
     2262  @return               QName filled successfully.
     2263
     2264**/
     2265CHAR8 *
     2266EFIAPI
     2267NetLibCreateDnsQName (
     2268  IN  CHAR16              *DomainName
     2269  );
     2270
    21322271#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/ResetSystemLib.h

    r58466 r77662  
    33  methods that reset the whole system.
    44
    5 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials are licensed and made available under
    77the terms and conditions of the BSD License that accompanies this distribution.
     
    6666  );
    6767
     68/**
     69  This function causes a systemwide reset. The exact type of the reset is
     70  defined by the EFI_GUID that follows the Null-terminated Unicode string passed
     71  into ResetData. If the platform does not recognize the EFI_GUID in ResetData
     72  the platform must pick a supported reset type to perform.The platform may
     73  optionally log the parameters from any non-normal reset that occurs.
     74
     75  @param[in]  DataSize   The size, in bytes, of ResetData.
     76  @param[in]  ResetData  The data buffer starts with a Null-terminated string,
     77                         followed by the EFI_GUID.
     78**/
     79VOID
     80EFIAPI
     81ResetPlatformSpecific (
     82  IN UINTN   DataSize,
     83  IN VOID    *ResetData
     84  );
     85
    6886#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/TcpIoLib.h

    r58466 r77662  
    33  It provides the helper routines to access TCP service.
    44
    5 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials
    77are licensed and made available under the terms and conditions of the BSD License
     
    145145
    146146  @param[in, out]  TcpIo     The TcpIo wrapping the TCP socket.
    147   @param[in]       Timeout   The time to wait for connection done.
     147  @param[in]       Timeout   The time to wait for connection done. Set to NULL for infinite wait.
    148148
    149149  @retval EFI_SUCCESS            Connect to the other endpoint of the TCP socket
     
    161161TcpIoConnect (
    162162  IN OUT TCP_IO             *TcpIo,
    163   IN     EFI_EVENT          Timeout
     163  IN     EFI_EVENT          Timeout        OPTIONAL
    164164  );
    165165
     
    168168
    169169  @param[in, out]  TcpIo     The TcpIo wrapping the TCP socket.
    170   @param[in]       Timeout   The time to wait for connection done.
     170  @param[in]       Timeout   The time to wait for connection done. Set to NULL for infinite wait.
    171171
    172172
     
    186186TcpIoAccept (
    187187  IN OUT TCP_IO             *TcpIo,
    188   IN     EFI_EVENT          Timeout
     188  IN     EFI_EVENT          Timeout        OPTIONAL
    189189  );
    190190
     
    230230  @param[in]       AsyncMode   Is this receive asyncronous or not.
    231231  @param[in]       Timeout     The time to wait for receiving the amount of data the Packet
    232                                can hold.
     232                               can hold. Set to NULL for infinite wait.
    233233
    234234  @retval EFI_SUCCESS            The required amount of data is received from the socket.
     
    247247  IN     NET_BUF            *Packet,
    248248  IN     BOOLEAN            AsyncMode,
    249   IN     EFI_EVENT          Timeout
     249  IN     EFI_EVENT          Timeout       OPTIONAL
    250250  );
    251251
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Library/UdpIoLib.h

    r58466 r77662  
    33  It provides the helper routines to access UDP service. It is used by both DHCP and MTFTP.
    44
    5 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials
    77are licensed and made available under the terms and conditions of the BSD License
     
    198198/**
    199199  Cancel all the sent datagram that pass the selection criteria of ToCancel.
     200
    200201  If ToCancel is NULL, all the datagrams are cancelled.
     202  If Udp version is not UDP_IO_UDP4_VERSION or UDP_IO_UDP6_VERSION, then ASSERT().
    201203
    202204  @param[in]  UdpIo                 The UDP_IO to cancel packet.
     
    213215  IN EFI_STATUS             IoStatus,
    214216  IN UDP_IO_TO_CANCEL       ToCancel,        OPTIONAL
    215   IN VOID                   *Context
     217  IN VOID                   *Context         OPTIONAL
    216218  );
    217219
     
    219221  Creates a UDP_IO to access the UDP service. It creates and configures
    220222  a UDP child.
     223
     224  If Configure is NULL, then ASSERT().
     225  If Udp version is not UDP_IO_UDP4_VERSION or UDP_IO_UDP6_VERSION, then ASSERT().
    221226
    222227  It locates the UDP service binding prototype on the Controller parameter
     
    248253  Free the UDP_IO and all its related resources.
    249254
     255  If Udp version is not UDP_IO_UDP4_VERSION or UDP_IO_UDP6_VERSION, then ASSERT().
     256
    250257  The function cancels all sent datagrams and receive requests.
    251258
     
    253260
    254261  @retval EFI_SUCCESS           The UDP_IO is freed.
     262  @retval Others                Failed to free UDP_IO.
    255263
    256264**/
     
    265273  if you intend to later re-use the UDP_IO.
    266274
     275  If Udp version is not UDP_IO_UDP4_VERSION or UDP_IO_UDP6_VERSION, then ASSERT().
     276
    267277  This function releases all transmitted datagrams and receive requests and configures NULL for the UDP instance.
    268278
     
    278288/**
    279289  Send a packet through the UDP_IO.
     290
     291  If Udp version is not UDP_IO_UDP4_VERSION or UDP_IO_UDP6_VERSION, then ASSERT().
    280292
    281293  The packet will be wrapped in UDP_TX_TOKEN. Function Callback will be called
     
    325337  Issue a receive request to the UDP_IO.
    326338
     339  If Udp version is not UDP_IO_UDP4_VERSION or UDP_IO_UDP6_VERSION, then ASSERT().
     340
    327341  This function is called when upper-layer needs packet from UDP for processing.
    328342  Only one receive request is acceptable at a time. Therefore, one common usage model is
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Ppi/AtaController.h

    r58466 r77662  
    107107  @param[in] This          The pointer to this instance of the PEI_ATA_CONTROLLER_PPI.
    108108  @param[in] ChannelMask   The bitmask that identifies the IDE and SATA channels to
    109                            enable or disable. This paramter is optional.
     109                           enable or disable. This parameter is optional.
    110110
    111111  @retval EFI_SUCCESS        The IDE or SATA channels were enabled or disabled successfully.
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Ppi/SmmAccess.h

    r58466 r77662  
    129129///
    130130///  EFI SMM Access PPI is used to control the visibility of the SMRAM on the platform.
    131 ///  It abstracts the location and characteristics of SMRAM.  The expectation is
    132 ///  that the north bridge or memory controller would publish this PPI.
     131///  It abstracts the location and characteristics of SMRAM. The platform should report
     132///  all MMRAM via PEI_SMM_ACCESS_PPI. The expectation is that the north bridge or
     133///  memory controller would publish this PPI.
    133134///
    134135struct _PEI_SMM_ACCESS_PPI {
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Protocol/DisplayProtocol.h

    r58466 r77662  
    22  FormDiplay protocol to show Form
    33
    4 Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials are licensed and made available under
    66the terms and conditions of the BSD License that accompanies this distribution.
     
    4040#define BROWSER_WARNING_IF                BROWSER_ERROR | 0x07
    4141#define BROWSER_SUBMIT_FAIL_NO_SUBMIT_IF  BROWSER_ERROR | 0x08
     42#define BROWSER_RECONNECT_REQUIRED        BROWSER_ERROR | 0x09
     43#define BROWSER_RECONNECT_FAIL            BROWSER_ERROR | 0x0A
     44#define BROWSER_RECONNECT_SAVE_CHANGES    BROWSER_ERROR | 0x0B
    4245
    4346#define FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1  0x10000
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Protocol/EbcVmTest.h

    r58466 r77662  
    22  EBC VM Test protocol for test purposes.
    33
    4 Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
    55
    66This program and the accompanying materials
     
    3030//
    3131typedef struct _EFI_EBC_VM_TEST_PROTOCOL EFI_EBC_VM_TEST_PROTOCOL;
     32
     33//
     34// VM major/minor version
     35//
     36#define VM_MAJOR_VERSION  1
     37#define VM_MINOR_VERSION  0
     38
     39//
     40// Bits in the VM->StopFlags field
     41//
     42#define STOPFLAG_APP_DONE         0x0001
     43#define STOPFLAG_BREAKPOINT       0x0002
     44#define STOPFLAG_INVALID_BREAK    0x0004
     45#define STOPFLAG_BREAK_ON_CALLEX  0x0008
     46
     47//
     48// Masks for working with the VM flags register
     49//
     50#define VMFLAGS_CC        0x0001  // condition flag
     51#define VMFLAGS_STEP      0x0002  // step instruction mode
     52#define VMFLAGS_ALL_VALID (VMFLAGS_CC | VMFLAGS_STEP)
     53
     54//
     55// Macros for operating on the VM flags register
     56//
     57#define VMFLAG_SET(pVM, Flag)   (pVM->Flags |= (Flag))
     58#define VMFLAG_ISSET(pVM, Flag) ((pVM->Flags & (Flag)) ? 1 : 0)
     59#define VMFLAG_CLEAR(pVM, Flag) (pVM->Flags &= ~(Flag))
     60
     61//
     62// Define a macro to get the operand. Then we can change it to be either a
     63// direct read or have it call a function to read memory.
     64//
     65#define GETOPERANDS(pVM)  (UINT8) (*(UINT8 *) (pVM->Ip + 1))
     66#define GETOPCODE(pVM)    (UINT8) (*(UINT8 *) pVM->Ip)
     67
     68//
     69// Macros for operating on the VM GP registers
     70//
     71#define OPERAND1_REGDATA(pVM, Op) pVM->Gpr[OPERAND1_REGNUM (Op)]
     72#define OPERAND2_REGDATA(pVM, Op) pVM->Gpr[OPERAND2_REGNUM (Op)]
     73
     74//
     75// Bits of exception flags field of VM context
     76//
     77#define EXCEPTION_FLAG_FATAL    0x80000000  // can't continue
     78#define EXCEPTION_FLAG_ERROR    0x40000000  // bad, but try to continue
     79#define EXCEPTION_FLAG_WARNING  0x20000000  // harmless problem
     80#define EXCEPTION_FLAG_NONE     0x00000000  // for normal return
    3281
    3382///
     
    93142  @param[in]  AsmText           A pointer to EBC ASM text code.
    94143  @param[out] Buffer            Buffer to store the instruction.
    95   @param[out] BufferLen         Size of buffer that is requried to store data.
     144  @param[out] BufferLen         Size of buffer that is required to store data.
    96145
    97146  @retval EFI_UNSUPPORTED       This functionality is unsupported.
     
    114163  @param[out] AsmText           Contain the disasm text.
    115164  @param[out] Buffer            Buffer to store the instruction.
    116   @param[out] BufferLen         Size of buffer that is requried to store data.
     165  @param[out] BufferLen         Size of buffer that is required to store data.
    117166
    118167  @retval EFI_UNSUPPORTED       This functionality is unsupported.
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Protocol/FormBrowserEx.h

    r58466 r77662  
    33  register the different hot keys for the standard Browser actions described in UEFI specification.
    44
    5 Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials are licensed and made available under
    77the terms and conditions of the BSD License that accompanies this distribution.
     
    2020  { 0x1f73b18d, 0x4630, 0x43c1, { 0xa1, 0xde, 0x6f, 0x80, 0x85, 0x5d, 0x7d, 0xa4 } }
    2121
    22 typedef struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL   EFI_FORM_BROWSER_EXTENSION_PROTOCOL;
     22typedef struct _EDKII_FORM_BROWSER_EXTENSION_PROTOCOL   EDKII_FORM_BROWSER_EXTENSION_PROTOCOL;
     23
     24//
     25// To be compatible, keep EFI_FORM_BROWSER_EXTENSION_PROTOCOL definition
     26//
     27typedef EDKII_FORM_BROWSER_EXTENSION_PROTOCOL   EFI_FORM_BROWSER_EXTENSION_PROTOCOL;
    2328
    2429//
     
    138143  );
    139144
    140 struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL {
     145struct _EDKII_FORM_BROWSER_EXTENSION_PROTOCOL {
    141146  SET_SCOPE              SetScope;
    142147  REGISTER_HOT_KEY       RegisterHotKey;
     
    146151
    147152extern EFI_GUID gEfiFormBrowserExProtocolGuid;
     153extern EFI_GUID gEdkiiFormBrowserExProtocolGuid;
    148154
    149155#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Protocol/Print2.h

    r58466 r77662  
    11/** @file
    22
    3   This print protocol defines six basic print functions to
    4   print the format unicode and ascii string.
    5 
    6 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
     3  Produces EFI_PRINT2_PROTOCOL and EFI_PRINT2S_PROTOCOL.
     4  These protocols define basic print functions to  print the format unicode and
     5  ascii string.
     6
     7Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
    78This program and the accompanying materials are licensed and made available under
    89the terms and conditions of the BSD License that accompanies this distribution.
     
    2728
    2829/**
    29   Produces a Null-terminated Unicode string in an output buffer, based on
    30   a Null-terminated Unicode format string and a BASE_LIST argument list
    31 
    32   Produces a Null-terminated Unicode string in the output buffer
    33   specified by StartOfBuffer and BufferSize.
     30  Produces a Null-terminated Unicode string in an output buffer based on
     31  a Null-terminated Unicode format string and a BASE_LIST argument list.
     32
     33  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
     34  and BufferSize.
    3435  The Unicode string is produced by parsing the format string specified by FormatString.
    35   Arguments are pulled from the variable argument list specified by Marker.
    36   Marker is constructed based on the contents of the format string.
    37   This function returns the number of Unicode characters in the produced output buffer,
    38   not including the Null-terminator.
    39   If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    40 
    41   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    42   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    43   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    44   If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
     36  Arguments are pulled from the variable argument list specified by Marker based on the
     37  contents of the format string.
     38  The number of Unicode characters in the produced output buffer is returned not including
     39  the Null-terminator.
     40
     41  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     42  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     43
     44  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     45  unmodified and 0 is returned.
     46  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     47  unmodified and 0 is returned.
     48  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     49  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     50  buffer is unmodified and 0 is returned.
    4551  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    46   PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then ASSERT().
    47   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    48   contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
    49   Null-terminator, then ASSERT().
     52  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     53  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     54
     55  If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
    5056
    5157  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    5258                          Unicode string.
    5359  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    54   @param  FormatString    Null-terminated Unicode format string.
     60  @param  FormatString    A Null-terminated Unicode format string.
    5561  @param  Marker          BASE_LIST marker for the variable argument list.
    5662
    57   @return The number of Unicode characters in the produced output buffer, not including the
     63  @return The number of Unicode characters in the produced output buffer not including the
    5864          Null-terminator.
    5965
     
    7278  Unicode format string and variable argument list.
    7379
    74   Produces a Null-terminated Unicode string in the output buffer
    75   specified by StartOfBuffer and BufferSize.
     80  This function is similar as snprintf_s defined in C11.
     81
     82  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
     83  and BufferSize.
    7684  The Unicode string is produced by parsing the format string specified by FormatString.
    7785  Arguments are pulled from the variable argument list based on the contents of the format string.
    78   This function returns the number of Unicode characters in the produced output buffer,
    79   not including the Null-terminator.
    80   If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    81 
    82   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    83   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    84   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    85   If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
     86  The number of Unicode characters in the produced output buffer is returned not including
     87  the Null-terminator.
     88
     89  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     90  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     91
     92  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     93  unmodified and 0 is returned.
     94  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     95  unmodified and 0 is returned.
     96  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     97  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     98  buffer is unmodified and 0 is returned.
    8699  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    87   PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then ASSERT().
    88   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    89   contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
    90   Null-terminator, then ASSERT().
     100  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     101  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     102
     103  If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
    91104
    92105  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    93106                          Unicode string.
    94107  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    95   @param  FormatString    Null-terminated Unicode format string.
     108  @param  FormatString    A Null-terminated Unicode format string.
    96109  @param  ...             Variable argument list whose contents are accessed based on the
    97110                          format string specified by FormatString.
     
    111124
    112125/**
    113   Produces a Null-terminated Unicode string in an output buffer, based on a Null-terminated
    114   ASCII format string and a BASE_LIST argument list
    115 
    116   Produces a Null-terminated Unicode string in the output buffer
    117   specified by StartOfBuffer and BufferSize.
     126  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
     127  ASCII format string and a BASE_LIST argument list.
     128
     129  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
     130  and BufferSize.
    118131  The Unicode string is produced by parsing the format string specified by FormatString.
    119132  Arguments are pulled from the variable argument list specified by Marker based on the
    120133  contents of the format string.
    121   This function returns the number of Unicode characters in the produced output buffer,
    122   not including the Null-terminator.
     134  The number of Unicode characters in the produced output buffer is returned not including
     135  the Null-terminator.
     136
     137  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     138
     139  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     140  unmodified and 0 is returned.
     141  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     142  unmodified and 0 is returned.
     143  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     144  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     145  buffer is unmodified and 0 is returned.
     146  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     147  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     148  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     149
    123150  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    124151
    125   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    126   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    127   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    128   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    129   PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT().
    130   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    131   contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
    132   Null-terminator, then ASSERT().
    133 
    134152  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    135153                          Unicode string.
    136154  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    137   @param  FormatString    Null-terminated ASCII format string.
     155  @param  FormatString    A Null-terminated ASCII format string.
    138156  @param  Marker          BASE_LIST marker for the variable argument list.
    139157
     
    153171/**
    154172  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
    155   ASCII format string and a variable argument list.
    156 
    157   Produces a Null-terminated Unicode string in the output buffer
    158   specified by StartOfBuffer and BufferSize.
     173  ASCII format string and  variable argument list.
     174
     175  This function is similar as snprintf_s defined in C11.
     176
     177  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
     178  and BufferSize.
    159179  The Unicode string is produced by parsing the format string specified by FormatString.
    160   Arguments are pulled from the variable argument list based on the contents of the format string.
    161   This function returns the number of Unicode characters in the produced output buffer,
    162   not including the Null-terminator.
     180  Arguments are pulled from the variable argument list based on the contents of the
     181  format string.
     182  The number of Unicode characters in the produced output buffer is returned not including
     183  the Null-terminator.
     184
     185  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     186
     187  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     188  unmodified and 0 is returned.
     189  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     190  unmodified and 0 is returned.
     191  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     192  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     193  buffer is unmodified and 0 is returned.
     194  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     195  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     196  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     197
    163198  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    164199
    165   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    166   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    167   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    168   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    169   PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT().
    170   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    171   contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
    172   Null-terminator, then ASSERT().
    173 
    174200  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    175201                          Unicode string.
    176202  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    177   @param  FormatString    Null-terminated ASCII format string.
     203  @param  FormatString    A Null-terminated ASCII format string.
    178204  @param  ...             Variable argument list whose contents are accessed based on the
    179205                          format string specified by FormatString.
     
    246272  ASCII format string and a BASE_LIST argument list.
    247273
    248   Produces a Null-terminated ASCII string in the output buffer
    249   pecified by StartOfBuffer and BufferSize.
     274  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
     275  and BufferSize.
    250276  The ASCII string is produced by parsing the format string specified by FormatString.
    251277  Arguments are pulled from the variable argument list specified by Marker based on
    252278  the contents of the format string.
    253   This function returns the number of ASCII characters in the output buffer,
    254   not including the Null-terminator.
     279  The number of ASCII characters in the produced output buffer is returned not including
     280  the Null-terminator.
     281
     282  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     283  unmodified and 0 is returned.
     284  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     285  unmodified and 0 is returned.
     286  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     287  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     288  is unmodified and 0 is returned.
     289  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     290  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     291  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     292
    255293  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    256294
    257   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    258   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    259   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    260   PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT().
    261   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    262   contains more than PcdMaximumAsciiStringLength ASCII characters not including the
    263   Null-terminator, then ASSERT().
    264 
    265295  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    266296                          ASCII string.
    267297  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    268   @param  FormatString    Null-terminated ASCII format string.
     298  @param  FormatString    A Null-terminated ASCII format string.
    269299  @param  Marker          BASE_LIST marker for the variable argument list.
    270300
     
    284314/**
    285315  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
    286   ASCII format string and variable argument list.
    287 
    288   Produces a Null-terminated ASCII string in the output buffer
    289   specified by StartOfBuffer and BufferSize.
     316  ASCII format string and  variable argument list.
     317
     318  This function is similar as snprintf_s defined in C11.
     319
     320  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
     321  and BufferSize.
    290322  The ASCII string is produced by parsing the format string specified by FormatString.
    291   Arguments are pulled from the variable argument list based on the contents of the format string.
    292   This function returns the number of ASCII characters in the output buffer,
    293   not including the Null-terminator.
     323  Arguments are pulled from the variable argument list based on the contents of the
     324  format string.
     325  The number of ASCII characters in the produced output buffer is returned not including
     326  the Null-terminator.
     327
     328  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     329  unmodified and 0 is returned.
     330  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     331  unmodified and 0 is returned.
     332  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     333  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     334  is unmodified and 0 is returned.
     335  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     336  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     337  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     338
    294339  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    295340
    296   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    297   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    298   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    299   PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT().
    300   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    301   contains more than PcdMaximumAsciiStringLength ASCII characters not including the
    302   Null-terminator, then ASSERT().
    303 
    304341  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    305342                          ASCII string.
    306343  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    307   @param  FormatString    Null-terminated ASCII format string.
     344  @param  FormatString    A Null-terminated ASCII format string.
    308345  @param  ...             Variable argument list whose contents are accessed based on the
    309346                          format string specified by FormatString.
     
    326363  Unicode format string and a BASE_LIST argument list.
    327364
    328   Produces a Null-terminated ASCII string in the output buffer
    329   specified by StartOfBuffer and BufferSize.
     365  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
     366  and BufferSize.
    330367  The ASCII string is produced by parsing the format string specified by FormatString.
    331368  Arguments are pulled from the variable argument list specified by Marker based on
    332369  the contents of the format string.
    333   This function returns the number of ASCII characters in the output buffer,
    334   not including the Null-terminator.
     370  The number of ASCII characters in the produced output buffer is returned not including
     371  the Null-terminator.
     372
     373  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     374
     375  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     376  unmodified and 0 is returned.
     377  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     378  unmodified and 0 is returned.
     379  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     380  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     381  is unmodified and 0 is returned.
     382  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
     383  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     384  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     385
    335386  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    336387
    337   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    338   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    339   If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
    340   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    341   PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then ASSERT().
    342   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    343   contains more than PcdMaximumAsciiStringLength ASCII characters not including the
    344   Null-terminator, then ASSERT().
    345 
    346388  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    347389                          ASCII string.
    348390  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    349   @param  FormatString    Null-terminated Unicode format string.
     391  @param  FormatString    A Null-terminated Unicode format string.
    350392  @param  Marker          BASE_LIST marker for the variable argument list.
    351393
     
    367409  Unicode format string and  variable argument list.
    368410
    369   Produces a Null-terminated ASCII string in the output buffer
    370   specified by StartOfBuffer and BufferSize.
     411  This function is similar as snprintf_s defined in C11.
     412
     413  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
     414  and BufferSize.
    371415  The ASCII string is produced by parsing the format string specified by FormatString.
    372   Arguments are pulled from the variable argument list based on the contents of the format string.
    373   This function returns the number of ASCII characters in the output buffer,
    374   not including the Null-terminator.
     416  Arguments are pulled from the variable argument list based on the contents of the
     417  format string.
     418  The number of ASCII characters in the produced output buffer is returned not including
     419  the Null-terminator.
     420
     421  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     422
     423  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     424  unmodified and 0 is returned.
     425  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     426  unmodified and 0 is returned.
     427  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     428  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     429  is unmodified and 0 is returned.
     430  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
     431  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     432  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     433
    375434  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    376435
    377   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    378   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    379   If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
    380   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    381   PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then ASSERT().
    382   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    383   contains more than PcdMaximumAsciiStringLength ASCII characters not including the
    384   Null-terminator, then ASSERT().
    385 
    386436  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    387437                          ASCII string.
    388438  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    389   @param  FormatString    Null-terminated Unicode format string.
     439  @param  FormatString    A Null-terminated Unicode format string.
    390440  @param  ...             Variable argument list whose contents are accessed based on the
    391441                          format string specified by FormatString.
     
    467517extern EFI_GUID gEfiPrint2ProtocolGuid;
    468518
     519
     520#define EFI_PRINT2S_PROTOCOL_GUID  \
     521  { 0xcc252d2, 0xc106, 0x4661, { 0xb5, 0xbd, 0x31, 0x47, 0xa4, 0xf8, 0x1f, 0x92 } }
     522
     523//
     524// Forward reference for pure ANSI compatability
     525//
     526typedef struct _EFI_PRINT2S_PROTOCOL  EFI_PRINT2S_PROTOCOL;
     527
     528/**
     529  Converts a decimal value to a Null-terminated Unicode string.
     530
     531  Converts the decimal number specified by Value to a Null-terminated Unicode
     532  string specified by Buffer containing at most Width characters. No padding of
     533  spaces is ever performed. If Width is 0 then a width of
     534  MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than
     535  Width characters, then only the first Width characters are placed in Buffer.
     536  Additional conversion parameters are specified in Flags.
     537
     538  The Flags bit LEFT_JUSTIFY is always ignored.
     539  All conversions are left justified in Buffer.
     540  If Width is 0, PREFIX_ZERO is ignored in Flags.
     541  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and
     542  commas are inserted every 3rd digit starting from the right.
     543  If RADIX_HEX is set in Flags, then the output buffer will be formatted in
     544  hexadecimal format.
     545  If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in
     546  Buffer is a '-'.
     547  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then
     548  Buffer is padded with '0' characters so the combination of the optional '-'
     549  sign character, '0' characters, digit characters for Value, and the
     550  Null-terminator add up to Width characters.
     551
     552  If Buffer is not aligned on a 16-bit boundary, then ASSERT().
     553  If an error would be returned, then the function will also ASSERT().
     554
     555  @param  Buffer      The pointer to the output buffer for the produced
     556                      Null-terminated Unicode string.
     557  @param  BufferSize  The size of Buffer in bytes, including the
     558                      Null-terminator.
     559  @param  Flags       The bitmask of flags that specify left justification,
     560                      zero pad, and commas.
     561  @param  Value       The 64-bit signed value to convert to a string.
     562  @param  Width       The maximum number of Unicode characters to place in
     563                      Buffer, not including the Null-terminator.
     564
     565  @retval RETURN_SUCCESS           The decimal value is converted.
     566  @retval RETURN_BUFFER_TOO_SMALL  If BufferSize cannot hold the converted
     567                                   value.
     568  @retval RETURN_INVALID_PARAMETER If Buffer is NULL.
     569                                   If PcdMaximumUnicodeStringLength is not
     570                                   zero, and BufferSize is greater than
     571                                   (PcdMaximumUnicodeStringLength *
     572                                   sizeof (CHAR16) + 1).
     573                                   If unsupported bits are set in Flags.
     574                                   If both COMMA_TYPE and RADIX_HEX are set in
     575                                   Flags.
     576                                   If Width >= MAXIMUM_VALUE_CHARACTERS.
     577
     578**/
     579typedef
     580RETURN_STATUS
     581(EFIAPI *UNICODE_VALUE_TO_STRING_S)(
     582  IN OUT CHAR16  *Buffer,
     583  IN UINTN       BufferSize,
     584  IN UINTN       Flags,
     585  IN INT64       Value,
     586  IN UINTN       Width
     587  );
     588
     589/**
     590  Converts a decimal value to a Null-terminated Ascii string.
     591
     592  Converts the decimal number specified by Value to a Null-terminated Ascii
     593  string specified by Buffer containing at most Width characters. No padding of
     594  spaces is ever performed. If Width is 0 then a width of
     595  MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than
     596  Width characters, then only the first Width characters are placed in Buffer.
     597  Additional conversion parameters are specified in Flags.
     598
     599  The Flags bit LEFT_JUSTIFY is always ignored.
     600  All conversions are left justified in Buffer.
     601  If Width is 0, PREFIX_ZERO is ignored in Flags.
     602  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and
     603  commas are inserted every 3rd digit starting from the right.
     604  If RADIX_HEX is set in Flags, then the output buffer will be formatted in
     605  hexadecimal format.
     606  If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in
     607  Buffer is a '-'.
     608  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then
     609  Buffer is padded with '0' characters so the combination of the optional '-'
     610  sign character, '0' characters, digit characters for Value, and the
     611  Null-terminator add up to Width characters.
     612
     613  If an error would be returned, then the function will ASSERT().
     614
     615  @param  Buffer      The pointer to the output buffer for the produced
     616                      Null-terminated Ascii string.
     617  @param  BufferSize  The size of Buffer in bytes, including the
     618                      Null-terminator.
     619  @param  Flags       The bitmask of flags that specify left justification,
     620                      zero pad, and commas.
     621  @param  Value       The 64-bit signed value to convert to a string.
     622  @param  Width       The maximum number of Ascii characters to place in
     623                      Buffer, not including the Null-terminator.
     624
     625  @retval RETURN_SUCCESS           The decimal value is converted.
     626  @retval RETURN_BUFFER_TOO_SMALL  If BufferSize cannot hold the converted
     627                                   value.
     628  @retval RETURN_INVALID_PARAMETER If Buffer is NULL.
     629                                   If PcdMaximumAsciiStringLength is not
     630                                   zero, and BufferSize is greater than
     631                                   PcdMaximumAsciiStringLength.
     632                                   If unsupported bits are set in Flags.
     633                                   If both COMMA_TYPE and RADIX_HEX are set in
     634                                   Flags.
     635                                   If Width >= MAXIMUM_VALUE_CHARACTERS.
     636
     637**/
     638typedef
     639RETURN_STATUS
     640(EFIAPI *ASCII_VALUE_TO_STRING_S)(
     641  IN OUT CHAR8   *Buffer,
     642  IN  UINTN      BufferSize,
     643  IN  UINTN      Flags,
     644  IN  INT64      Value,
     645  IN  UINTN      Width
     646  );
     647
     648struct _EFI_PRINT2S_PROTOCOL {
     649  UNICODE_BS_PRINT                     UnicodeBSPrint;
     650  UNICODE_S_PRINT                      UnicodeSPrint;
     651  UNICODE_BS_PRINT_ASCII_FORMAT        UnicodeBSPrintAsciiFormat;
     652  UNICODE_S_PRINT_ASCII_FORMAT         UnicodeSPrintAsciiFormat;
     653  UNICODE_VALUE_TO_STRING_S            UnicodeValueToStringS;
     654  ASCII_BS_PRINT                       AsciiBSPrint;
     655  ASCII_S_PRINT                        AsciiSPrint;
     656  ASCII_BS_PRINT_UNICODE_FORMAT        AsciiBSPrintUnicodeFormat;
     657  ASCII_S_PRINT_UNICODE_FORMAT         AsciiSPrintUnicodeFormat;
     658  ASCII_VALUE_TO_STRING_S              AsciiValueToStringS;
     659};
     660
     661extern EFI_GUID gEfiPrint2SProtocolGuid;
     662
    469663#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Include/Protocol/UfsHostController.h

    r58466 r77662  
    33  EDKII Universal Flash Storage Host Controller Protocol.
    44
    5 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials are licensed and made available under
    77the terms and conditions of the BSD License that accompanies this distribution.
     
    186186  );
    187187
     188typedef enum {
     189  EfiUfsHcWidthUint8      = 0,
     190  EfiUfsHcWidthUint16,
     191  EfiUfsHcWidthUint32,
     192  EfiUfsHcWidthUint64,
     193  EfiUfsHcWidthMaximum
     194} EDKII_UFS_HOST_CONTROLLER_PROTOCOL_WIDTH;
     195
     196/**
     197  Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
     198
     199  @param  This                  A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
     200  @param  Width                 Signifies the width of the memory operations.
     201  @param  Offset                The offset within the UFS Host Controller MMIO space to start the
     202                                memory operation.
     203  @param  Count                 The number of memory operations to perform.
     204  @param  Buffer                For read operations, the destination buffer to store the results.
     205                                For write operations, the source buffer to write data from.
     206
     207  @retval EFI_SUCCESS           The data was read from or written to the UFS host controller.
     208  @retval EFI_UNSUPPORTED       The address range specified by Offset, Width, and Count is not
     209                                valid for the UFS Host Controller memory space.
     210  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.
     211  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
     212
     213**/
     214typedef
     215EFI_STATUS
     216(EFIAPI *EDKII_UFS_HC_MMIO_READ_WRITE)(
     217  IN     EDKII_UFS_HOST_CONTROLLER_PROTOCOL        *This,
     218  IN     EDKII_UFS_HOST_CONTROLLER_PROTOCOL_WIDTH  Width,
     219  IN     UINT64                                    Offset,
     220  IN     UINTN                                     Count,
     221  IN OUT VOID                                      *Buffer
     222  );
     223
    188224///
    189225///  UFS Host Controller Protocol structure.
     
    196232  EDKII_UFS_HC_UNMAP                  Unmap;
    197233  EDKII_UFS_HC_FLUSH                  Flush;
     234  EDKII_UFS_HC_MMIO_READ_WRITE        Read;
     235  EDKII_UFS_HC_MMIO_READ_WRITE        Write;
    198236};
    199237
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette