EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions | Variables

ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c File Reference

#include "UefiShellLevel2CommandsLib.h"
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/BlockIo.h>
#include <Library/DevicePathLib.h>
#include <Library/HandleParsingLib.h>
#include <Library/SortLib.h>

Go to the source code of this file.

Functions

BOOLEAN EFIAPI IsNumberLetterOnly (IN CONST CHAR16 *String, IN CONST UINTN Len)
BOOLEAN EFIAPI SearchList (IN CONST CHAR16 *List, IN CONST CHAR16 *MetaTarget, OUT CHAR16 **FullName OPTIONAL, IN CONST BOOLEAN Meta, IN CONST BOOLEAN SkipTrailingNumbers, IN CONST CHAR16 *Target)
EFI_STATUS EFIAPI UpdateMapping (VOID)
CHAR16 *EFIAPI GetDeviceMediaType (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
BOOLEAN EFIAPI IsRemoveableDevice (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
BOOLEAN EFIAPI MappingListHasType (IN CONST CHAR16 *MapList, IN CONST CHAR16 *Specific, IN CONST CHAR16 *TypeString, IN CONST BOOLEAN Normal, IN CONST BOOLEAN Consist)
EFI_STATUS EFIAPI PerformSingleMappingDisplay (IN CONST BOOLEAN Verbose, IN CONST BOOLEAN Consist, IN CONST BOOLEAN Normal, IN CONST CHAR16 *TypeString, IN CONST BOOLEAN SFO, IN CONST CHAR16 *Specific OPTIONAL, IN CONST EFI_HANDLE Handle)
EFI_STATUS EFIAPI PerformSingleMappingDelete (IN CONST CHAR16 *Specific, IN CONST EFI_HANDLE Handle)
SHELL_STATUS EFIAPI PerformMappingDisplay (IN CONST BOOLEAN Verbose, IN CONST BOOLEAN Consist, IN CONST BOOLEAN Normal, IN CONST CHAR16 *TypeString, IN CONST BOOLEAN SFO, IN CONST CHAR16 *Specific OPTIONAL, IN CONST BOOLEAN Header)
SHELL_STATUS EFIAPI PerformMappingDisplay2 (IN CONST BOOLEAN Verbose, IN CONST BOOLEAN Consist, IN CONST BOOLEAN Normal, IN CONST CHAR16 *TypeString, IN CONST BOOLEAN SFO, IN CONST CHAR16 *Specific OPTIONAL)
EFI_STATUS EFIAPI PerformMappingDelete (IN CONST CHAR16 *Specific)
SHELL_STATUS EFIAPI AddMappingFromMapping (IN CONST CHAR16 *Map, IN CONST CHAR16 *SName)
SHELL_STATUS EFIAPI AddMappingFromHandle (IN CONST EFI_HANDLE Handle, IN CONST CHAR16 *SName)
SHELL_STATUS EFIAPI ShellCommandRunMap (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)

Variables

CONST CHAR16 Cd [] = "cd*"
CONST CHAR16 Hd [] = "hd*"
CONST CHAR16 Fp [] = "fp*"
CONST CHAR16 AnyF [] = "F*"
STATIC CONST SHELL_PARAM_ITEM MapParamList []

Detailed Description

Main file for map shell level 2 command.

Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file Map.c.


Function Documentation

SHELL_STATUS EFIAPI AddMappingFromHandle ( IN CONST EFI_HANDLE  Handle,
IN CONST CHAR16 SName 
)

function to add a mapping from an EFI_HANDLE.

This function will get the device path associated with the Handle and call SetMap.

Parameters:
[in]HandleThe handle to add a mapping for
[in]SNameThe name of the new mapping
Return values:
SHELL_SUCCESSthe mapping was added
SHELL_INVALID_PARAMETERSName was not valid for a map name.
Returns:
Shell version of a return value from either gBS->OpenProtocol or EfiShellProtocol->SetMap

Definition at line 954 of file Map.c.

SHELL_STATUS EFIAPI AddMappingFromMapping ( IN CONST CHAR16 Map,
IN CONST CHAR16 SName 
)

function to add a mapping from mapping.

This function will get the device path associated with the mapping and call SetMap.

Parameters:
[in]MapThe Map to add a mapping for
[in]SNameThe name of the new mapping
Return values:
SHELL_SUCCESSthe mapping was added
SHELL_INVALID_PARAMETERthe device path for Map could not be retrieved.
Returns:
Shell version of a return value from EfiShellProtocol->SetMap

Definition at line 901 of file Map.c.

CHAR16* EFIAPI GetDeviceMediaType ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath)

Determine what type of device is represented and return it's string. The string is in allocated memory and must be callee freed. The HII is is listed below. The actual string cannot be determined.

Parameters:
[in]DevicePathThe device to analyze.
Return values:
STR_MAP_MEDIA_UNKNOWNThe media type is unknown.
STR_MAP_MEDIA_HARDDISKThe media is a hard drive.
STR_MAP_MEDIA_CDROMThe media is a CD ROM.
STR_MAP_MEDIA_FLOPPYThe media is a floppy drive.

Definition at line 236 of file Map.c.

BOOLEAN EFIAPI IsNumberLetterOnly ( IN CONST CHAR16 String,
IN CONST UINTN  Len 
)

Determine if a string has only numbers and letters.

This is useful for such things as Map names which can only be letters and numbers.

Parameters:
[in]Stringpointer to the string to analyze,
[in]LenNumber of characters to analyze.
Return values:
TRUEString has only numbers and letters
FALSEString has at least one other character.

Definition at line 35 of file Map.c.

BOOLEAN EFIAPI IsRemoveableDevice ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath)

