TianoCore EDK2 master
Loading...
Searching...
No Matches
Misc.c File Reference
#include "Fat.h"

Go to the source code of this file.

Functions

FAT_TASKFatCreateTask (FAT_IFILE *IFile, EFI_FILE_IO_TOKEN *Token)
 
VOID FatDestroyTask (FAT_TASK *Task)
 
VOID FatWaitNonblockingTask (FAT_IFILE *IFile)
 
LIST_ENTRYFatDestroySubtask (FAT_SUBTASK *Subtask)
 
EFI_STATUS FatQueueTask (IN FAT_IFILE *IFile, IN FAT_TASK *Task)
 
EFI_STATUS FatAccessVolumeDirty (IN FAT_VOLUME *Volume, IN IO_MODE IoMode, IN VOID *DirtyValue)
 
VOID EFIAPI FatOnAccessComplete (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS FatDiskIo (IN FAT_VOLUME *Volume, IN IO_MODE IoMode, IN UINT64 Offset, IN UINTN BufferSize, IN OUT VOID *Buffer, IN FAT_TASK *Task)
 
VOID FatAcquireLock (VOID)
 
EFI_STATUS FatAcquireLockOrFail (VOID)
 
VOID FatReleaseLock (VOID)
 
VOID FatFreeDirEnt (IN FAT_DIRENT *DirEnt)
 
VOID FatFreeVolume (IN FAT_VOLUME *Volume)
 
VOID FatEfiTimeToFatTime (IN EFI_TIME *ETime, OUT FAT_DATE_TIME *FTime)
 
VOID FatFatTimeToEfiTime (IN FAT_DATE_TIME *FTime, OUT EFI_TIME *ETime)
 
VOID FatGetCurrentFatTime (OUT FAT_DATE_TIME *FatNow)
 
BOOLEAN FatIsValidTime (IN EFI_TIME *Time)
 

Variables

UINT8 mMonthDays [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
 

Detailed Description

Miscellaneous functions.

Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Misc.c.

Function Documentation

◆ FatAccessVolumeDirty()

EFI_STATUS FatAccessVolumeDirty ( IN FAT_VOLUME Volume,
IN IO_MODE  IoMode,
IN VOID *  DirtyValue 
)

Set the volume as dirty or not.

Parameters
Volume- FAT file system volume.
IoMode- The access mode.
DirtyValue- Set the volume as dirty or not.
Return values
EFI_SUCCESS- Set the new FAT entry value successfully.
Returns
other - An error occurred when operation the FAT entries.

Definition at line 230 of file Misc.c.

◆ FatAcquireLock()

VOID FatAcquireLock ( VOID  )

Lock the volume.

Definition at line 395 of file Misc.c.

◆ FatAcquireLockOrFail()

EFI_STATUS FatAcquireLockOrFail ( VOID  )

Lock the volume. If the lock is already in the acquired state, then EFI_ACCESS_DENIED is returned. Otherwise, EFI_SUCCESS is returned.

Return values
EFI_SUCCESS- The volume is locked.
EFI_ACCESS_DENIED- The volume could not be locked because it is already locked.

Definition at line 413 of file Misc.c.

◆ FatCreateTask()

FAT_TASK * FatCreateTask ( FAT_IFILE IFile,
EFI_FILE_IO_TOKEN Token 
)

Create the task

Parameters
IFile- The instance of the open file.
Token- A pointer to the token associated with the transaction.
Returns
FAT_TASK * - Return the task instance.

Definition at line 24 of file Misc.c.

◆ FatDestroySubtask()

LIST_ENTRY * FatDestroySubtask ( FAT_SUBTASK Subtask)

Remove the subtask from subtask list.

Parameters
Subtask- The subtask to be removed.
Returns
LIST_ENTRY * - The next node in the list.

Definition at line 98 of file Misc.c.

◆ FatDestroyTask()

VOID FatDestroyTask ( FAT_TASK Task)

Destroy the task.

Parameters
Task- The task to be destroyed.

Definition at line 51 of file Misc.c.

◆ FatDiskIo()

EFI_STATUS FatDiskIo ( IN FAT_VOLUME Volume,
IN IO_MODE  IoMode,
IN UINT64  Offset,
IN UINTN  BufferSize,
IN OUT VOID *  Buffer,
IN FAT_TASK Task 
)

General disk access function.

Parameters
Volume- FAT file system volume.
IoMode- The access mode (disk read/write or cache access).
Offset- The starting byte offset to read from.
BufferSize- Size of Buffer.
Buffer- Buffer containing read data.
Taskpoint to task instance.
Return values
EFI_SUCCESS- The operation is performed successfully.
EFI_VOLUME_CORRUPTED- The access is
Returns
Others - The status of read/write the disk

Definition at line 315 of file Misc.c.

◆ FatEfiTimeToFatTime()

VOID FatEfiTimeToFatTime ( IN EFI_TIME ETime,
OUT FAT_DATE_TIME FTime 
)

Translate EFI time to FAT time.

Parameters
ETime- The time of EFI_TIME.
FTime- The time of FAT_DATE_TIME.

Definition at line 487 of file Misc.c.

◆ FatFatTimeToEfiTime()

VOID FatFatTimeToEfiTime ( IN FAT_DATE_TIME FTime,
OUT EFI_TIME ETime 
)

Translate Fat time to EFI time.

Parameters
FTime- The time of FAT_DATE_TIME.
ETime- The time of EFI_TIME..

Definition at line 519 of file Misc.c.

◆ FatFreeDirEnt()

VOID FatFreeDirEnt ( IN FAT_DIRENT DirEnt)

Free directory entry.

Parameters
DirEnt- The directory entry to be freed.

Definition at line 441 of file Misc.c.

◆ FatFreeVolume()

VOID FatFreeVolume ( IN FAT_VOLUME Volume)

Free volume structure (including the contents of directory cache and disk cache).

Parameters
Volume- The volume structure to be freed.

Definition at line 460 of file Misc.c.

◆ FatGetCurrentFatTime()

VOID FatGetCurrentFatTime ( OUT FAT_DATE_TIME FatNow)

Get Current FAT time.

Parameters
FatNow- Current FAT time.

Definition at line 543 of file Misc.c.

◆ FatIsValidTime()

BOOLEAN FatIsValidTime ( IN EFI_TIME Time)

Check whether a time is valid.

Parameters
Time- The time of EFI_TIME.
Return values
TRUE- The time is valid.
FALSE- The time is not valid.

Definition at line 573 of file Misc.c.

◆ FatOnAccessComplete()

VOID EFIAPI FatOnAccessComplete ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Invoke a notification event.

Parameters
EventEvent whose notification function is being invoked.
ContextThe pointer to the notification function's context, which is implementation-dependent.

Definition at line 252 of file Misc.c.

◆ FatQueueTask()

EFI_STATUS FatQueueTask ( IN FAT_IFILE IFile,
IN FAT_TASK Task 
)

Execute the task.

Parameters
IFile- The instance of the open file.
Task- The task to be executed.
Return values
EFI_SUCCESS- The task was executed successfully.
Returns
other - An error occurred when executing the task.

Definition at line 124 of file Misc.c.

◆ FatReleaseLock()

VOID FatReleaseLock ( VOID  )

Unlock the volume.

Definition at line 426 of file Misc.c.

◆ FatWaitNonblockingTask()

VOID FatWaitNonblockingTask ( FAT_IFILE IFile)

Wait all non-blocking requests complete.

Parameters
IFile- The instance of the open file.

Definition at line 75 of file Misc.c.

Variable Documentation

◆ mMonthDays

UINT8 mMonthDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }

Definition at line 11 of file Misc.c.