FwBlockServiceSmm.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**@file
  2. Functions related to the Firmware Volume Block service whose
  3. implementation is specific to the SMM driver build.
  4. Copyright (C) 2015, Red Hat, Inc.
  5. Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
  6. SPDX-License-Identifier: BSD-2-Clause-Patent
  7. **/
  8. #include <Library/DebugLib.h>
  9. #include <Library/PcdLib.h>
  10. #include <Library/SmmServicesTableLib.h>
  11. #include <Protocol/DevicePath.h>
  12. #include <Protocol/SmmFirmwareVolumeBlock.h>
  13. #include "FwBlockService.h"
  14. VOID
  15. InstallProtocolInterfaces (
  16. IN EFI_FW_VOL_BLOCK_DEVICE *FvbDevice
  17. )
  18. {
  19. EFI_HANDLE FvbHandle;
  20. EFI_STATUS Status;
  21. ASSERT (FeaturePcdGet (PcdSmmSmramRequire));
  22. //
  23. // There is no SMM service that can install multiple protocols in the SMM
  24. // protocol database in one go.
  25. //
  26. // The SMM Firmware Volume Block protocol structure is the same as the
  27. // Firmware Volume Block protocol structure.
  28. //
  29. FvbHandle = NULL;
  30. DEBUG ((DEBUG_INFO, "Installing QEMU flash SMM FVB\n"));
  31. Status = gSmst->SmmInstallProtocolInterface (
  32. &FvbHandle,
  33. &gEfiSmmFirmwareVolumeBlockProtocolGuid,
  34. EFI_NATIVE_INTERFACE,
  35. &FvbDevice->FwVolBlockInstance
  36. );
  37. ASSERT_EFI_ERROR (Status);
  38. Status = gSmst->SmmInstallProtocolInterface (
  39. &FvbHandle,
  40. &gEfiDevicePathProtocolGuid,
  41. EFI_NATIVE_INTERFACE,
  42. FvbDevice->DevicePath
  43. );
  44. ASSERT_EFI_ERROR (Status);
  45. }
  46. VOID
  47. InstallVirtualAddressChangeHandler (
  48. VOID
  49. )
  50. {
  51. //
  52. // Nothing.
  53. //
  54. }
  55. EFI_STATUS
  56. MarkIoMemoryRangeForRuntimeAccess (
  57. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  58. IN UINTN Length
  59. )
  60. {
  61. //
  62. // Nothing
  63. //
  64. return EFI_SUCCESS;
  65. }
  66. VOID
  67. SetPcdFlashNvStorageBaseAddresses (
  68. VOID
  69. )
  70. {
  71. //
  72. // Do nothing.
  73. //
  74. }