TianoCore EDK2 master
Loading...
Searching...
No Matches
FatLiteLib.c File Reference
#include "FatLitePeim.h"

Go to the source code of this file.

Macros

#define CHAR_FAT_VALID   0x01
 

Functions

CHAR16 ToUpper (IN CHAR16 Letter)
 
EFI_STATUS FatReadBlock (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN UINTN BlockDeviceNo, IN EFI_PEI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)
 
EFI_STATUS FatGetCacheBlock (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN UINTN BlockDeviceNo, IN UINT64 Lba, OUT CHAR8 **CachePtr)
 
EFI_STATUS FatReadDisk (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN UINTN BlockDeviceNo, IN UINT64 StartingAddress, IN UINTN Size, OUT VOID *Buffer)
 
VOID EngFatToStr (IN UINTN FatSize, IN CHAR8 *Fat, OUT CHAR16 *Str)
 
BOOLEAN EngStriColl (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN CHAR16 *Str1, IN CHAR16 *Str2)
 

Detailed Description

General purpose supporting routines for FAT recovery PEIM

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.

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

Definition in file FatLiteLib.c.

Macro Definition Documentation

◆ CHAR_FAT_VALID

#define CHAR_FAT_VALID   0x01

Definition at line 12 of file FatLiteLib.c.

Function Documentation

◆ EngFatToStr()

VOID EngFatToStr ( IN UINTN  FatSize,
IN CHAR8 *  Fat,
OUT CHAR16 *  Str 
)

This version is different from the version in Unicode collation protocol in that this version strips off trailing blanks. Converts an 8.3 FAT file name using an OEM character set to a Null-terminated Unicode string. Here does not expand DBCS FAT chars.

Parameters
FatSizeThe size of the string Fat in bytes.
FatA pointer to a Null-terminated string that contains an 8.3 file name using an OEM character set.
StrA pointer to a Null-terminated Unicode string. The string must be allocated in advance to hold FatSize Unicode characters

Definition at line 307 of file FatLiteLib.c.

◆ EngStriColl()

BOOLEAN EngStriColl ( IN PEI_FAT_PRIVATE_DATA PrivateData,
IN CHAR16 *  Str1,
IN CHAR16 *  Str2 
)

Performs a case-insensitive comparison of two Null-terminated Unicode strings.

Parameters
PrivateDataGlobal memory map for accessing global variables
Str1First string to perform case insensitive comparison.
Str2Second string to perform case insensitive comparison.

Definition at line 342 of file FatLiteLib.c.

◆ FatGetCacheBlock()

EFI_STATUS FatGetCacheBlock ( IN PEI_FAT_PRIVATE_DATA PrivateData,
IN UINTN  BlockDeviceNo,
IN UINT64  Lba,
OUT CHAR8 **  CachePtr 
)

Find a cache block designated to specific Block device and Lba. If not found, invalidate an oldest one and use it. (LRU cache)

Parameters
PrivateDatathe global memory map.
BlockDeviceNothe Block device.
Lbathe Logical Block Address
CachePtrPtr to the starting address of the memory holding the data;
Return values
EFI_SUCCESSThe function completed successfully.
EFI_DEVICE_ERRORSomething error while accessing media.

Definition at line 128 of file FatLiteLib.c.

◆ FatReadBlock()

EFI_STATUS FatReadBlock ( IN PEI_FAT_PRIVATE_DATA PrivateData,
IN UINTN  BlockDeviceNo,
IN EFI_PEI_LBA  Lba,
IN UINTN  BufferSize,
OUT VOID *  Buffer 
)

Reads a block of data from the block device by calling underlying Block I/O service.

Parameters
PrivateDataGlobal memory map for accessing global variables
BlockDeviceNoThe index for the block device number.
LbaThe logic block address to read data from.
BufferSizeThe size of data in byte to read.
BufferThe buffer of the
Return values
EFI_DEVICE_ERRORThe specified block device number exceeds the maximum device number.
EFI_DEVICE_ERRORThe maximum address has exceeded the maximum address of the block device.

Definition at line 54 of file FatLiteLib.c.

◆ FatReadDisk()

EFI_STATUS FatReadDisk ( IN PEI_FAT_PRIVATE_DATA PrivateData,
IN UINTN  BlockDeviceNo,
IN UINT64  StartingAddress,
IN UINTN  Size,
OUT VOID *  Buffer 
)

Disk reading.

Parameters
PrivateDatathe global memory map;
BlockDeviceNothe block device to read;
StartingAddressthe starting address.
Sizethe amount of data to read.
Bufferthe buffer holding the data
Return values
EFI_SUCCESSThe function completed successfully.
EFI_DEVICE_ERRORSomething error.

Definition at line 221 of file FatLiteLib.c.

◆ ToUpper()

CHAR16 ToUpper ( IN CHAR16  Letter)

Converts a union code character to upper case. This functions converts a unicode character to upper case. If the input Letter is not a lower-cased letter, the original value is returned.

Parameters
LetterThe input unicode character.
Returns
The upper cased letter.

Definition at line 26 of file FatLiteLib.c.