Function to detemine if a handle has removable storage.

Parameters:
[in]DevicePathDevicePath to test.
Return values:
TRUEThe handle has removable storage.
FALSEThe handle does not have removable storage.

Definition at line 282 of file Map.c.

BOOLEAN EFIAPI MappingListHasType ( IN CONST CHAR16 MapList,
IN CONST CHAR16 Specific,
IN CONST CHAR16 TypeString,
IN CONST BOOLEAN  Normal,
IN CONST BOOLEAN  Consist 
)

Function to detemine if a something on the map list matches.

Parameters:
[in]MapListThe pointer to the list to test.
[in]SpecificThe pointer to a specific name to test for.
[in]TypeStringThe pointer to the list of types.
[in]NormalAlways show normal mappings.
[in]ConsistAlways show consistent mappings.
Return values:
TRUEThe map should be displayed.
FALSEThe map should not be displayed.

Definition at line 319 of file Map.c.

EFI_STATUS EFIAPI PerformMappingDelete ( IN CONST CHAR16 Specific)

Delete a specific map.

Parameters:
[in]SpecificThe pointer to the name of the map to delete.
Return values:
EFI_INVALID_PARAMETERSpecific was NULL.
EFI_SUCCESSThe operation was successful.
EFI_NOT_FOUNDSpecific could not be found.

Definition at line 770 of file Map.c.

SHELL_STATUS EFIAPI PerformMappingDisplay ( IN CONST BOOLEAN  Verbose,
IN CONST BOOLEAN  Consist,
IN CONST BOOLEAN  Normal,
IN CONST CHAR16 TypeString,
IN CONST BOOLEAN  SFO,
IN CONST CHAR16 *Specific  OPTIONAL,
IN CONST BOOLEAN  Header 
)

Function to display mapping information to the user.

If Specific is specified then Consist and Normal will be ignored since information will be printed for the specific item only.

Parameters:
[in]VerboseTRUE to display (extra) verbose information.
[in]ConsistTRUE to display consistent mappings.
[in]NormalTRUE to display normal (not consist) mappings.
[in]TypeStringPointer to string of filter types.
[in]SFOTRUE to display output in Standard Output Format.
[in]SpecificPointer to string for specific map to display.
[in]HeaderTRUE to print the header block.
Return values:
SHELL_SUCCESSThe display was printed.
SHELL_INVALID_PARAMETEROne of Consist or Normal must be TRUE if no Specific.

Definition at line 539 of file Map.c.

