123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /*++
- Copyright (c) 2014 Minoca Corp.
- This file is licensed under the terms of the GNU General Public License
- version 3. Alternative licensing terms are available. Contact
- info@minocacorp.com for details. See the LICENSE file at the root of this
- project for complete licensing information.
- Module Name:
- ramdenum.c
- Abstract:
- This module implements support for creating a Block I/O protocol from a
- RAM Disk device.
- Author:
- Evan Green 3-Apr-2014
- Environment:
- Firmware
- --*/
- //
- // ------------------------------------------------------------------- Includes
- //
- #include <uefifw.h>
- //
- // --------------------------------------------------------------------- Macros
- //
- //
- // ---------------------------------------------------------------- Definitions
- //
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- //
- // ----------------------------------------------- Internal Function Prototypes
- //
- //
- // -------------------------------------------------------------------- Globals
- //
- //
- // The RAM disk is embedded in the firmware image.
- //
- extern CHAR8 _binary_ramdisk_start;
- extern CHAR8 _binary_ramdisk_end;
- //
- // ------------------------------------------------------------------ Functions
- //
- EFI_STATUS
- EfipEnumerateRamDisks (
- VOID
- )
- /*++
- Routine Description:
- This routine enumerates any RAM disks embedded in the firmware.
- Arguments:
- None.
- Return Value:
- EFI Status code.
- --*/
- {
- EFI_PHYSICAL_ADDRESS Base;
- UINT64 Length;
- EFI_STATUS Status;
- Base = (EFI_PHYSICAL_ADDRESS)(UINTN)(&_binary_ramdisk_start);
- Length = (UINTN)(&_binary_ramdisk_end) - (UINTN)(&_binary_ramdisk_start);
- if (Length <= 0x100) {
- return EFI_SUCCESS;
- }
- Status = EfiCoreEnumerateRamDisk(Base, Length);
- return Status;
- }
- //
- // --------------------------------------------------------- Internal Functions
- //
|