Add some function/header comments.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5039 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2008-04-10 09:23:58 +00:00
parent fb0b259e4e
commit a73d0c743b
3 changed files with 315 additions and 510 deletions

View File

@ -384,6 +384,20 @@ IsValidEfiCntlChar (
IN CHAR16 c IN CHAR16 c
); );
/**
Test to see if this driver supports ControllerHandle. Any ControllerHandle
than contains a VgaMiniPort and PciIo protocol can be supported.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to test
@param RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@retval EFI_SUCCESS This driver supports this device
@retval EFI_ALREADY_STARTED This driver is already running on this device
@retval other This driver does not support this device
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassDriverBindingSupported ( VgaClassDriverBindingSupported (
@ -391,24 +405,6 @@ VgaClassDriverBindingSupported (
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
) )
/*++
Routine Description:
Supported.
Arguments:
(Standard DriverBinding Protocol Supported() function)
Returns:
EFI_STATUS
--*/
// GC_TODO: This - add argument and description to function comment
// GC_TODO: Controller - add argument and description to function comment
// GC_TODO: RemainingDevicePath - add argument and description to function comment
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_VGA_MINI_PORT_PROTOCOL *VgaMiniPort; EFI_VGA_MINI_PORT_PROTOCOL *VgaMiniPort;
@ -445,6 +441,21 @@ VgaClassDriverBindingSupported (
return Status; return Status;
} }
/**
Start this driver on ControllerHandle by opening a PciIo and VgaMiniPort
protocol, creating VGA_CLASS_DEV device and install gEfiSimpleTextOutProtocolGuid
finnally.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to bind driver to
@param RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@retval EFI_SUCCESS This driver is added to ControllerHandle
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
@retval other This driver does not support this device
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassDriverBindingStart ( VgaClassDriverBindingStart (
@ -452,26 +463,6 @@ VgaClassDriverBindingStart (
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
) )
/*++
Routine Description:
Layers the Simple Text Output Protocol on top of the
VGA Mini Port Protocol
Arguments:
(Standard DriverBinding Protocol Start() function)
Returns:
EFI_STATUS
--*/
// GC_TODO: This - add argument and description to function comment
// GC_TODO: Controller - add argument and description to function comment
// GC_TODO: RemainingDevicePath - add argument and description to function comment
// GC_TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_VGA_MINI_PORT_PROTOCOL *VgaMiniPort; EFI_VGA_MINI_PORT_PROTOCOL *VgaMiniPort;
@ -609,6 +600,20 @@ ErrorExit:
} }
/**
Stop this driver on ControllerHandle. Support stoping any child handles
created by this driver.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to stop driver on
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
children is zero stop the entire bus driver.
@param ChildHandleBuffer List of Child Handles to Stop.
@retval EFI_SUCCESS This driver is removed ControllerHandle
@retval other This driver was not removed from this device
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassDriverBindingStop ( VgaClassDriverBindingStop (
@ -617,26 +622,6 @@ VgaClassDriverBindingStop (
IN UINTN NumberOfChildren, IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer IN EFI_HANDLE *ChildHandleBuffer
) )
/*++
Routine Description:
Stop.
Arguments:
(Standard DriverBinding Protocol Stop() function)
Returns:
EFI_STATUS
--*/
// GC_TODO: This - add argument and description to function comment
// GC_TODO: Controller - add argument and description to function comment
// GC_TODO: NumberOfChildren - add argument and description to function comment
// GC_TODO: ChildHandleBuffer - add argument and description to function comment
// GC_TODO: EFI_SUCCESS - add return value to function comment
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut;
@ -694,31 +679,19 @@ VgaClassDriverBindingStop (
return EFI_SUCCESS; return EFI_SUCCESS;
} }
//
// Simple Text Output Protocol Functions /**
// Reset VgaClass device and clear output.
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
@param ExtendedVerification Whether need additional judgement
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassReset ( VgaClassReset (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification IN BOOLEAN ExtendedVerification
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
ExtendedVerification - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
VGA_CLASS_DEV *VgaClassPrivate; VGA_CLASS_DEV *VgaClassPrivate;
@ -741,28 +714,18 @@ Returns:
return This->ClearScreen (This); return This->ClearScreen (This);
} }
/**
Output a string to VgaClass device.
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
@param WString wide chars.
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassOutputString ( VgaClassOutputString (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN CHAR16 *WString IN CHAR16 *WString
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
WString - GC_TODO: add argument description
Returns:
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
VGA_CLASS_DEV *VgaClassDev; VGA_CLASS_DEV *VgaClassDev;
@ -878,29 +841,20 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Detects if a Unicode char is for Box Drawing text graphics.
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
@param WString Unicode chars
@return if a Unicode char is for Box Drawing text graphics.
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassTestString ( VgaClassTestString (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN CHAR16 *WString IN CHAR16 *WString
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
WString - GC_TODO: add argument description
Returns:
EFI_UNSUPPORTED - GC_TODO: Add description for return value
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{ {
while (*WString != 0x0000) { while (*WString != 0x0000) {
if (!(IsValidAscii (*WString) || IsValidEfiCntlChar (*WString) || LibIsValidTextGraphics (*WString, NULL, NULL))) { if (!(IsValidAscii (*WString) || IsValidEfiCntlChar (*WString) || LibIsValidTextGraphics (*WString, NULL, NULL))) {
@ -913,26 +867,19 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Clear Screen via VgaClass device
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
@retval EFI_SUCESS Success to clear screen
@retval Others Wrong displaying mode.
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassClearScreen ( VgaClassClearScreen (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Returns:
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
VGA_CLASS_DEV *VgaClassDev; VGA_CLASS_DEV *VgaClassDev;
@ -968,29 +915,21 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Set displaying mode's attribute
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
@param Attribute Mode's attribute
@param EFI_SUCCESS Success to set attribute
@param EFI_UNSUPPORTED Wrong mode's attribute wanted to be set
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassSetAttribute ( VgaClassSetAttribute (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN Attribute IN UINTN Attribute
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Attribute - GC_TODO: add argument description
Returns:
EFI_SUCCESS - GC_TODO: Add description for return value
EFI_UNSUPPORTED - GC_TODO: Add description for return value
--*/
{ {
if (Attribute <= EFI_MAX_ATTRIBUTE) { if (Attribute <= EFI_MAX_ATTRIBUTE) {
This->Mode->Attribute = (INT32) Attribute; This->Mode->Attribute = (INT32) Attribute;
@ -1000,6 +939,16 @@ Returns:
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
/**
Set cursor position.
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
@param Column Column of new cursor position.
@param Row Row of new cursor position.
@retval EFI_SUCCESS Sucess to set cursor's position.
@retval Others Wrong current displaying mode.
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassSetCursorPosition ( VgaClassSetCursorPosition (
@ -1007,24 +956,6 @@ VgaClassSetCursorPosition (
IN UINTN Column, IN UINTN Column,
IN UINTN Row IN UINTN Row
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Column - GC_TODO: add argument description
Row - GC_TODO: add argument description
Returns:
EFI_UNSUPPORTED - GC_TODO: Add description for return value
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
VGA_CLASS_DEV *VgaClassDev; VGA_CLASS_DEV *VgaClassDev;
@ -1055,28 +986,20 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Enable cursor to display or not.
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
@param Visible Display cursor or not.
@retval EFI_SUCESS Success to display the cursor or not.
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassEnableCursor ( VgaClassEnableCursor (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN BOOLEAN Visible IN BOOLEAN Visible
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Visible - GC_TODO: add argument description
Returns:
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{ {
VGA_CLASS_DEV *VgaClassDev; VGA_CLASS_DEV *VgaClassDev;
@ -1101,6 +1024,20 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Query colum and row according displaying mode number
The mode:
0: 80 * 25
1: 80 * 50
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
@param ModeNumber Mode number
@param Columns return the columen in current mode number
@param Rows return the row in current mode number.
@return EFI_SUCCESS Sucess to get columns and rows according to mode number
@return EFI_UNSUPPORTED Unsupported mode number
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassQueryMode ( VgaClassQueryMode (
@ -1109,26 +1046,6 @@ VgaClassQueryMode (
OUT UINTN *Columns, OUT UINTN *Columns,
OUT UINTN *Rows OUT UINTN *Rows
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
ModeNumber - GC_TODO: add argument description
Columns - GC_TODO: add argument description
Rows - GC_TODO: add argument description
Returns:
EFI_UNSUPPORTED - GC_TODO: Add description for return value
EFI_UNSUPPORTED - GC_TODO: Add description for return value
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{ {
if ((INT32) ModeNumber >= This->Mode->MaxMode) { if ((INT32) ModeNumber >= This->Mode->MaxMode) {
*Columns = 0; *Columns = 0;
@ -1156,28 +1073,21 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Set displaying mode number
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
@param ModeNumber mode number
@retval EFI_UNSUPPORTED Unsupported mode number in parameter
@retval EFI_SUCCESS Success to set the mode number.
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
VgaClassSetMode ( VgaClassSetMode (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN ModeNumber IN UINTN ModeNumber
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
ModeNumber - GC_TODO: add argument description
Returns:
EFI_UNSUPPORTED - GC_TODO: Add description for return value
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
VGA_CLASS_DEV *VgaClassDev; VGA_CLASS_DEV *VgaClassDev;
@ -1196,9 +1106,16 @@ Returns:
return Status; return Status;
} }
//
// Private Worker Functions /**
// Set logic cursor's position to VgaClass device
@param VgaClassDev device instance object
@param Column cursor logic position.
@param Row cursor logic position.
@param MaxColumn max logic column
**/
STATIC STATIC
VOID VOID
SetVideoCursorPosition ( SetVideoCursorPosition (
@ -1207,24 +1124,6 @@ SetVideoCursorPosition (
IN UINTN Row, IN UINTN Row,
IN UINTN MaxColumn IN UINTN MaxColumn
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
VgaClassDev - GC_TODO: add argument description
Column - GC_TODO: add argument description
Row - GC_TODO: add argument description
MaxColumn - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
{ {
Column = Column & 0xff; Column = Column & 0xff;
Row = Row & 0xff; Row = Row & 0xff;
@ -1241,6 +1140,13 @@ Returns:
); );
} }
/**
Program CRTC register via PCI IO.
@param VgaClassDev device instance object
@param Address address
@param Data data
**/
STATIC STATIC
VOID VOID
WriteCrtc ( WriteCrtc (
@ -1248,23 +1154,6 @@ WriteCrtc (
IN UINT16 Address, IN UINT16 Address,
IN UINT8 Data IN UINT8 Data
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
VgaClassDev - GC_TODO: add argument description
Address - GC_TODO: add argument description
Data - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
{ {
VgaClassDev->PciIo->Io.Write ( VgaClassDev->PciIo->Io.Write (
VgaClassDev->PciIo, VgaClassDev->PciIo,
@ -1285,6 +1174,16 @@ Returns:
); );
} }
/**
Detects if a Unicode char is for Box Drawing text graphics.
@param Grphic Unicode char to test.
@param PcAnsi Optional pointer to return PCANSI equivalent of Graphic.
@param Asci Optional pointer to return Ascii equivalent of Graphic.
@return TRUE if Gpaphic is a supported Unicode Box Drawing character.
**/
STATIC STATIC
BOOLEAN BOOLEAN
LibIsValidTextGraphics ( LibIsValidTextGraphics (
@ -1292,26 +1191,6 @@ LibIsValidTextGraphics (
OUT CHAR8 *PcAnsi, OPTIONAL OUT CHAR8 *PcAnsi, OPTIONAL
OUT CHAR8 *Ascii OPTIONAL OUT CHAR8 *Ascii OPTIONAL
) )
/*++
Routine Description:
Detects if a Unicode char is for Box Drawing text graphics.
Arguments:
Grphic - Unicode char to test.
PcAnsi - Optional pointer to return PCANSI equivalent of Graphic.
Asci - Optional pointer to return Ascii equivalent of Graphic.
Returns:
TRUE if Gpaphic is a supported Unicode Box Drawing character.
--*/
// GC_TODO: Graphic - add argument and description to function comment
{ {
UNICODE_TO_CHAR *Table; UNICODE_TO_CHAR *Table;
@ -1340,26 +1219,17 @@ Returns:
return FALSE; return FALSE;
} }
/**
Judge whether is an ASCII char.
@param Ascii character
@return whether is an ASCII char.
**/
STATIC STATIC
BOOLEAN BOOLEAN
IsValidAscii ( IsValidAscii (
IN CHAR16 Ascii IN CHAR16 Ascii
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
Ascii - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
{ {
if ((Ascii >= 0x20) && (Ascii <= 0x7f)) { if ((Ascii >= 0x20) && (Ascii <= 0x7f)) {
return TRUE; return TRUE;
@ -1368,26 +1238,17 @@ Returns:
return FALSE; return FALSE;
} }
/**
Judge whether is diplaying control character.
@param c character
@return whether is diplaying control character.
**/
STATIC STATIC
BOOLEAN BOOLEAN
IsValidEfiCntlChar ( IsValidEfiCntlChar (
IN CHAR16 c IN CHAR16 c
) )
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
c - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
{ {
if (c == CHAR_NULL || c == CHAR_BACKSPACE || c == CHAR_LINEFEED || c == CHAR_CARRIAGE_RETURN) { if (c == CHAR_NULL || c == CHAR_BACKSPACE || c == CHAR_LINEFEED || c == CHAR_CARRIAGE_RETURN) {
return TRUE; return TRUE;
@ -1395,3 +1256,4 @@ Returns:
return FALSE; return FALSE;
} }

View File

@ -44,6 +44,21 @@ GetNextDataRecord (
IN OUT UINT64 *PtrCurrentMTC IN OUT UINT64 *PtrCurrentMTC
); );
/**
Log data record into the data logging hub
@param This - Protocol instance structure
@param DataRecordGuid - GUID that defines record contents
@param ProducerName - GUID that defines the name of the producer of the data
@param DataRecordClass - Class that defines generic record type
@param RawData - Data Log record as defined by DataRecordGuid
@param RawDataSize - Size of Data Log data in bytes
@retval EFI_SUCCESS - If data was logged
@retval EFI_OUT_OF_RESOURCES - If data was not logged due to lack of system
resources.
**/
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -55,33 +70,6 @@ DataHubLogData (
IN VOID *RawData, IN VOID *RawData,
IN UINT32 RawDataSize IN UINT32 RawDataSize
) )
/*++
Routine Description:
Log data record into the data logging hub
Arguments:
This - Protocol instance structure
DataRecordGuid - GUID that defines record contents
ProducerName - GUID that defines the name of the producer of the data
DataRecordClass - Class that defines generic record type
RawData - Data Log record as defined by DataRecordGuid
RawDataSize - Size of Data Log data in bytes
Returns:
EFI_SUCCESS - If data was logged
EFI_OUT_OF_RESOURCES - If data was not logged due to lack of system
resources.
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
DATA_HUB_INSTANCE *Private; DATA_HUB_INSTANCE *Private;
@ -176,6 +164,35 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Get a previously logged data record and the MonotonicCount for the next
availible Record. This allows all records or all records later
than a give MonotonicCount to be returned. If an optional FilterDriverEvent
is passed in with a MonotonicCout of zero return the first record
not yet read by the filter driver. If FilterDriverEvent is NULL and
MonotonicCount is zero return the first data record.
@param This The EFI_DATA_HUB_PROTOCOL instance.
@param MonotonicCount Specifies the Record to return. On input, zero means
return the first record. On output, contains the next
record to availible. Zero indicates no more records.
@param FilterDriverEvent If FilterDriverEvent is not passed in a MonotonicCount
of zero, it means to return the first data record.
If FilterDriverEvent is passed in, then a MonotonicCount
of zero means to return the first data not yet read by
FilterDriverEvent.
@param Record Returns a dynamically allocated memory buffer with a data
record that matches MonotonicCount.
@retval EFI_SUCCESS - Data was returned in Record.
@retval EFI_INVALID_PARAMETER - FilterDriverEvent was passed in but does not exist.
@retval EFI_NOT_FOUND - MonotonicCount does not match any data record in the
system. If a MonotonicCount of zero was passed in, then
no data records exist in the system.
@retval EFI_OUT_OF_RESOURCES - Record was not returned due to lack of system resources.
**/
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -185,41 +202,6 @@ DataHubGetNextRecord (
IN EFI_EVENT *FilterDriverEvent, OPTIONAL IN EFI_EVENT *FilterDriverEvent, OPTIONAL
OUT EFI_DATA_RECORD_HEADER **Record OUT EFI_DATA_RECORD_HEADER **Record
) )
/*++
Routine Description:
Get a previously logged data record and the MonotonicCount for the next
availible Record. This allows all records or all records later
than a give MonotonicCount to be returned. If an optional FilterDriverEvent
is passed in with a MonotonicCout of zero return the first record
not yet read by the filter driver. If FilterDriverEvent is NULL and
MonotonicCount is zero return the first data record.
Arguments:
This - The EFI_DATA_HUB_PROTOCOL instance.
MonotonicCount - Specifies the Record to return. On input, zero means
return the first record. On output, contains the next
record to availible. Zero indicates no more records.
FilterDriverEvent - If FilterDriverEvent is not passed in a MonotonicCount
of zero, it means to return the first data record.
If FilterDriverEvent is passed in, then a MonotonicCount
of zero means to return the first data not yet read by
FilterDriverEvent.
Record - Returns a dynamically allocated memory buffer with a data
record that matches MonotonicCount.
Returns:
EFI_SUCCESS - Data was returned in Record.
EFI_INVALID_PARAMETER - FilterDriverEvent was passed in but does not exist.
EFI_NOT_FOUND - MonotonicCount does not match any data record in the
system. If a MonotonicCount of zero was passed in, then
no data records exist in the system.
EFI_OUT_OF_RESOURCES - Record was not returned due to lack of system resources.
--*/
{ {
DATA_HUB_INSTANCE *Private; DATA_HUB_INSTANCE *Private;
DATA_HUB_FILTER_DRIVER *FilterDriver; DATA_HUB_FILTER_DRIVER *FilterDriver;
@ -303,6 +285,35 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
This function registers the data hub filter driver that is represented
by FilterEvent. Only one instance of each FilterEvent can be registered.
After the FilterEvent is registered, it will be signaled so it can sync
with data records that have been recorded prior to the FilterEvent being
registered.
@param This - The EFI_DATA_HUB_PROTOCOL instance.
@param FilterEvent - The EFI_EVENT to signal whenever data that matches
FilterClass is logged in the system.
@param FilterTpl - The maximum EFI_TPL at which FilterEvent can be
signaled. It is strongly recommended that you use the
lowest EFI_TPL possible.
@param FilterClass - FilterEvent will be signaled whenever a bit in
EFI_DATA_RECORD_HEADER.DataRecordClass is also set in
FilterClass. If FilterClass is zero, no class-based
filtering will be performed.
@param FilterDataRecordGuid - FilterEvent will be signaled whenever FilterDataRecordGuid
matches EFI_DATA_RECORD_HEADER.DataRecordGuid. If
FilterDataRecordGuid is NULL, then no GUID-based filtering
will be performed.
@retval EFI_SUCCESS - The filter driver event was registered.
@retval EFI_ALREADY_STARTED - FilterEvent was previously registered and cannot be
registered again.
@retval EFI_OUT_OF_RESOURCES - The filter driver event was not registered due to lack of
system resources.
**/
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -313,41 +324,7 @@ DataHubRegisterFilterDriver (
IN UINT64 FilterClass, IN UINT64 FilterClass,
IN EFI_GUID * FilterDataRecordGuid OPTIONAL IN EFI_GUID * FilterDataRecordGuid OPTIONAL
) )
/*++
Routine Description:
This function registers the data hub filter driver that is represented
by FilterEvent. Only one instance of each FilterEvent can be registered.
After the FilterEvent is registered, it will be signaled so it can sync
with data records that have been recorded prior to the FilterEvent being
registered.
Arguments:
This - The EFI_DATA_HUB_PROTOCOL instance.
FilterEvent - The EFI_EVENT to signal whenever data that matches
FilterClass is logged in the system.
FilterTpl - The maximum EFI_TPL at which FilterEvent can be
signaled. It is strongly recommended that you use the
lowest EFI_TPL possible.
FilterClass - FilterEvent will be signaled whenever a bit in
EFI_DATA_RECORD_HEADER.DataRecordClass is also set in
FilterClass. If FilterClass is zero, no class-based
filtering will be performed.
FilterDataRecordGuid - FilterEvent will be signaled whenever FilterDataRecordGuid
matches EFI_DATA_RECORD_HEADER.DataRecordGuid. If
FilterDataRecordGuid is NULL, then no GUID-based filtering
will be performed.
Returns:
EFI_SUCCESS - The filter driver event was registered.
EFI_ALREADY_STARTED - FilterEvent was previously registered and cannot be
registered again.
EFI_OUT_OF_RESOURCES - The filter driver event was not registered due to lack of
system resources.
--*/
{ {
DATA_HUB_INSTANCE *Private; DATA_HUB_INSTANCE *Private;
DATA_HUB_FILTER_DRIVER *FilterDriver; DATA_HUB_FILTER_DRIVER *FilterDriver;
@ -402,6 +379,20 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Remove a Filter Driver, so it no longer gets called when data
information is logged.
@param This - Protocol instance structure
@param FilterEvent - Event that represents a filter driver that is to be
Unregistered.
@retval EFI_SUCCESS - If FilterEvent was unregistered
@retval EFI_NOT_FOUND - If FilterEvent does not exist
**/
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -409,27 +400,6 @@ DataHubUnregisterFilterDriver (
IN EFI_DATA_HUB_PROTOCOL *This, IN EFI_DATA_HUB_PROTOCOL *This,
IN EFI_EVENT FilterEvent IN EFI_EVENT FilterEvent
) )
/*++
Routine Description:
Remove a Filter Driver, so it no longer gets called when data
information is logged.
Arguments:
This - Protocol instance structure
FilterEvent - Event that represents a filter driver that is to be
Unregistered.
Returns:
EFI_SUCCESS - If FilterEvent was unregistered
EFI_NOT_FOUND - If FilterEvent does not exist
--*/
{ {
DATA_HUB_INSTANCE *Private; DATA_HUB_INSTANCE *Private;
DATA_HUB_FILTER_DRIVER *FilterDriver; DATA_HUB_FILTER_DRIVER *FilterDriver;
@ -455,36 +425,29 @@ Returns:
return EFI_SUCCESS; return EFI_SUCCESS;
} }
//
// STATIC Worker fucntions follow /**
// Search the Head list for a EFI_DATA_HUB_FILTER_DRIVER member that
represents Event and return it.
@param Head - Head of dual linked list of EFI_DATA_HUB_FILTER_DRIVER
structures.
@param Event - Event to be search for in the Head list.
@retval EFI_DATA_HUB_FILTER_DRIVER - Returned if Event stored in the
Head doubly linked list.
@retval NULL - If Event is not in the list
**/
STATIC STATIC
DATA_HUB_FILTER_DRIVER * DATA_HUB_FILTER_DRIVER *
FindFilterDriverByEvent ( FindFilterDriverByEvent (
IN LIST_ENTRY *Head, IN LIST_ENTRY *Head,
IN EFI_EVENT Event IN EFI_EVENT Event
) )
/*++
Routine Description:
Search the Head list for a EFI_DATA_HUB_FILTER_DRIVER member that
represents Event and return it.
Arguments:
Head - Head of dual linked list of EFI_DATA_HUB_FILTER_DRIVER
structures.
Event - Event to be search for in the Head list.
Returns:
EFI_DATA_HUB_FILTER_DRIVER - Returned if Event stored in the
Head doubly linked list.
NULL - If Event is not in the list
--*/
{ {
DATA_HUB_FILTER_DRIVER *FilterEntry; DATA_HUB_FILTER_DRIVER *FilterEntry;
LIST_ENTRY *Link; LIST_ENTRY *Link;
@ -499,6 +462,23 @@ Returns:
return NULL; return NULL;
} }
/**
Search the Head doubly linked list for the passed in MTC. Return the
matching element in Head and the MTC on the next entry.
@param Head - Head of Data Log linked list.
@param ClassFilter - Only match the MTC if it is in the same Class as the
ClassFilter.
@param PtrCurrentMTC - On IN contians MTC to search for. On OUT contians next
MTC in the data log list or zero if at end of the list.
@retval EFI_DATA_LOG_ENTRY - Return pointer to data log data from Head list.
@retval NULL - If no data record exists.
**/
STATIC STATIC
EFI_DATA_RECORD_HEADER * EFI_DATA_RECORD_HEADER *
GetNextDataRecord ( GetNextDataRecord (
@ -506,29 +486,7 @@ GetNextDataRecord (
IN UINT64 ClassFilter, IN UINT64 ClassFilter,
IN OUT UINT64 *PtrCurrentMTC IN OUT UINT64 *PtrCurrentMTC
) )
/*++
Routine Description:
Search the Head doubly linked list for the passed in MTC. Return the
matching element in Head and the MTC on the next entry.
Arguments:
Head - Head of Data Log linked list.
ClassFilter - Only match the MTC if it is in the same Class as the
ClassFilter.
PtrCurrentMTC - On IN contians MTC to search for. On OUT contians next
MTC in the data log list or zero if at end of the list.
Returns:
EFI_DATA_LOG_ENTRY - Return pointer to data log data from Head list.
NULL - If no data record exists.
--*/
{ {
EFI_DATA_ENTRY *LogEntry; EFI_DATA_ENTRY *LogEntry;
LIST_ENTRY *Link; LIST_ENTRY *Link;
@ -588,27 +546,25 @@ Returns:
// //
DATA_HUB_INSTANCE mPrivateData; DATA_HUB_INSTANCE mPrivateData;
/**
Install Driver to produce Data Hub protocol.
@param ImageHandle Module's image handle
@param SystemTable Pointer of EFI_SYSTEM_TABLE
@retval EFI_SUCCESS - Logging Hub protocol installed
@retval Other - No protocol installed, unload driver.
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
DataHubInstall ( DataHubInstall (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
) )
/*++
Routine Description:
Install Driver to produce Data Hub protocol.
Arguments:
(Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
Returns:
EFI_SUCCESS - Logging Hub protocol installed
Other - No protocol installed, unload driver.
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
UINT32 HighMontonicCount; UINT32 HighMontonicCount;
@ -652,3 +608,4 @@ Returns:
); );
return Status; return Status;
} }

View File

@ -31,6 +31,13 @@ EFI_DATA_HUB_PROTOCOL *mDataHub = NULL;
EFI_EVENT mDataHubStdErrEvent; EFI_EVENT mDataHubStdErrEvent;
/**
Event handler registered with the Data Hub to parse EFI_DEBUG_CODE. This
handler reads the Data Hub and sends any DEBUG info to StdErr.
@param Event - The event that occured, not used
@param Context - DataHub Protocol Pointer
**/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -38,20 +45,6 @@ DataHubStdErrEventHandler (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN VOID *Context IN VOID *Context
) )
/*++
Routine Description:
Event handler registered with the Data Hub to parse EFI_DEBUG_CODE. This
handler reads the Data Hub and sends any DEBUG info to StdErr.
Arguments:
Event - The event that occured, not used
Context - DataHub Protocol Pointer
Returns:
None.
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_DATA_HUB_PROTOCOL *DataHub; EFI_DATA_HUB_PROTOCOL *DataHub;
@ -103,31 +96,23 @@ Returns:
} while ((Mtc != 0) && !EFI_ERROR (Status)); } while ((Mtc != 0) && !EFI_ERROR (Status));
} }
/**
Register an event handler with the Data Hub to parse EFI_DEBUG_CODE. This
handler reads the Data Hub and sends any DEBUG info to StdErr.
@param ImageHandle - Image handle of this driver.
@param SystemTable - Pointer to EFI system table.
@retval EFI_SUCCESS - The event handler was registered.
@retval EFI_OUT_OF_RESOURCES - The event hadler was not registered due to lack of
system resources.
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
DataHubStdErrInitialize ( DataHubStdErrInitialize (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
) )
/*++
Routine Description:
Register an event handler with the Data Hub to parse EFI_DEBUG_CODE. This
handler reads the Data Hub and sends any DEBUG info to StdErr.
Arguments:
ImageHandle - Image handle of this driver.
SystemTable - Pointer to EFI system table.
Returns:
EFI_SUCCESS - The event handler was registered.
EFI_OUT_OF_RESOURCES - The event hadler was not registered due to lack of
system resources.
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
UINT64 DataClass; UINT64 DataClass;
@ -166,3 +151,4 @@ Returns:
return Status; return Status;
} }