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:
3 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.uni

    r58464 r77662  
    1 // /** @file
     1// /** @file
    22// Instance of PCD Library without support of dynamic PCD entries.
    33//
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BasePcdLibNull/PcdLib.c

    r58466 r77662  
    22  A emptry template implementation of PCD Library.
    33
    4   Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2006 - 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
     
    2828                    set values associated with a PCD token.
    2929
    30   If SkuId >= 0x100, then ASSERT().
    31 
    3230  @return Return the SKU ID that just be set.
    3331
     
    396394
    397395
     396#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
    398397/**
    399398  This function provides a means by which to set a value for a given PCD token.
     
    401400  Sets the 8-bit value for the token specified by TokenNumber
    402401  to the value specified by Value.  Value is returned.
    403 
    404   If the set operation was not correctly performed, then ASSERT().
    405402
    406403  @param[in]  TokenNumber   The PCD token number to set a current value for.
     
    430427  to the value specified by Value.  Value is returned.
    431428
    432   If the set operation was not correctly performed, then ASSERT().
    433 
    434429  @param[in]  TokenNumber   The PCD token number to set a current value for.
    435430  @param[in]  Value         The 16-bit value to set.
     
    458453  to the value specified by Value.  Value is returned.
    459454
    460   If the set operation was not correctly performed, then ASSERT().
    461 
    462455  @param[in]  TokenNumber   The PCD token number to set a current value for.
    463456  @param[in]  Value         The 32-bit value to set.
     
    485478  Sets the 64-bit value for the token specified by TokenNumber
    486479  to the value specified by Value.  Value is returned.
    487 
    488   If the set operation was not correctly performed, then ASSERT().
    489480
    490481  @param[in]  TokenNumber   The PCD token number to set a current value for.
     
    515506  If SizeOfBuffer is greater than the maximum size support by TokenNumber,
    516507  then set SizeOfBuffer to the maximum size supported by TokenNumber and
    517   return NULL to indicate that the set operation was not actually performed,
    518   or ASSERT() if the set operation was not corretly performed.
     508  return NULL to indicate that the set operation was not actually performed.
    519509
    520510  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
     
    552542  to the value specified by Value.  Value is returned.
    553543
    554   If the set operation was not correctly performed, then ASSERT().
    555 
    556544  @param[in]  TokenNumber   The PCD token number to set a current value for.
    557545  @param[in]  Value         The boolean value to set.
     
    581569
    582570  If Guid is NULL, then ASSERT().
    583   If the set operation was not correctly performed, then ASSERT().
    584571
    585572  @param[in]  Guid          The pointer to a 128-bit unique value that
     
    613600
    614601  If Guid is NULL, then ASSERT().
    615   If the set operation was not correctly performed, then ASSERT().
    616602
    617603  @param[in]  Guid          The pointer to a 128-bit unique value that
     
    645631
    646632  If Guid is NULL, then ASSERT().
    647   If the set operation was not correctly performed, then ASSERT().
    648633
    649634  @param[in]  Guid          The pointer to a 128-bit unique value that
     
    677662
    678663  If Guid is NULL, then ASSERT().
    679   If the set operation was not correctly performed, then ASSERT().
    680664
    681665  @param[in]  Guid          The pointer to a 128-bit unique value that
     
    709693  the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
    710694  supported by TokenNumber and return NULL to indicate that the set operation
    711   was not actually performed, or ASSERT() if the set operation was not corretly performed.
     695  was not actually performed.
    712696
    713697  If Guid is NULL, then ASSERT().
     
    747731
    748732  If Guid is NULL, then ASSERT().
    749   If the set operation was not correctly performed, then ASSERT().
    750733
    751734  @param[in]  Guid          The pointer to a 128-bit unique value that
     
    769752  return FALSE;
    770753}
    771 
    772 
     754#endif
     755
     756/**
     757  This function provides a means by which to set a value for a given PCD token.
     758
     759  Sets the 8-bit value for the token specified by TokenNumber
     760  to the value specified by Value.
     761
     762  @param[in] TokenNumber    The PCD token number to set a current value for.
     763  @param[in] Value          The 8-bit value to set.
     764
     765  @return The status of the set operation.
     766
     767**/
     768RETURN_STATUS
     769EFIAPI
     770LibPcdSet8S (
     771  IN UINTN          TokenNumber,
     772  IN UINT8          Value
     773  )
     774{
     775  ASSERT (FALSE);
     776
     777  return RETURN_INVALID_PARAMETER;
     778}
     779
     780/**
     781  This function provides a means by which to set a value for a given PCD token.
     782
     783  Sets the 16-bit value for the token specified by TokenNumber
     784  to the value specified by Value.
     785
     786  @param[in] TokenNumber    The PCD token number to set a current value for.
     787  @param[in] Value          The 16-bit value to set.
     788
     789  @return The status of the set operation.
     790
     791**/
     792RETURN_STATUS
     793EFIAPI
     794LibPcdSet16S (
     795  IN UINTN          TokenNumber,
     796  IN UINT16         Value
     797  )
     798{
     799  ASSERT (FALSE);
     800
     801  return RETURN_INVALID_PARAMETER;
     802}
     803
     804/**
     805  This function provides a means by which to set a value for a given PCD token.
     806
     807  Sets the 32-bit value for the token specified by TokenNumber
     808  to the value specified by Value.
     809
     810  @param[in] TokenNumber    The PCD token number to set a current value for.
     811  @param[in] Value          The 32-bit value to set.
     812
     813  @return The status of the set operation.
     814
     815**/
     816RETURN_STATUS
     817EFIAPI
     818LibPcdSet32S (
     819  IN UINTN          TokenNumber,
     820  IN UINT32         Value
     821  )
     822{
     823  ASSERT (FALSE);
     824
     825  return RETURN_INVALID_PARAMETER;
     826}
     827
     828/**
     829  This function provides a means by which to set a value for a given PCD token.
     830
     831  Sets the 64-bit value for the token specified by TokenNumber
     832  to the value specified by Value.
     833
     834  @param[in] TokenNumber    The PCD token number to set a current value for.
     835  @param[in] Value          The 64-bit value to set.
     836
     837  @return The status of the set operation.
     838
     839**/
     840RETURN_STATUS
     841EFIAPI
     842LibPcdSet64S (
     843  IN UINTN          TokenNumber,
     844  IN UINT64         Value
     845  )
     846{
     847  ASSERT (FALSE);
     848
     849  return RETURN_INVALID_PARAMETER;
     850}
     851
     852/**
     853  This function provides a means by which to set a value for a given PCD token.
     854
     855  Sets a buffer for the token specified by TokenNumber to the value specified
     856  by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
     857  support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
     858  TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation
     859  was not actually performed.
     860
     861  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
     862  maximum size supported by TokenName and EFI_INVALID_PARAMETER must be returned.
     863
     864  If SizeOfBuffer is NULL, then ASSERT().
     865  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
     866
     867  @param[in]      TokenNumber   The PCD token number to set a current value for.
     868  @param[in, out] SizeOfBuffer  The size, in bytes, of Buffer.
     869  @param[in]      Buffer        A pointer to the buffer to set.
     870
     871  @return The status of the set operation.
     872
     873**/
     874RETURN_STATUS
     875EFIAPI
     876LibPcdSetPtrS (
     877  IN       UINTN    TokenNumber,
     878  IN OUT   UINTN    *SizeOfBuffer,
     879  IN CONST VOID     *Buffer
     880  )
     881{
     882  ASSERT (FALSE);
     883
     884  return RETURN_INVALID_PARAMETER;
     885}
     886
     887/**
     888  This function provides a means by which to set a value for a given PCD token.
     889
     890  Sets the boolean value for the token specified by TokenNumber
     891  to the value specified by Value.
     892
     893  @param[in] TokenNumber    The PCD token number to set a current value for.
     894  @param[in] Value          The boolean value to set.
     895
     896  @return The status of the set operation.
     897
     898**/
     899RETURN_STATUS
     900EFIAPI
     901LibPcdSetBoolS (
     902  IN UINTN          TokenNumber,
     903  IN BOOLEAN        Value
     904  )
     905{
     906  ASSERT (FALSE);
     907
     908  return RETURN_INVALID_PARAMETER;
     909}
     910
     911/**
     912  This function provides a means by which to set a value for a given PCD token.
     913
     914  Sets the 8-bit value for the token specified by TokenNumber
     915  to the value specified by Value.
     916
     917  If Guid is NULL, then ASSERT().
     918
     919  @param[in] Guid           The pointer to a 128-bit unique value that
     920                            designates which namespace to set a value from.
     921  @param[in] TokenNumber    The PCD token number to set a current value for.
     922  @param[in] Value          The 8-bit value to set.
     923
     924  @return The status of the set operation.
     925
     926**/
     927RETURN_STATUS
     928EFIAPI
     929LibPcdSetEx8S (
     930  IN CONST GUID     *Guid,
     931  IN UINTN          TokenNumber,
     932  IN UINT8          Value
     933  )
     934{
     935  ASSERT (FALSE);
     936
     937  return RETURN_INVALID_PARAMETER;
     938}
     939
     940/**
     941  This function provides a means by which to set a value for a given PCD token.
     942
     943  Sets the 16-bit value for the token specified by TokenNumber
     944  to the value specified by Value.
     945
     946  If Guid is NULL, then ASSERT().
     947
     948  @param[in] Guid           The pointer to a 128-bit unique value that
     949                            designates which namespace to set a value from.
     950  @param[in] TokenNumber    The PCD token number to set a current value for.
     951  @param[in] Value          The 16-bit value to set.
     952
     953  @return The status of the set operation.
     954
     955**/
     956RETURN_STATUS
     957EFIAPI
     958LibPcdSetEx16S (
     959  IN CONST GUID     *Guid,
     960  IN UINTN          TokenNumber,
     961  IN UINT16         Value
     962  )
     963{
     964  ASSERT (FALSE);
     965
     966  return RETURN_INVALID_PARAMETER;
     967}
     968
     969/**
     970  This function provides a means by which to set a value for a given PCD token.
     971
     972  Sets the 32-bit value for the token specified by TokenNumber
     973  to the value specified by Value.
     974
     975  If Guid is NULL, then ASSERT().
     976
     977  @param[in] Guid           The pointer to a 128-bit unique value that
     978                            designates which namespace to set a value from.
     979  @param[in] TokenNumber    The PCD token number to set a current value for.
     980  @param[in] Value          The 32-bit value to set.
     981
     982  @return The status of the set operation.
     983
     984**/
     985RETURN_STATUS
     986EFIAPI
     987LibPcdSetEx32S (
     988  IN CONST GUID     *Guid,
     989  IN UINTN          TokenNumber,
     990  IN UINT32         Value
     991  )
     992{
     993  ASSERT (FALSE);
     994
     995  return RETURN_INVALID_PARAMETER;
     996}
     997
     998/**
     999  This function provides a means by which to set a value for a given PCD token.
     1000
     1001  Sets the 64-bit value for the token specified by TokenNumber
     1002  to the value specified by Value.
     1003
     1004  If Guid is NULL, then ASSERT().
     1005
     1006  @param[in] Guid           The pointer to a 128-bit unique value that
     1007                            designates which namespace to set a value from.
     1008  @param[in] TokenNumber    The PCD token number to set a current value for.
     1009  @param[in] Value          The 64-bit value to set.
     1010
     1011  @return The status of the set operation.
     1012
     1013**/
     1014RETURN_STATUS
     1015EFIAPI
     1016LibPcdSetEx64S (
     1017  IN CONST GUID     *Guid,
     1018  IN UINTN          TokenNumber,
     1019  IN UINT64         Value
     1020  )
     1021{
     1022  ASSERT (FALSE);
     1023
     1024  return RETURN_INVALID_PARAMETER;
     1025}
     1026
     1027/**
     1028  This function provides a means by which to set a value for a given PCD token.
     1029
     1030  Sets a buffer for the token specified by TokenNumber to the value specified by
     1031  Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
     1032  support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
     1033  TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation
     1034  was not actually performed.
     1035
     1036  If Guid is NULL, then ASSERT().
     1037  If SizeOfBuffer is NULL, then ASSERT().
     1038  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
     1039
     1040  @param[in]      Guid          Pointer to a 128-bit unique value that
     1041                                designates which namespace to set a value from.
     1042  @param[in]      TokenNumber   The PCD token number to set a current value for.
     1043  @param[in, out] SizeOfBuffer  The size, in bytes, of Buffer.
     1044  @param[in]      Buffer        A pointer to the buffer to set.
     1045
     1046  @return The status of the set operation.
     1047
     1048**/
     1049RETURN_STATUS
     1050EFIAPI
     1051LibPcdSetExPtrS (
     1052  IN CONST GUID     *Guid,
     1053  IN       UINTN    TokenNumber,
     1054  IN OUT   UINTN    *SizeOfBuffer,
     1055  IN       VOID     *Buffer
     1056  )
     1057{
     1058  ASSERT (FALSE);
     1059
     1060  return RETURN_INVALID_PARAMETER;
     1061}
     1062
     1063/**
     1064  This function provides a means by which to set a value for a given PCD token.
     1065
     1066  Sets the boolean value for the token specified by TokenNumber
     1067  to the value specified by Value.
     1068
     1069  If Guid is NULL, then ASSERT().
     1070
     1071  @param[in] Guid           The pointer to a 128-bit unique value that
     1072                            designates which namespace to set a value from.
     1073  @param[in] TokenNumber    The PCD token number to set a current value for.
     1074  @param[in] Value          The boolean value to set.
     1075
     1076  @return The status of the set operation.
     1077
     1078**/
     1079RETURN_STATUS
     1080EFIAPI
     1081LibPcdSetExBoolS (
     1082  IN CONST GUID     *Guid,
     1083  IN UINTN          TokenNumber,
     1084  IN BOOLEAN        Value
     1085  )
     1086{
     1087  ASSERT (FALSE);
     1088
     1089  return RETURN_INVALID_PARAMETER;
     1090}
    7731091
    7741092/**
     
    9011219  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
    9021220
    903   @param[in] PatchVariable      A pointer to the global variable in a module that is
     1221  @param[out] PatchVariable     A pointer to the global variable in a module that is
    9041222                                the target of the set operation.
    9051223  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.
     
    9131231EFIAPI
    9141232LibPatchPcdSetPtr (
    915   IN        VOID        *PatchVariable,
     1233  OUT       VOID        *PatchVariable,
    9161234  IN        UINTN       MaximumDatumSize,
    9171235  IN OUT    UINTN       *SizeOfBuffer,
     
    9381256
    9391257/**
     1258  Sets a value of a patchable PCD entry that is type pointer.
     1259
     1260  Sets the PCD entry specified by PatchVariable to the value specified
     1261  by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
     1262  then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
     1263  to indicate that the set operation was not actually performed.
     1264  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
     1265  MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
     1266
     1267  If PatchVariable is NULL, then ASSERT().
     1268  If SizeOfBuffer is NULL, then ASSERT().
     1269  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
     1270
     1271  @param[out] PatchVariable     A pointer to the global variable in a module that is
     1272                                the target of the set operation.
     1273  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.
     1274  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
     1275  @param[in] Buffer             A pointer to the buffer to used to set the target variable.
     1276
     1277  @return The status of the set operation.
     1278
     1279**/
     1280RETURN_STATUS
     1281EFIAPI
     1282LibPatchPcdSetPtrS (
     1283  OUT      VOID     *PatchVariable,
     1284  IN       UINTN    MaximumDatumSize,
     1285  IN OUT   UINTN    *SizeOfBuffer,
     1286  IN CONST VOID     *Buffer
     1287  )
     1288{
     1289  ASSERT (PatchVariable != NULL);
     1290  ASSERT (SizeOfBuffer  != NULL);
     1291
     1292  if (*SizeOfBuffer > 0) {
     1293    ASSERT (Buffer != NULL);
     1294  }
     1295
     1296  if ((*SizeOfBuffer > MaximumDatumSize) ||
     1297      (*SizeOfBuffer == MAX_ADDRESS)) {
     1298    *SizeOfBuffer = MaximumDatumSize;
     1299    return RETURN_INVALID_PARAMETER;
     1300  }
     1301
     1302  CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
     1303
     1304  return RETURN_SUCCESS;
     1305}
     1306
     1307/**
     1308  Sets a value and size of a patchable PCD entry that is type pointer.
     1309
     1310  Sets the PCD entry specified by PatchVariable to the value specified by Buffer
     1311  and SizeOfBuffer.  Buffer is returned.  If SizeOfBuffer is greater than
     1312  MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
     1313  NULL to indicate that the set operation was not actually performed.
     1314  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
     1315  MaximumDatumSize and NULL must be returned.
     1316
     1317  If PatchVariable is NULL, then ASSERT().
     1318  If SizeOfPatchVariable is NULL, then ASSERT().
     1319  If SizeOfBuffer is NULL, then ASSERT().
     1320  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
     1321
     1322  @param[out] PatchVariable     A pointer to the global variable in a module that is
     1323                                the target of the set operation.
     1324  @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
     1325  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.
     1326  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
     1327  @param[in] Buffer             A pointer to the buffer to used to set the target variable.
     1328
     1329  @return Return the pointer to the buffer been set.
     1330
     1331**/
     1332VOID *
     1333EFIAPI
     1334LibPatchPcdSetPtrAndSize (
     1335  OUT       VOID        *PatchVariable,
     1336  OUT       UINTN       *SizeOfPatchVariable,
     1337  IN        UINTN       MaximumDatumSize,
     1338  IN OUT    UINTN       *SizeOfBuffer,
     1339  IN CONST  VOID        *Buffer
     1340  )
     1341{
     1342  ASSERT (PatchVariable != NULL);
     1343  ASSERT (SizeOfPatchVariable != NULL);
     1344  ASSERT (SizeOfBuffer  != NULL);
     1345
     1346  if (*SizeOfBuffer > 0) {
     1347    ASSERT (Buffer != NULL);
     1348  }
     1349
     1350  if ((*SizeOfBuffer > MaximumDatumSize) ||
     1351      (*SizeOfBuffer == MAX_ADDRESS)) {
     1352    *SizeOfBuffer = MaximumDatumSize;
     1353    return NULL;
     1354  }
     1355
     1356  CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
     1357  *SizeOfPatchVariable = *SizeOfBuffer;
     1358
     1359  return (VOID *) Buffer;
     1360}
     1361
     1362/**
     1363  Sets a value and size of a patchable PCD entry that is type pointer.
     1364
     1365  Sets the PCD entry specified by PatchVariable to the value specified
     1366  by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
     1367  then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
     1368  to indicate that the set operation was not actually performed.
     1369  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
     1370  MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
     1371
     1372  If PatchVariable is NULL, then ASSERT().
     1373  If SizeOfPatchVariable is NULL, then ASSERT().
     1374  If SizeOfBuffer is NULL, then ASSERT().
     1375  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
     1376
     1377  @param[out] PatchVariable     A pointer to the global variable in a module that is
     1378                                the target of the set operation.
     1379  @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
     1380  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.
     1381  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
     1382  @param[in] Buffer             A pointer to the buffer to used to set the target variable.
     1383
     1384  @return The status of the set operation.
     1385
     1386**/
     1387RETURN_STATUS
     1388EFIAPI
     1389LibPatchPcdSetPtrAndSizeS (
     1390  OUT      VOID     *PatchVariable,
     1391  OUT      UINTN    *SizeOfPatchVariable,
     1392  IN       UINTN    MaximumDatumSize,
     1393  IN OUT   UINTN    *SizeOfBuffer,
     1394  IN CONST VOID     *Buffer
     1395  )
     1396{
     1397  ASSERT (PatchVariable != NULL);
     1398  ASSERT (SizeOfPatchVariable != NULL);
     1399  ASSERT (SizeOfBuffer  != NULL);
     1400
     1401  if (*SizeOfBuffer > 0) {
     1402    ASSERT (Buffer != NULL);
     1403  }
     1404
     1405  if ((*SizeOfBuffer > MaximumDatumSize) ||
     1406      (*SizeOfBuffer == MAX_ADDRESS)) {
     1407    *SizeOfBuffer = MaximumDatumSize;
     1408    return RETURN_INVALID_PARAMETER;
     1409  }
     1410
     1411  CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
     1412  *SizeOfPatchVariable = *SizeOfBuffer;
     1413
     1414  return RETURN_SUCCESS;
     1415}
     1416
     1417/**
    9401418  Retrieve additional information associated with a PCD token.
    9411419
     
    9861464  Retrieve the currently set SKU Id.
    9871465
    988   If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().
    989 
    9901466  @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the
    9911467            default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
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