VirtualBox

Ignore:
Timestamp:
Mar 12, 2019 12:40:12 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
129295
Message:

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

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/PrintDxe/Print.c

    r48674 r77662  
    11/** @file
    2   This driver produces Print2 protocol layered on top of the PrintLib from the MdePkg.
     2  This driver produces Print2 protocols layered on top of the PrintLib from the MdePkg.
    33
    4 Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    2121#include <Library/UefiDriverEntryPoint.h>
    2222
     23/**
     24  Implementaion of the UnicodeValueToString service in EFI_PRINT2_PROTOCOL.
     25
     26  If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then ASSERT().
     27
     28  @param  Buffer  The pointer to the output buffer for the produced
     29                  Null-terminated Unicode string.
     30  @param  Flags   The bitmask of flags that specify left justification, zero
     31                  pad, and commas.
     32  @param  Value   The 64-bit signed value to convert to a string.
     33  @param  Width   The maximum number of Unicode characters to place in Buffer,
     34                  not including the Null-terminator.
     35
     36  @return If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, return 0.
     37          Otherwise, return the number of Unicode characters in Buffer not
     38          including the Null-terminator.
     39
     40**/
     41UINTN
     42EFIAPI
     43PrintDxeUnicodeValueToString (
     44  IN OUT CHAR16  *Buffer,
     45  IN UINTN       Flags,
     46  IN INT64       Value,
     47  IN UINTN       Width
     48  )
     49{
     50#ifdef DISABLE_NEW_DEPRECATED_INTERFACES
     51  //
     52  // If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then the
     53  // PrintLib API UnicodeValueToString is already deprecated.
     54  // In this case, ASSERT will be triggered and zero will be returned for the
     55  // implementation of the UnicodeValueToString service in EFI_PRINT2_PROTOCOL
     56  // to indicate that the service is no longer supported.
     57  //
     58  DEBUG ((DEBUG_ERROR, "PrintDxe: The UnicodeValueToString service in EFI_PRINT2_PROTOCOL is no longer supported for security reason.\n"));
     59  DEBUG ((DEBUG_ERROR, "PrintDxe: Please consider using the UnicodeValueToStringS service in EFI_PRINT2S_PROTOCOL.\n"));
     60  ASSERT (FALSE);
     61  return 0;
     62#else
     63  return UnicodeValueToString (Buffer, Flags, Value, Width);
     64#endif
     65}
     66
     67/**
     68  Implementaion of the AsciiValueToString service in EFI_PRINT2_PROTOCOL.
     69
     70  If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then ASSERT().
     71
     72  @param  Buffer  A pointer to the output buffer for the produced
     73                  Null-terminated ASCII string.
     74  @param  Flags   The bitmask of flags that specify left justification, zero
     75                  pad, and commas.
     76  @param  Value   The 64-bit signed value to convert to a string.
     77  @param  Width   The maximum number of ASCII characters to place in Buffer,
     78                  not including the Null-terminator.
     79
     80  @return If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, return 0.
     81          Otherwise, return the number of ASCII characters in Buffer not
     82          including the Null-terminator.
     83
     84**/
     85UINTN
     86EFIAPI
     87PrintDxeAsciiValueToString (
     88  OUT CHAR8      *Buffer,
     89  IN  UINTN      Flags,
     90  IN  INT64      Value,
     91  IN  UINTN      Width
     92  )
     93{
     94#ifdef DISABLE_NEW_DEPRECATED_INTERFACES
     95  //
     96  // If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then the
     97  // PrintLib API AsciiValueToString is already deprecated.
     98  // In this case, ASSERT will be triggered and zero will be returned for the
     99  // implementation of the AsciiValueToString service in EFI_PRINT2_PROTOCOL
     100  // to indicate that the service is no longer supported.
     101  //
     102  DEBUG ((DEBUG_ERROR, "PrintDxe: The AsciiValueToString service in EFI_PRINT2_PROTOCOL is no longer supported for security reason.\n"));
     103  DEBUG ((DEBUG_ERROR, "PrintDxe: Please consider using the AsciiValueToStringS service in EFI_PRINT2S_PROTOCOL.\n"));
     104  ASSERT (FALSE);
     105  return 0;
     106#else
     107  return AsciiValueToString (Buffer, Flags, Value, Width);
     108#endif
     109}
     110
    23111EFI_HANDLE  mPrintThunkHandle = NULL;
    24112
     
    28116  UnicodeBSPrintAsciiFormat,
    29117  UnicodeSPrintAsciiFormat,
    30   UnicodeValueToString,
     118  PrintDxeUnicodeValueToString,
    31119  AsciiBSPrint,
    32120  AsciiSPrint,
    33121  AsciiBSPrintUnicodeFormat,
    34122  AsciiSPrintUnicodeFormat,
    35   AsciiValueToString
     123  PrintDxeAsciiValueToString
     124};
     125
     126CONST EFI_PRINT2S_PROTOCOL mPrint2SProtocol = {
     127  UnicodeBSPrint,
     128  UnicodeSPrint,
     129  UnicodeBSPrintAsciiFormat,
     130  UnicodeSPrintAsciiFormat,
     131  UnicodeValueToStringS,
     132  AsciiBSPrint,
     133  AsciiSPrint,
     134  AsciiBSPrintUnicodeFormat,
     135  AsciiSPrintUnicodeFormat,
     136  AsciiValueToStringS
    36137};
    37138
     
    60161                  &mPrintThunkHandle,
    61162                  &gEfiPrint2ProtocolGuid, &mPrint2Protocol,
     163                  &gEfiPrint2SProtocolGuid, &mPrint2SProtocol,
    62164                  NULL
    63165                  );
Note: See TracChangeset for help on using the changeset viewer.

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