VirtualBox

Ignore:
Timestamp:
Oct 28, 2015 8:17:18 PM (9 years ago)
Author:
vboxsync
Message:

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
8 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PlatformDriOverrideDxe/InternalPlatDriOverrideDxe.h

    r48674 r58459  
    33  and the shared function APIs.
    44
    5 Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2007 - 2013, 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
     
    3030#include <Protocol/ComponentName.h>
    3131#include <Protocol/DriverBinding.h>
    32 #include <Protocol/DevicePathToText.h>
    3332#include <Protocol/DevicePath.h>
    3433#include <Protocol/PlatformDriverOverride.h>
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c

    r48674 r58459  
    1414     by platform override protocol driver to publish the platform override protocol.
    1515
    16 Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
     16Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
    1717This program and the accompanying materials
    1818are licensed and made available under the terms and conditions of the BSD License
     
    7171
    7272INTN                         mSelectedCtrIndex;
    73 EFI_STRING_ID                mControllerToken[MAX_CHOICE_NUM];
     73EFI_STRING_ID                *mControllerToken;
    7474UINTN                        mDriverImageHandleCount;
    75 EFI_STRING_ID                mDriverImageToken[MAX_CHOICE_NUM];
    76 EFI_STRING_ID                mDriverImageFilePathToken[MAX_CHOICE_NUM];
    77 EFI_LOADED_IMAGE_PROTOCOL    *mDriverImageProtocol[MAX_CHOICE_NUM];
    78 EFI_DEVICE_PATH_PROTOCOL     *mControllerDevicePathProtocol[MAX_CHOICE_NUM];
     75EFI_STRING_ID                *mDriverImageToken;
     76EFI_DEVICE_PATH_PROTOCOL     **mControllerDevicePathProtocol;
    7977UINTN                        mSelectedDriverImageNum;
    8078UINTN                        mLastSavedDriverImageNum;
    8179UINT16                       mCurrentPage;
    8280EFI_CALLBACK_INFO           *mCallbackInfo;
     81BOOLEAN                     *mDriSelection;
     82UINTN                        mMaxDeviceCount;
    8383
    8484HII_VENDOR_DEVICE_PATH  mHiiVendorDevicePath = {
     
    105105
    106106/**
    107   Converting a given device to an unicode string.
    108  
    109   This function will dependent on gEfiDevicePathToTextProtocolGuid, if protocol
    110   does not installed, then return unknown device path L"?" directly.
    111  
     107  Converting a given device to an unicode string.
     108
    112109  @param    DevPath     Given device path instance
    113110 
    114111  @return   Converted string from given device path.
    115   @retval   L"?"  Can not locate gEfiDevicePathToTextProtocolGuid protocol for converting.
     112  @retval   L"?" Converting failed.
    116113**/
    117114CHAR16 *
     
    120117  )
    121118{
    122   EFI_STATUS                       Status;
    123   EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
    124   CHAR16                           *ToText;
    125  
    126   if (DevPath == NULL) {
    127     return L"";
    128   }
    129    
    130   Status = gBS->LocateProtocol (
    131                   &gEfiDevicePathToTextProtocolGuid,
    132                   NULL,
    133                   (VOID **) &DevPathToText
    134                   );
    135   if (!EFI_ERROR (Status)) {
    136     ToText = DevPathToText->ConvertDevicePathToText (
    137                               DevPath,
    138                               FALSE,
    139                               TRUE
    140                               );
    141     ASSERT (ToText != NULL);
    142     return ToText;
    143   }
    144 
    145   return L"?";
     119  CHAR16                          *Text;
     120  Text = ConvertDevicePathToText (
     121           DevPath,
     122           FALSE,
     123           TRUE
     124           );
     125  if (Text == NULL) {
     126    Text = AllocateCopyPool (sizeof (L"?"), L"?");
     127    ASSERT (Text != NULL);
     128  }
     129
     130  return Text;
    146131}
    147132
     
    186171  // Find the best matching language.
    187172  //
    188   Language = GetEfiGlobalVariable (VariableName);
     173  GetEfiGlobalVariable2 (VariableName, (VOID**)&Language, NULL);
    189174  BestLanguage = GetBestLanguage (
    190175                   ComponentName->SupportedLanguages,
     
    440425    return EFI_SUCCESS;
    441426  }
     427
     428  mMaxDeviceCount = DevicePathHandleCount;
     429  mControllerDevicePathProtocol = AllocateZeroPool (DevicePathHandleCount * sizeof (EFI_DEVICE_PATH_PROTOCOL *));
     430  ASSERT (mControllerDevicePathProtocol != NULL);
     431  mControllerToken = AllocateZeroPool (DevicePathHandleCount * sizeof (EFI_STRING_ID));
     432  ASSERT (mControllerToken != NULL);
    442433
    443434  for (Index = 0; Index < DevicePathHandleCount; Index++) {
     
    646637  EFI_IFR_GUID_LABEL                        *StartLabel;
    647638  EFI_IFR_GUID_LABEL                        *EndLabel;
     639  EFI_LOADED_IMAGE_PROTOCOL                 **DriverImageProtocol;
     640  EFI_STRING_ID                             *DriverImageFilePathToken;
     641  UINT8                                     CheckFlags;
    648642
    649643  //
     
    714708  }
    715709
     710  mDriverImageToken = AllocateZeroPool (DriverImageHandleCount * sizeof (EFI_STRING_ID));
     711  ASSERT (mDriverImageToken != NULL);
     712  mDriSelection = AllocateZeroPool (DriverImageHandleCount * sizeof (BOOLEAN));
     713  ASSERT (mDriSelection != NULL);
     714
     715  DriverImageProtocol = AllocateZeroPool (DriverImageHandleCount * sizeof (EFI_LOADED_IMAGE_PROTOCOL *));
     716  ASSERT (DriverImageProtocol != NULL);
     717  DriverImageFilePathToken = AllocateZeroPool (DriverImageHandleCount * sizeof (EFI_STRING_ID));
     718  ASSERT (DriverImageFilePathToken != NULL);
     719
    716720  mDriverImageHandleCount = DriverImageHandleCount;
    717721  for (Index = 0; Index < DriverImageHandleCount; Index++) {
     
    734738                    );
    735739    if (EFI_ERROR (Status)) {
    736       FakeNvData->DriSelection[Index] = 0x00;
     740      mDriSelection[Index] = FALSE;
    737741      continue;
    738742    }
    739     mDriverImageProtocol[Index] = LoadedImage;
     743    DriverImageProtocol[Index] = LoadedImage;
    740744    //
    741745    // Find its related driver binding protocol
     
    743747    DriverBindingHandle = GetDriverBindingHandleFromImageHandle (mDriverImageHandleBuffer[Index]);
    744748    if (DriverBindingHandle == NULL) {
    745       FakeNvData->DriSelection[Index] = 0x00;
     749      mDriSelection[Index] = FALSE;
    746750      continue;
    747751    }
     
    757761                        );
    758762    if (LoadedImageDevicePath == NULL) {
    759       FakeNvData->DriSelection[Index] = 0x00;
     763      mDriSelection[Index] = FALSE;
    760764      continue;
    761765    }
     
    773777                         );
    774778        if (EFI_ERROR (Status) || BusSpecificDriverOverride == NULL) {
    775           FakeNvData->DriSelection[Index] = 0x00;
     779          mDriSelection[Index] = FALSE;
    776780          continue;
    777781        }
    778782      } else {
    779         FakeNvData->DriSelection[Index] = 0x00;
     783        mDriSelection[Index] = FALSE;
    780784        continue;
    781785      }
     
    814818    ASSERT (NewString != NULL);
    815819    if (EFI_ERROR (CheckMapping (mControllerDevicePathProtocol[mSelectedCtrIndex], LoadedImageDevicePath, &mMappingDataBase, NULL, NULL))) {
    816       FakeNvData->DriSelection[Index] = 0x00;
     820      mDriSelection[Index] = FALSE;
    817821    } else {
    818       FakeNvData->DriSelection[Index] = 0x01;
     822      mDriSelection[Index] = TRUE;
    819823      mLastSavedDriverImageNum++;
    820824    }
     
    836840    ASSERT (NewString != NULL);
    837841    StrCat (NewString, DriverName);
    838     NewStringHelpToken = HiiSetString (Private->RegisteredHandle, mDriverImageFilePathToken[Index], NewString, NULL);
     842    NewStringHelpToken = HiiSetString (Private->RegisteredHandle, DriverImageFilePathToken[Index], NewString, NULL);
    839843    ASSERT (NewStringHelpToken != 0);
    840     mDriverImageFilePathToken[Index] = NewStringHelpToken;
     844    DriverImageFilePathToken[Index] = NewStringHelpToken;
    841845    FreePool (NewString);
    842846    FreePool (DriverName);
    843847
     848    CheckFlags        = 0;
     849    if (mDriSelection[Index]) {
     850      CheckFlags |= EFI_IFR_CHECKBOX_DEFAULT;
     851    }
     852
    844853    HiiCreateCheckBoxOpCode (
    845854      StartOpCodeHandle,
    846       (UINT16) (DRIVER_SELECTION_QUESTION_ID + Index),
    847       VARSTORE_ID_PLAT_OVER_MNGR,
    848       (UINT16) (DRIVER_SELECTION_VAR_OFFSET + Index),
     855      (UINT16) (KEY_VALUE_DRIVER_OFFSET + Index),
     856      0,
     857      0,
    849858      NewStringToken,
    850859      NewStringHelpToken,
    851       0,
    852       0,
     860      EFI_IFR_FLAG_CALLBACK,
     861      CheckFlags,
    853862      NULL
    854863      );
     
    868877  HiiFreeOpCodeHandle (StartOpCodeHandle);
    869878  HiiFreeOpCodeHandle (EndOpCodeHandle);
     879
     880  if (DriverImageProtocol != NULL) {
     881    FreePool (DriverImageProtocol);
     882  }
     883
     884  if (DriverImageFilePathToken != NULL) {
     885    FreePool (DriverImageFilePathToken);
     886  }
     887
    870888  return EFI_SUCCESS;
    871889}
     
    948966  SelectedDriverImageNum = 0;
    949967  for (Index = 0; Index < mDriverImageHandleCount; Index++) {
    950     if (FakeNvData->DriSelection[Index] != 0) {
     968    if (mDriSelection[Index]) {
    951969      SelectedDriverImageNum ++;
    952970    }
     
    966984  SelectedDriverImageNum = 0;
    967985  for (Index = 0; Index < mDriverImageHandleCount; Index++) {
    968     if (FakeNvData->DriSelection[Index] != 0) {
     986    if (mDriSelection[Index]) {
    969987      //
    970988      // Use the NO. in driver binding buffer as value, will use it later
     
    10841102**/
    10851103EFI_STATUS
    1086 CommintChanges (
     1104CommitChanges (
    10871105  IN EFI_CALLBACK_INFO                *Private,
    10881106  IN UINT16                           KeyValue,
     
    12571275  UINT16                                    KeyValue;
    12581276  PLAT_OVER_MNGR_DATA                       *FakeNvData;
     1277  EFI_STATUS                                Status;
    12591278
    12601279  if (Configuration == NULL || Progress == NULL) {
     
    12771296  }
    12781297
    1279   if (mCurrentPage == FORM_ID_DRIVER) {
    1280     KeyValue = KEY_VALUE_DRIVER_GOTO_ORDER;
    1281     UpdatePrioritySelectPage (Private, KeyValue, FakeNvData);
    1282     KeyValue = KEY_VALUE_ORDER_SAVE_AND_EXIT;
    1283     CommintChanges (Private, KeyValue, FakeNvData);
    1284     //
    1285     // Since UpdatePrioritySelectPage will change mCurrentPage,
    1286     // should ensure the mCurrentPage still indicate the second page here
    1287     //
    1288     mCurrentPage = FORM_ID_DRIVER;
    1289   }
     1298  Status = EFI_SUCCESS;
    12901299
    12911300  if (mCurrentPage == FORM_ID_ORDER) {
    12921301    KeyValue = KEY_VALUE_ORDER_SAVE_AND_EXIT;
    1293     CommintChanges (Private, KeyValue, FakeNvData);
    1294   }
    1295 
    1296   return EFI_SUCCESS;
     1302    Status = CommitChanges (Private, KeyValue, FakeNvData);
     1303  }
     1304
     1305  return Status;
    12971306}
    12981307
     
    13641373    }
    13651374
    1366     if (((KeyValue >= KEY_VALUE_DEVICE_OFFSET) && (KeyValue < KEY_VALUE_DEVICE_MAX)) || (KeyValue == KEY_VALUE_ORDER_GOTO_PREVIOUS)) {
     1375    if (((KeyValue >= KEY_VALUE_DEVICE_OFFSET) && (KeyValue < KEY_VALUE_DEVICE_OFFSET + mMaxDeviceCount)) || (KeyValue == KEY_VALUE_ORDER_GOTO_PREVIOUS)) {
    13671376      if (KeyValue == KEY_VALUE_ORDER_GOTO_PREVIOUS) {
    13681377        KeyValue = (EFI_QUESTION_ID) (mSelectedCtrIndex + KEY_VALUE_DEVICE_OFFSET);
     
    13981407    }
    13991408  } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
    1400     switch (KeyValue) {
    1401     case KEY_VALUE_DEVICE_REFRESH:
    1402     case KEY_VALUE_DEVICE_FILTER:
    1403       UpdateDeviceSelectPage (Private, KeyValue, FakeNvData);
    1404       //
    1405       // Update page title string
    1406       //
    1407       NewStringToken = STRING_TOKEN (STR_TITLE);
    1408       if (HiiSetString (Private->RegisteredHandle, NewStringToken, L"First, Select the controller by device path", NULL) == 0) {
    1409         ASSERT (FALSE);
     1409    if ((KeyValue >= KEY_VALUE_DRIVER_OFFSET) && (KeyValue < KEY_VALUE_DRIVER_OFFSET + mDriverImageHandleCount)) {
     1410      mDriSelection[KeyValue - KEY_VALUE_DRIVER_OFFSET] = Value->b;
     1411    } else {
     1412      switch (KeyValue) {
     1413      case KEY_VALUE_DEVICE_REFRESH:
     1414      case KEY_VALUE_DEVICE_FILTER:
     1415        UpdateDeviceSelectPage (Private, KeyValue, FakeNvData);
     1416        //
     1417        // Update page title string
     1418        //
     1419        NewStringToken = STRING_TOKEN (STR_TITLE);
     1420        if (HiiSetString (Private->RegisteredHandle, NewStringToken, L"First, Select the controller by device path", NULL) == 0) {
     1421          ASSERT (FALSE);
     1422        }
     1423      break;
     1424     
     1425      case KEY_VALUE_ORDER_SAVE_AND_EXIT:
     1426        Status = CommitChanges (Private, KeyValue, FakeNvData);
     1427        *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
     1428        if (EFI_ERROR (Status)) {
     1429          CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Single Override Info too large, Saving Error!", NULL);
     1430          return EFI_DEVICE_ERROR;
     1431        }
     1432      break;
     1433
     1434      default:
     1435      break;
    14101436      }
    1411     break;
    1412    
    1413     case KEY_VALUE_ORDER_SAVE_AND_EXIT:
    1414       Status = CommintChanges (Private, KeyValue, FakeNvData);
    1415       *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
    1416       if (EFI_ERROR (Status)) {
    1417         CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Single Override Info too large, Saving Error!", NULL);
    1418         return EFI_DEVICE_ERROR;
    1419       }
    1420     break;
    1421 
    1422     default:
    1423     break;
    14241437    }
    14251438  }
     
    16731686  mDriverImageHandleCount = 0;
    16741687  mCurrentPage = 0;
    1675   ZeroMem (mDriverImageToken, MAX_CHOICE_NUM * sizeof (EFI_STRING_ID));
    1676   ZeroMem (mDriverImageFilePathToken, MAX_CHOICE_NUM * sizeof (EFI_STRING_ID));
    1677   ZeroMem (mControllerToken, MAX_CHOICE_NUM * sizeof (EFI_STRING_ID));
    1678   ZeroMem (mDriverImageProtocol, MAX_CHOICE_NUM * sizeof (EFI_LOADED_IMAGE_PROTOCOL *));
    16791688 
    16801689  return EFI_SUCCESS;
     
    17201729  FreePool (mCallbackInfo);
    17211730
     1731  if (mControllerToken != NULL) {
     1732    FreePool (mControllerToken);
     1733  }
     1734
     1735  if (mControllerDevicePathProtocol != NULL) {
     1736    FreePool (mControllerDevicePathProtocol);
     1737  }
     1738
     1739  if (mDriverImageToken != NULL) {
     1740    FreePool (mDriverImageToken);
     1741  }
     1742
    17221743  return EFI_SUCCESS;
    17231744}
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c

    r48674 r58459  
    22  Implementation of the shared functions to do the platform driver vverride mapping.
    33
    4   Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2007 - 2014, 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
     
    692692  VariableNum = 1;
    693693  Corrupted = FALSE;
     694  NotEnd = 0;
    694695  do {
    695696    VariableIndex = VariableBuffer;
    696     //
    697     // End flag
    698     //
    699     NotEnd = *(UINT32*) VariableIndex;
     697    if (VariableIndex + sizeof (UINT32) > (UINT8 *) VariableBuffer + BufferSize) {
     698      Corrupted = TRUE;
     699    } else {
     700      //
     701      // End flag
     702      //
     703      NotEnd = *(UINT32*) VariableIndex;
     704    }
    700705    //
    701706    // Traverse the entries containing the mapping that Controller Device Path
     
    707712      // Check signature of this entry
    708713      //
     714      if (VariableIndex + sizeof (UINT32) > (UINT8 *) VariableBuffer + BufferSize) {
     715        Corrupted = TRUE;
     716        break;
     717      }
    709718      Signature = *(UINT32 *) VariableIndex;
    710719      if (Signature != PLATFORM_OVERRIDE_ITEM_SIGNATURE) {
     
    723732      // Get DriverNum
    724733      //
     734      if (VariableIndex + sizeof (UINT32) >= (UINT8 *) VariableBuffer + BufferSize) {
     735        Corrupted = TRUE;
     736        break;
     737      }
    725738      DriverNumber = *(UINT32*) VariableIndex;
    726739      OverrideItem->DriverInfoNum = DriverNumber;
     
    736749      //
    737750      VariableIndex += ((sizeof(UINT32) - ((UINTN) (VariableIndex))) & (sizeof(UINT32) - 1));
     751      //
     752      // Check buffer overflow.
     753      //
     754      if ((OverrideItem->ControllerDevicePath == NULL) || (VariableIndex < (UINT8 *) ControllerDevicePath) ||
     755          (VariableIndex > (UINT8 *) VariableBuffer + BufferSize)) {
     756        Corrupted = TRUE;
     757        break;
     758      }
    738759
    739760      //
     
    757778
    758779        InsertTailList (&OverrideItem->DriverInfoList, &DriverImageInfo->Link);
     780
     781        //
     782        // Check buffer overflow
     783        //
     784        if ((DriverImageInfo->DriverImagePath == NULL) || (VariableIndex < (UINT8 *) DriverDevicePath) ||
     785            (VariableIndex < (UINT8 *) VariableBuffer + BufferSize)) {
     786          Corrupted = TRUE;
     787          break;
     788        }
    759789      }
    760790      InsertTailList (MappingDataBase, &OverrideItem->Link);
     791      if (Corrupted) {
     792        break;
     793      }
    761794    }
    762795
     
    867900  // Check NotEnd to get all PlatDriOverX variable(s)
    868901  //
    869   while ((*(UINT32*)VariableBuffer) != 0) {
     902  while ((VariableBuffer != NULL) && ((*(UINT32*)VariableBuffer) != 0)) {
     903    FreePool (VariableBuffer);
    870904    UnicodeSPrint (OverrideVariableName, sizeof (OverrideVariableName), L"PlatDriOver%d", VariableNum);
    871905    VariableBuffer = GetVariableAndSize (OverrideVariableName, &gEfiCallerIdGuid, &BufferSize);
    872906    VariableNum++;
    873     ASSERT (VariableBuffer != NULL);
    874907  }
    875908
     
    880913                  L"PlatDriOver",
    881914                  &gEfiCallerIdGuid,
    882                   EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
     915                  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
    883916                  0,
    884917                  NULL
     
    890923                    OverrideVariableName,
    891924                    &gEfiCallerIdGuid,
    892                     EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
     925                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
    893926                    0,
    894927                    NULL
     
    945978  //
    946979  gRT->QueryVariableInfo (
    947           EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
     980          EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
    948981          &MaximumVariableStorageSize,
    949982          &RemainingVariableStorageSize,
     
    10541087                    OverrideVariableName,
    10551088                    &gEfiCallerIdGuid,
    1056                     EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
     1089                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
    10571090                    VariableNeededSize,
    10581091                    VariableBuffer
    10591092                    );
    1060     ASSERT (!EFI_ERROR(Status));
     1093    FreePool (VariableBuffer);
     1094
     1095    if (EFI_ERROR (Status)) {
     1096      if (NumIndex > 0) {
     1097        //
     1098        // Delete all PlatDriOver variables when full mapping can't be set. 
     1099        //
     1100        DeleteOverridesVariables ();
     1101      }
     1102      return Status;
     1103    }
    10611104
    10621105    NumIndex ++;
    1063     FreePool (VariableBuffer);
    10641106  }
    10651107
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatOverMngr.h

    r48674 r58459  
    44  The PLAT_OVER_MNGR_DATA structure, form guid and Ifr question ID are defined.
    55
    6 Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
     6Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
    77This program and the accompanying materials
    88are licensed and made available under the terms and conditions of the BSD License
     
    2323// The max number of the supported driver list.
    2424//
    25 #define MAX_CHOICE_NUM    0x00ff
     25#define MAX_CHOICE_NUM    0x00FF
    2626#define UPDATE_DATA_SIZE  0x1000
    2727
     
    3131
    3232#define KEY_VALUE_DEVICE_OFFSET        0x0100
    33 #define KEY_VALUE_DEVICE_MAX           (KEY_VALUE_DEVICE_OFFSET + MAX_CHOICE_NUM)
     33#define KEY_VALUE_DRIVER_OFFSET        0x0300
    3434
    3535#define KEY_VALUE_DEVICE_REFRESH       0x1234
     
    4848
    4949typedef struct {
    50   UINT8   DriSelection[MAX_CHOICE_NUM];
    5150  UINT8   DriOrder[MAX_CHOICE_NUM];
    5251  UINT8   PciDeviceFilter;
     
    5756//
    5857#define VAR_OFFSET(Field)              ((UINTN) &(((PLAT_OVER_MNGR_DATA *) 0)->Field))
    59 #define DRIVER_SELECTION_VAR_OFFSET     (VAR_OFFSET (DriSelection))
    6058#define DRIVER_ORDER_VAR_OFFSET         (VAR_OFFSET (DriOrder))
    6159
     
    6563//
    6664#define QUESTION_ID_OFFSET              0x0500
    67 #define DRIVER_SELECTION_QUESTION_ID    (VAR_OFFSET (DriSelection) + QUESTION_ID_OFFSET)
    6865#define DRIVER_ORDER_QUESTION_ID        (VAR_OFFSET (DriOrder) + QUESTION_ID_OFFSET)
    6966
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf

    r48674 r58459  
    1717#     which will be consumed by GetDriver API of the produced the platform override protocol.
    1818#
    19 # Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
     19# Caution: This module is a sample implementation for the test purpose.
     20#
     21# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
    2022#
    2123#  This program and the accompanying materials
     
    3234  INF_VERSION                    = 0x00010005
    3335  BASE_NAME                      = PlatDriOverrideDxe
     36  MODULE_UNI_FILE                = PlatDriOverrideDxe.uni
    3437  FILE_GUID                      = 35034CE2-A6E5-4fb4-BABE-A0156E9B2549
    3538  MODULE_TYPE                    = DXE_DRIVER
     
    7174   
    7275[Guids]
    73   ##  This GUID C Name is not required for build since it is from UefiLib and not directly used by this module source.
    74   ##  gEfiGlobalVariableGuid                      ## SOMETIMES_CONSUMED ## Variable:L"PlatformLang" this variable specifies the platform supported language string (RFC 4646 format)
    75   ##  gEfiGlobalVariableGuid                      ## SOMETIMES_CONSUMED ## Variable:L"Lang" this variable specifies the platform supported language string (ISO 639-2 format)
    76   ##
     76  #
     77  # This GUID C Name is not required for build since it is from UefiLib and not directly used by this module source.
     78  #  gEfiGlobalVariableGuid                     ## SOMETIMES_CONSUMES   ## Variable:L"PlatformLang" # this variable specifies the platform supported language string (RFC 4646 format)
     79  #  gEfiGlobalVariableGuid                     ## SOMETIMES_CONSUMES   ## Variable:L"Lang" # this variable specifies the platform supported language string (ISO 639-2 format)
     80  #
    7781  # There could be more than one variables, from PlatDriOver, PlatDriOver1, PlatDriOver2,...
     82  #  gEfiCallerIdGuid                           ## Private  ## Variable:L"PlatDriOver"
    7883  #
    79   # gEfiCallerIdGuid                            ## Private  ## Variable:L"PlatDriOver"
    80   gEfiIfrTianoGuid                              ## CONSUMES ## Guid
    81   gPlatformOverridesManagerGuid                 ## PRODUCES ## Guid
     84  gEfiIfrTianoGuid                              ## SOMETIMES_PRODUCES   ## UNDEFINED
     85  ## SOMETIMES_CONSUMES ## GUID # HiiIsConfigHdrMatch Data
     86  ## SOMETIMES_PRODUCES ## GUID # HiiGetBrowserData Data
     87  ## SOMETIMES_CONSUMES ## GUID # HiiSetBrowserData Data
     88  ## SOMETIMES_PRODUCES ## GUID # HiiConstructConfigHdr Data
     89  ## CONSUMES           ## HII
     90  gPlatformOverridesManagerGuid
    8291
    8392[Protocols]
    84   gEfiComponentName2ProtocolGuid                ## SOMETIMES_CONSUMED (Get Driver Name if ComponentName2Protocol exists)
    85   gEfiComponentNameProtocolGuid                 ## SOMETIMES_CONSUMED (Get Driver Name if ComponentNameProtocol exists and ComponentName2Protocol doesn't exist)
    86   gEfiFirmwareVolume2ProtocolGuid               ## SOMETIMES_CONSUMED (Get Driver Name from EFI UI section if ComponentName2Protocol and ComponentNameProtocol don't exist)
    87   gEfiPciIoProtocolGuid                         ## SOMETIMES_CONSUMED (Find the PCI device if PciIo protocol is installed)
    88   gEfiBusSpecificDriverOverrideProtocolGuid     ## SOMETIMES_CONSUMED (Check whether the PCI device contains one or more efi drivers in its option rom by this protocol)
     93  gEfiComponentName2ProtocolGuid                ## SOMETIMES_CONSUMES # Get Driver Name if ComponentName2Protocol exists
     94  gEfiComponentNameProtocolGuid                 ## SOMETIMES_CONSUMES # Get Driver Name if ComponentNameProtocol exists and ComponentName2Protocol doesn't exist
     95  gEfiFirmwareVolume2ProtocolGuid               ## SOMETIMES_CONSUMES # Get Driver Name from EFI UI section if ComponentName2Protocol and ComponentNameProtocol don't exist
     96  gEfiPciIoProtocolGuid                         ## SOMETIMES_CONSUMES # Find the PCI device if PciIo protocol is installed
     97  gEfiBusSpecificDriverOverrideProtocolGuid     ## SOMETIMES_CONSUMES # Check whether the PCI device contains one or more efi drivers in its option rom by this protocol
    8998
    90   gEfiDriverBindingProtocolGuid                 ## SOMETIMES_CONSUMED
    91   gEfiLoadedImageProtocolGuid                   ## SOMETIMES_CONSUMED
    92   gEfiLoadedImageDevicePathProtocolGuid         ## SOMETIMES_CONSUMED (Show the drivers in the second page that support DriverBindingProtocol, LoadedImageProtocol and LoadedImageDevicePathProtocol)
    93   gEfiDevicePathProtocolGuid                    ## SOMETIMES_CONSUMED (Show the controller device in the first page that support DevicePathProtocol)
     99  gEfiDriverBindingProtocolGuid                 ## SOMETIMES_CONSUMES
     100  gEfiLoadedImageProtocolGuid                   ## SOMETIMES_CONSUMES
     101  gEfiLoadedImageDevicePathProtocolGuid         ## SOMETIMES_CONSUMES # Show the drivers in the second page that support DriverBindingProtocol, LoadedImageProtocol and LoadedImageDevicePathProtocol
    94102
    95   gEfiFormBrowser2ProtocolGuid                  ## CONSUMED
    96   gEfiHiiConfigRoutingProtocolGuid              ## CONSUMED
    97   gEfiHiiConfigAccessProtocolGuid               ## PRODUCED
    98   gEfiDevicePathToTextProtocolGuid              ## CONSUMED
    99   gEfiPlatformDriverOverrideProtocolGuid        ## PRODUCED
     103  gEfiFormBrowser2ProtocolGuid                  ## CONSUMES
     104  gEfiHiiConfigRoutingProtocolGuid              ## CONSUMES
     105  gEfiHiiConfigAccessProtocolGuid               ## PRODUCES
     106  gEfiPlatformDriverOverrideProtocolGuid        ## PRODUCES
     107  ## PRODUCES
     108  ## SOMETIMES_CONSUMES # Show the controller device in the first page that support DevicePathProtocol
     109  gEfiDevicePathProtocolGuid
    100110
    101111[Depex]
    102112  gEfiFormBrowser2ProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid
     113
     114[UserExtensions.TianoCore."ExtraFiles"]
     115  PlatDriOverrideDxeExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr

    r48674 r58459  
    4343      help   = STRING_TOKEN(STR_FIRST_REFRESH_HELP),
    4444      text   = STRING_TOKEN(STR_FIRST_REFRESH),
    45       text   = STRING_TOKEN(STR_NULL_STRING),
    4645      flags  = INTERACTIVE,
    4746      key    = KEY_VALUE_DEVICE_REFRESH;
     
    103102      help   = STRING_TOKEN (STR_NULL_STRING),
    104103      text   = STRING_TOKEN (STR_SAVE_AND_EXIT),
    105         text   = STRING_TOKEN (STR_SAVE_AND_EXIT),
    106104      flags  = INTERACTIVE | RESET_REQUIRED,
    107105      key    = KEY_VALUE_ORDER_SAVE_AND_EXIT;
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