TianoCore EDK2 master
Loading...
Searching...
No Matches
FvSimpleFileSystemEntryPoint.c File Reference

Go to the source code of this file.

Macros

#define GUID_STRING_SIZE   (37 * sizeof (CHAR16))
 
#define FVFS_VOLUME_LABEL_PREFIX   L"Firmware Volume: "
 
#define FVFS_VOLUME_LABEL_SIZE   (sizeof (FVFS_VOLUME_LABEL_PREFIX) + GUID_STRING_SIZE - sizeof (CHAR16))
 
#define FVFS_FALLBACK_VOLUME_LABEL   L"Firmware Volume"
 

Functions

EFI_STATUS EFIAPI FvSimpleFileSystemOpenVolume (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **RootFile)
 
EFI_STATUS InitializeUnicodeCollationSupportWorker (IN EFI_HANDLE AgentHandle, IN EFI_GUID *ProtocolGuid, IN CONST CHAR16 *VariableName, IN CONST CHAR8 *DefaultLanguage)
 
EFI_STATUS InitializeUnicodeCollationSupport (IN EFI_HANDLE AgentHandle)
 
EFI_STATUS EFIAPI FvSimpleFileSystemDriverSupported (IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI FvSimpleFileSystemDriverStart (IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI FvSimpleFileSystemDriverStop (IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
 
EFI_STATUS EFIAPI FvSimpleFileSystemEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

EFI_UNICODE_COLLATION_PROTOCOLmUnicodeCollation = NULL
 
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL mSimpleFsTemplate
 
EFI_DRIVER_BINDING_PROTOCOL mDriverBinding
 

Detailed Description

This driver uses the EFI_FIRMWARE_VOLUME2_PROTOCOL to expose files in firmware volumes via the the EFI_SIMPLE_FILESYSTEM_PROTOCOL and EFI_FILE_PROTOCOL.

It will expose a single directory, containing one file for each file in the firmware volume. If a file has a UI section, its contents will be used as a filename. Otherwise, a string representation of the GUID will be used. Files of an executable type (That is PEIM, DRIVER, COMBINED_PEIM_DRIVER and APPLICATION) will have ".efi" added to their filename.

Its primary intended use is to be able to start EFI applications embedded in FVs from the UEFI shell. It is entirely read-only.

Copyright (c) 2014, ARM Limited. All rights reserved. Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file FvSimpleFileSystemEntryPoint.c.

Macro Definition Documentation

◆ FVFS_FALLBACK_VOLUME_LABEL

#define FVFS_FALLBACK_VOLUME_LABEL   L"Firmware Volume"

Definition at line 32 of file FvSimpleFileSystemEntryPoint.c.

◆ FVFS_VOLUME_LABEL_PREFIX

#define FVFS_VOLUME_LABEL_PREFIX   L"Firmware Volume: "

Definition at line 30 of file FvSimpleFileSystemEntryPoint.c.

◆ FVFS_VOLUME_LABEL_SIZE

#define FVFS_VOLUME_LABEL_SIZE   (sizeof (FVFS_VOLUME_LABEL_PREFIX) + GUID_STRING_SIZE - sizeof (CHAR16))

Definition at line 31 of file FvSimpleFileSystemEntryPoint.c.

◆ GUID_STRING_SIZE

#define GUID_STRING_SIZE   (37 * sizeof (CHAR16))

Definition at line 28 of file FvSimpleFileSystemEntryPoint.c.

Function Documentation

◆ FvSimpleFileSystemDriverStart()

EFI_STATUS EFIAPI FvSimpleFileSystemDriverStart ( IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Start this driver on ControllerHandle by opening a FV protocol and installing a SimpleFileSystem protocol on ControllerHandle.

Parameters
DriverBindingProtocol instance pointer.
ControllerHandleHandle of device to bind driver to
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver is added to ControllerHandle
EFI_ALREADY_STARTEDThis driver is already running on ControllerHandle
otherThis driver does not support this device

Definition at line 416 of file FvSimpleFileSystemEntryPoint.c.

◆ FvSimpleFileSystemDriverStop()

EFI_STATUS EFIAPI FvSimpleFileSystemDriverStop ( IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN EFI_HANDLE  ControllerHandle,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer  OPTIONAL 
)

Stop this driver on ControllerHandle by removing SimpleFileSystem protocol and closing the FV protocol on ControllerHandle.

Parameters
DriverBindingProtocol instance pointer.
ControllerHandleHandle of device to stop driver on
NumberOfChildrenNumber of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver.
ChildHandleBufferList of Child Handles to Stop.
Return values
EFI_SUCCESSThis driver is removed ControllerHandle
otherThis driver was not removed from this device

Definition at line 551 of file FvSimpleFileSystemEntryPoint.c.

◆ FvSimpleFileSystemDriverSupported()

EFI_STATUS EFIAPI FvSimpleFileSystemDriverSupported ( IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Test to see if this driver supports ControllerHandle.

Parameters
DriverBindingProtocol instance pointer.
ControllerHandleHandle of device to test
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver supports this device
EFI_ALREADY_STARTEDThis driver is already running on this device
otherThis driver does not support this device

Definition at line 384 of file FvSimpleFileSystemEntryPoint.c.

◆ FvSimpleFileSystemEntryPoint()

EFI_STATUS EFIAPI FvSimpleFileSystemEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The user Entry Point for module FvSimpleFileSystem. The user code starts with this function.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
otherSome error occurs when executing this entry point.

Definition at line 659 of file FvSimpleFileSystemEntryPoint.c.

◆ FvSimpleFileSystemOpenVolume()

EFI_STATUS EFIAPI FvSimpleFileSystemOpenVolume ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL This,
OUT EFI_FILE_PROTOCOL **  RootFile 
)

Open the root directory on a volume.

Parameters
ThisA pointer to the volume to open the root directory.
RootFileA pointer to the location to return the opened file handle for the root directory.
Return values
EFI_SUCCESSThe device was opened.
EFI_UNSUPPORTEDThis volume does not support the requested file system type.
EFI_NO_MEDIAThe device has no medium.
EFI_DEVICE_ERRORThe device reported an error.
EFI_VOLUME_CORRUPTEDThe file system structures are corrupted.
EFI_ACCESS_DENIEDThe service denied access to the file.
EFI_OUT_OF_RESOURCESThe volume was not opened due to lack of resources.
EFI_MEDIA_CHANGEDThe device has a different medium in it or the medium is no longer supported. Any existing file handles for this volume are no longer valid. To access the files on the new medium, the volume must be reopened with OpenVolume().

Definition at line 76 of file FvSimpleFileSystemEntryPoint.c.

◆ InitializeUnicodeCollationSupport()

EFI_STATUS InitializeUnicodeCollationSupport ( IN EFI_HANDLE  AgentHandle)

Initialize Unicode Collation support.

It tries to locate Unicode Collation 2 protocol and matches it with current platform language code. If for any reason the first attempt fails, it then tries to use Unicode Collation Protocol.

Parameters
AgentHandleThe handle used to open Unicode Collation (2) protocol.
Return values
EFI_SUCCESSThe Unicode Collation (2) protocol has been successfully located.
OthersThe Unicode Collation (2) protocol has not been located.

Definition at line 336 of file FvSimpleFileSystemEntryPoint.c.

◆ InitializeUnicodeCollationSupportWorker()

EFI_STATUS InitializeUnicodeCollationSupportWorker ( IN EFI_HANDLE  AgentHandle,
IN EFI_GUID ProtocolGuid,
IN CONST CHAR16 *  VariableName,
IN CONST CHAR8 *  DefaultLanguage 
)

Worker function to initialize Unicode Collation support.

It tries to locate Unicode Collation (2) protocol and matches it with current platform language code.

Parameters
AgentHandleThe handle used to open Unicode Collation (2) protocol.
ProtocolGuidThe pointer to Unicode Collation (2) protocol GUID.
VariableNameThe name of the RFC 4646 or ISO 639-2 language variable.
DefaultLanguageThe default language in case the RFC 4646 or ISO 639-2 language is absent.
Return values
EFI_SUCCESSThe Unicode Collation (2) protocol has been successfully located.
OthersThe Unicode Collation (2) protocol has not been located.

Definition at line 246 of file FvSimpleFileSystemEntryPoint.c.

Variable Documentation

◆ mDriverBinding

Initial value:
= {
0,
}
EFI_STATUS EFIAPI FvSimpleFileSystemDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_STATUS EFIAPI FvSimpleFileSystemDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI FvSimpleFileSystemDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
#define NULL
Definition: Base.h:319

Definition at line 45 of file FvSimpleFileSystemEntryPoint.c.

◆ mSimpleFsTemplate

Initial value:
= {
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION,
}
EFI_STATUS EFIAPI FvSimpleFileSystemOpenVolume(IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **RootFile)

Definition at line 37 of file FvSimpleFileSystemEntryPoint.c.

◆ mUnicodeCollation

EFI_UNICODE_COLLATION_PROTOCOL* mUnicodeCollation = NULL

Definition at line 23 of file FvSimpleFileSystemEntryPoint.c.