OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
BmBoot.c File Reference

Go to the source code of this file.

Functions

STATIC EFI_DEVICE_PATH_PROTOCOL * BmExpandMediaDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
 
STATIC BOOLEAN BmMatchHttpBootDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *Left, IN EFI_DEVICE_PATH_PROTOCOL *Right)
 
STATIC EFI_DEVICE_PATH_PROTOCOL * BmExpandNetworkFileSystem (IN EFI_HANDLE LoadFileHandle, OUT EFI_HANDLE *RamDiskHandle)
 
EFI_DEVICE_PATH_PROTOCOL * BmGetRamDiskDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
STATIC VOID * BmGetRamDiskMemoryInfo (IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath, OUT UINTN *RamDiskSizeInPages)
 
VOID BmDestroyRamDisk (IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath)
 
STATIC EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFile (IN EFI_HANDLE LoadFileHandle, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT VOID **Data, OUT UINT32 *DataSize)
 
EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFiles (IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT VOID **Data, OUT UINT32 *DataSize, IN BOOLEAN ValidateHttp)
 

Variables

EFI_RAM_DISK_PROTOCOL * mRamDisk = NULL
 

Detailed Description

Library functions which relate to booting.

Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
Copyright (C) 2024, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BmBoot.c.

Function Documentation

◆ BmDestroyRamDisk()

VOID BmDestroyRamDisk ( IN EFI_DEVICE_PATH_PROTOCOL * RamDiskDevicePath)

Destroy the RAM Disk.

The destroy operation includes to call RamDisk.Unregister to unregister the RAM DISK from RAM DISK driver, free the memory allocated for the RAM Disk.

Parameters
RamDiskDevicePathRAM Disk device path.

Definition at line 345 of file BmBoot.c.

◆ BmExpandLoadFile()

STATIC EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFile ( IN EFI_HANDLE LoadFileHandle,
IN EFI_DEVICE_PATH_PROTOCOL * FilePath,
OUT VOID ** Data,
OUT UINT32 * DataSize )

Get the file buffer from the specified Load File instance.

Parameters
LoadFileHandleThe specified Load File instance.
FilePathThe file path which will pass to LoadFile().
Returns
The full device path pointing to the load option buffer.

Definition at line 380 of file BmBoot.c.

◆ BmExpandLoadFiles()

EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFiles ( IN EFI_DEVICE_PATH_PROTOCOL * FilePath,
OUT VOID ** Data,
OUT UINT32 * DataSize,
IN BOOLEAN ValidateHttp )

Return the full device path pointing to the load option.

FilePath may:

  1. Exactly matches to a LoadFile instance.
  2. Cannot match to any LoadFile instance. Wide match is required. In either case, the routine may return:
  1. A copy of FilePath when FilePath matches to a LoadFile instance and the LoadFile returns a load option buffer.
  2. A new device path with IP and URI information updated when wide match happens.
  3. A new device path pointing to a load option in RAM disk. In either case, only one full device path is returned for a specified FilePath.
Parameters
FilePathThe media device path pointing to a LoadFile instance.
Returns
The load option buffer.

< Sort out cramped spacing

Definition at line 530 of file BmBoot.c.

◆ BmExpandMediaDevicePath()

STATIC EFI_DEVICE_PATH_PROTOCOL * BmExpandMediaDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL * DevicePath,
IN EFI_DEVICE_PATH_PROTOCOL * FullPath )

Expand the media device path which points to a BlockIo or SimpleFileSystem instance by appending EFI_REMOVABLE_MEDIA_FILE_NAME.

Parameters
DevicePathThe media device path pointing to a BlockIo or SimpleFileSystem instance.
FullPathThe full path returned by the routine in last call. Set to NULL in first call.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 29 of file BmBoot.c.

◆ BmExpandNetworkFileSystem()

STATIC EFI_DEVICE_PATH_PROTOCOL * BmExpandNetworkFileSystem ( IN EFI_HANDLE LoadFileHandle,
OUT EFI_HANDLE * RamDiskHandle )

Get the file buffer from the file system produced by Load File instance.

Parameters
LoadFileHandleThe handle of LoadFile instance.
RamDiskHandleReturn the RAM Disk handle.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 198 of file BmBoot.c.

◆ BmGetRamDiskDevicePath()

EFI_DEVICE_PATH_PROTOCOL * BmGetRamDiskDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL * FilePath)

Return the RAM Disk device path created by LoadFile.

Parameters
FilePathThe source file path.
Returns
Callee-to-free RAM Disk device path

Definition at line 267 of file BmBoot.c.

◆ BmGetRamDiskMemoryInfo()

STATIC VOID * BmGetRamDiskMemoryInfo ( IN EFI_DEVICE_PATH_PROTOCOL * RamDiskDevicePath,
OUT UINTN * RamDiskSizeInPages )

Return the buffer and buffer size occupied by the RAM Disk.

Parameters
RamDiskDevicePathRAM Disk device path.
RamDiskSizeInPagesReturn RAM Disk size in pages.
Return values
RAMDisk buffer.

Definition at line 306 of file BmBoot.c.

◆ BmMatchHttpBootDevicePath()

STATIC BOOLEAN BmMatchHttpBootDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL * Left,
IN EFI_DEVICE_PATH_PROTOCOL * Right )

Check whether Left and Right are the same without matching the specific device path data in IP device path and URI device path node.

Return values
TRUELeft and Right are the same.
FALSELeft and Right are the different.

Definition at line 152 of file BmBoot.c.

Variable Documentation

◆ mRamDisk

EFI_RAM_DISK_PROTOCOL* mRamDisk = NULL

Definition at line 14 of file BmBoot.c.