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

Go to the source code of this file.

Data Structures

struct  FILE_BUFFER
 

Enumerations

enum  READ_STATUS { OutOfDiffPoint , InDiffPoint , InPrevDiffPoint }
 

Functions

VOID PrintDifferentPoint (CONST CHAR16 *FileName, CHAR16 *FileTag, UINT8 *Buffer, UINT64 BufferSize, UINTN Address, UINT64 DifferentBytes)
 
STATIC VOID FileBufferInit (OUT FILE_BUFFER *FileBuffer)
 
STATIC VOID FileBufferUninit (IN OUT FILE_BUFFER *FileBuffer)
 
STATIC EFI_STATUS FileBufferReadByte (IN SHELL_FILE_HANDLE FileHandle, IN OUT FILE_BUFFER *FileBuffer, OUT UINTN *BytesRead, OUT UINT8 *Byte)
 
SHELL_STATUS EFIAPI ShellCommandRunComp (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST SHELL_PARAM_ITEM ParamList []
 

Detailed Description

Main file for Comp shell Debug1 function.

(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Comp.c.

Enumeration Type Documentation

◆ READ_STATUS

enum READ_STATUS

Definition at line 18 of file Comp.c.

Function Documentation

◆ FileBufferInit()

STATIC VOID FileBufferInit ( OUT FILE_BUFFER FileBuffer)

Initialize a FILE_BUFFER.

Parameters
[out]FileBufferThe FILE_BUFFER to initialize. On return, the caller is responsible for checking FileBuffer->Data: if FileBuffer->Data is NULL on output, then memory allocation failed.

Definition at line 99 of file Comp.c.

◆ FileBufferReadByte()

STATIC EFI_STATUS FileBufferReadByte ( IN SHELL_FILE_HANDLE  FileHandle,
IN OUT FILE_BUFFER FileBuffer,
OUT UINTN BytesRead,
OUT UINT8 *  Byte 
)

Read a byte from a SHELL_FILE_HANDLE, buffered with a FILE_BUFFER.

Parameters
[in]FileHandleThe SHELL_FILE_HANDLE to replenish FileBuffer from, if needed.
[in,out]FileBufferThe FILE_BUFFER to read a byte from. If FileBuffer is empty on entry, then FileBuffer is refilled from FileHandle, before outputting a byte from FileBuffer to Byte. The caller is responsible for ensuring that FileBuffer was successfully initialized with FileBufferInit().
[out]BytesReadOn successful return, BytesRead is set to 1 if the next byte from FileBuffer has been stored to Byte. On successful return, BytesRead is set to 0 if FileBuffer is empty, and FileHandle is at EOF. When an error is returned, BytesRead is not set.
[out]ByteOn output, the next byte from FileBuffer. Only set if (a) EFI_SUCCESS is returned and (b) BytesRead is set to 1 on output.
Return values
EFI_SUCCESSBytesRead has been set to 0 or 1. In the latter case, Byte has been set as well.
Returns
Error codes propagated from gEfiShellProtocol->ReadFile().

Definition at line 156 of file Comp.c.

◆ FileBufferUninit()

STATIC VOID FileBufferUninit ( IN OUT FILE_BUFFER FileBuffer)

Uninitialize a FILE_BUFFER.

Parameters
[in,out]FileBufferThe FILE_BUFFER to uninitialize. The caller is responsible for making sure FileBuffer was first initialized with FileBufferInit(), successfully or unsuccessfully.

Definition at line 118 of file Comp.c.

◆ PrintDifferentPoint()

VOID PrintDifferentPoint ( CONST CHAR16 *  FileName,
CHAR16 *  FileTag,
UINT8 *  Buffer,
UINT64  BufferSize,
UINTN  Address,
UINT64  DifferentBytes 
)

Function to print differnt point data.

Parameters
[in]FileNameFile name.
[in]FileTagFile tag name.
[in]BufferData buffer to be printed.
[in]BufferSizeSize of the data to be printed.
[in]AddressAddress of the differnt point.
[in]DifferentBytesTotal size of the buffer.

Definition at line 46 of file Comp.c.

◆ ShellCommandRunComp()

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

Function for 'comp' command.

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

Definition at line 202 of file Comp.c.

Variable Documentation

◆ ParamList

Initial value:
= {
{ L"-n", TypeValue },
{ L"-s", TypeValue },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700

Definition at line 12 of file Comp.c.