SHELL_STATUS EFIAPI PerformMappingDisplay2 ( IN CONST BOOLEAN  Verbose,
IN CONST BOOLEAN  Consist,
IN CONST BOOLEAN  Normal,
IN CONST CHAR16 TypeString,
IN CONST BOOLEAN  SFO,
IN CONST CHAR16 *Specific  OPTIONAL 
)

Perform a mapping display and parse for multiple types in the TypeString.

Parameters:
[in]VerboseTRUE to use verbose output.
[in]ConsistTRUE to display consistent names.
[in]NormalTRUE to display normal names.
[in]TypeStringAn optional comma-delimited list of types.
[in]SFOTRUE to display in SFO format. See Spec.
[in]SpecificAn optional specific map name to display alone.
Return values:
SHELL_INVALID_PARAMETERA parameter was invalid.
SHELL_SUCCESSThe display was successful.
See also:
PerformMappingDisplay

Definition at line 717 of file Map.c.

EFI_STATUS EFIAPI PerformSingleMappingDelete ( IN CONST CHAR16 Specific,
IN CONST EFI_HANDLE  Handle 
)

Delete Specific from the list of maps for device Handle.

Parameters:
[in]SpecificThe name to delete.
[in]HandleThe device to look on.
Return values:
EFI_SUCCESSThe delete was successful.
EFI_NOT_FOUNDName was not a map on Handle.

Definition at line 488 of file Map.c.

EFI_STATUS EFIAPI PerformSingleMappingDisplay ( IN CONST BOOLEAN  Verbose,
IN CONST BOOLEAN  Consist,
IN CONST BOOLEAN  Normal,
IN CONST CHAR16 TypeString,
IN CONST BOOLEAN  SFO,
IN CONST CHAR16 *Specific  OPTIONAL,
IN CONST EFI_HANDLE  Handle 
)

Display a single map line for device Handle if conditions are met.

Parameters:
[in]VerboseTRUE to display (extra) verbose information.
[in]ConsistTRUE to display consistent mappings.
[in]NormalTRUE to display normal (not consist) mappings.
[in]TypeStringpointer to string of filter types.
[in]SFOTRUE to display output in Standard Output Format.
[in]Specificpointer to string for specific map to display.
[in]HandleThe handle to display from.
Return values:
EFI_SUCCESSThe mapping was displayed.

Definition at line 383 of file Map.c.

BOOLEAN EFIAPI SearchList ( IN CONST CHAR16 List,
IN CONST CHAR16 MetaTarget,
OUT CHAR16 **FullName  OPTIONAL,
IN CONST BOOLEAN  Meta,
IN CONST BOOLEAN  SkipTrailingNumbers,
IN CONST CHAR16 Target 
)

Do a search in the Target delimited list.

Parameters:
[in]ListThe list to seatch in.
[in]MetaTargetThe item to search for. MetaMatching supported.
[out]FullNameOptional pointer to an allocated buffer containing the match.
[in]MetaTRUE to use MetaMatching.
[in]SkipTrailingNumbersTRUE to allow for numbers after the MetaTarget.
[in]TargetThe single character that delimits list items (";" normally).

Definition at line 66 of file Map.c.

SHELL_STATUS EFIAPI ShellCommandRunMap ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'map' command.

Parameters:
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 1017 of file Map.c.

EFI_STATUS EFIAPI UpdateMapping ( VOID  )

Add mappings for any devices without one. Do not change any existing maps.

Return values:
EFI_SUCCESSThe operation was successful.

Definition at line 127 of file Map.c.


Variable Documentation

CONST CHAR16 AnyF[] = "F*"

Definition at line 518 of file Map.c.

CONST CHAR16 Cd[] = "cd*"

Definition at line 515 of file Map.c.

CONST CHAR16 Fp[] = "fp*"

Definition at line 517 of file Map.c.

CONST CHAR16 Hd[] = "hd*"

Definition at line 516 of file Map.c.

Initial value:
 {
  {L"-d", TypeValue},
  {L"-r", TypeFlag},
  {L"-v", TypeFlag},
  {L"-c", TypeFlag},
  {L"-f", TypeFlag},
  {L"-u", TypeFlag},
  {L"-t", TypeValue},
  {L"-sfo", TypeValue},
  {NULL, TypeMax}
  }

Definition at line 997 of file Map.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines