fwvol.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*++
  2. Copyright (c) 2014 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. fwvol.c
  9. Abstract:
  10. This module implements support for the builtin UEFI firmware volume.
  11. Author:
  12. Evan Green 10-Mar-2014
  13. Environment:
  14. Firmware
  15. --*/
  16. //
  17. // ------------------------------------------------------------------- Includes
  18. //
  19. #include "uefifw.h"
  20. #include "biosfw.h"
  21. //
  22. // ---------------------------------------------------------------- Definitions
  23. //
  24. //
  25. // ------------------------------------------------------ Data Type Definitions
  26. //
  27. //
  28. // ----------------------------------------------- Internal Function Prototypes
  29. //
  30. //
  31. // -------------------------------------------------------------------- Globals
  32. //
  33. //
  34. // Objcopy adds these symbols surrounding the added file.
  35. //
  36. extern UINT8 _binary_biosfwv_start;
  37. extern UINT8 _binary_biosfwv_end;
  38. //
  39. // ------------------------------------------------------------------ Functions
  40. //
  41. EFI_STATUS
  42. EfiPlatformEnumerateFirmwareVolumes (
  43. VOID
  44. )
  45. /*++
  46. Routine Description:
  47. This routine enumerates any firmware volumes the platform may have
  48. tucked away. The platform should load them into memory and call
  49. EfiCreateFirmwareVolume for each one.
  50. Arguments:
  51. None.
  52. Return Value:
  53. EFI Status code.
  54. --*/
  55. {
  56. EFI_PHYSICAL_ADDRESS Base;
  57. UINTN Size;
  58. EFI_STATUS Status;
  59. Base = (EFI_PHYSICAL_ADDRESS)(UINTN)&_binary_biosfwv_start;
  60. Size = (UINTN)&_binary_biosfwv_end - (UINTN)&_binary_biosfwv_start;
  61. Status = EfiCreateFirmwareVolume(Base, Size, NULL, 0, NULL);
  62. return Status;
  63. }
  64. //
  65. // --------------------------------------------------------- Internal Functions
  66. //