American Megatrends, Inc.

HardwareSignatureManagement

Copyright

Release Notes

© American Megatrends, Inc.


Copyright

American Megatrends, Inc.
5555 Oakbrook Parkway
Suite 200
Norcross, GA 30093 (USA)

Copyright (c) 1999-2014 American Megatrends, Inc. All Rights Reserved.

This publication contains proprietary information, which is protected by copyright. No part of this publication may be reproduced, transcribed, stored in a retrieval system, translated into any language or computer language, or transmitted in any form whatsoever without the prior written consent of the publisher, American Megatrends, Inc.

American Megatrends, Inc. retains the right to update, change, modify this publication at any time, without notice.

For Additional Information

Call American Megatrends BIOS Sales Department at 1-800-828-9264 for additional information.

Limitations of Liability

In no event shall American Megatrends be held liable for any loss, expenses, or damages of any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the design or use of this product or the support materials provided with the product.

Limited Warranty

No warranties are made, either expressed or implied, with regard to the contents of this work, its merchantability, or fitness for a particular use. American Megatrends assumes no responsibility for errors and omissions or for the uses made of the material contained herein or reader decisions based on such use.

Trademark and Copyright Acknowledgments

All product names used in this publication are for identification purposes only and are trademarks of their respective Companies.


Release Notes - NDA Required

Component Information:
Component Title: Hardware Signature Management
Component Reference Name: HardwareSignatureManagement
Component Type: eModule
Release Date: 2014-01-17
Source Control Label: 4.6.5.3_HwSignature_04
Source Control Location: SS: Alaska;$/Alaska/SOURCE/Modules/HardwareSignatureManagement
Dependencies
Component Dependencies
ONE
Dependent Component Title: ACPI
Dependent Component Reference Name: ACPI
Dependent Source Control Label: 4.6.4.0_ACPI_45 or higher
Dependent Source Control Location: SS: Alaska;$/Alaska/BIN/Modules/ACPI/Template;

File Dependencies
N0NE

Protocol Dependencies
ONE
Dependent Protocol Name: EFI_ACPI_SUPPORT_GUID
Dependent Protocol GUID: { 0xdbff9d55, 0x89b7, 0x46da, 0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d }
TWO
Dependent Protocol Name: EFI_PCI_IO_PROTOCOL_GUID
Dependent Protocol GUID: { 0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a }
THREE
Dependent Protocol Name: EFI_USB_IO_PROTOCOL_GUID
Dependent Protocol GUID: { 0x2B2F68D6, 0x0CD2, 0x44cf, 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 }
Non-Compiled BIN and LIB File(s) within this Component:
N0NE
Component Description:
The Hardware Signature Management module provides the protocol for updating the Hardware Signature of the Firmware ACPI Control Structure(FACS) table. Windows uses this signature on S4 to check for same hardware configuration. If it is not the same then it forces a full boot. The signature should be changed when Memory Map change, Hardware change, and Firmware update.
Main Component of Hardware Signature Management
Filename | Description
HardwareSignatureManagement.cif | This is CIF file of the main module.
HardwareSignatureManagement.chm | Describes the module's history.
HardwareSignatureManagement.sdl | Contain BIOS build parameters and defines entry points.
HardwareSignatureManagement.mak | Make file becomes part of the BIOS build process.
HardwareSignatureManagement.dxs | The dependency file of Hardware Signature Management module.
HardwareSignatureManagement.c | Functions are used to install Hardware Change Protocol and update the Hardware Signature.
HardwareChangeDetect.c | Functions are used to detect the current hardware configuration.

ModulePart Name: HardwareChangeProtocols
ModulePart Description: The header file of Hardware Change Protocol.
Filename | Description
HardwareChangeProtocols.cif | This is CIF file of Hardware Change Protocol.
HardwareChangeProtocol.h | The definitions of Hardware Change Protocol.
Non-Compiled BIN and LIB File(s) in Flavor:
N0NE
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_38, Dated: 2011-12-20
Visual eBios: RSS.5.72.0219, Dated: 2011-12-20
Compiler Tool(s): Microsoft’s Windows Driver Kit (WDK) Ver. 7600.16385.1
Compiler Tool(s): Microsoft Windows Driver Development Kit (DDK) Ver. 3790.1830
New features added in this label:
EIP#147244 - BIOS will report changed Hardware Signature when BIOS setup was modified.
After BIOS setup was modified, BIOS should report changed hardware signature to OS.
This version modifies:
HardwareSignatureManagement.c,
HardwareSignatureManagement.h,
HardwareSignatureManagement.mak,
HardwareSignatureManagement.sdl.
EIP#121317 - In function GetResolutionData, the calculation of resolution checksums will effect win8 Startup settings.
Calculates the HorizontalResolution and VerticalResolution by using GOP's Mode() information instead of using QueryMode().
This version modifies HardwareChangeDetect.c.
General Bug Fixes and EIP Addressed in this Label:
General Bug Fixes
None

EIP Addressed
[TAG] EIP136592
[Category] Bug Fix
[Severity] Important
[Symptom] Error event log ID 6008/41/29 when power on/off with turn on fast startup of OS.
[Root Cause]HardwareSignature excution sequence issue.
[Solution] Let HardwareSignature excutes after guid AMITSE_EVENT_BEFORE_BOOT_GUID and EFI_AMI_LEGACYBOOT_PROTOCOL_GUID.
[Files] HardwareSignatureManagement.c
[TAG] EIP133658
[Category] Bug Fix
[Severity] Important
[Symptom] System hang up issue when smart response enable.
[Root Cause]Function UpdateHardwareSignatureData() linked to readytoboot event run more than twice, and it will cause system suspend.
[Solution] Have a count to limit the update times, and don't let it run over 1 time.
[Files] HardwareSignatureManagement.c
[TAG] EIP121317
[Category] Bug Fix
[Severity] Important
[Symptom] Can not enter Safe mode via PBR with onboard graphics.
[Root Cause]The original method calculates resolution checksum by using GOP's function QueryMode(), but it has a side effect on enter Win8 Startup settings.
[Solution] Use another getting resolution function Mode() instead of using QueryMode().
[Files] HardwareChangeDetect.c
Files Changed for General Bug Fixes and EIP Addressed in this Label:
General Bug Fixes
None

EIP Addressed
Core\em\HardwareSignature\HardwareSignatureManagement.c (EIP #136592 )
Core\em\HardwareSignature\HardwareSignatureManagement.c (EIP #133658 )
Core\em\HardwareSignature\HardwareChangeDetect.c (EIP #121317 )
Known Limitations and Errata in this label:
None.
Remaining Issues:
None
Unit Testing:
See EIP151147 .
Validation Testing:
None
Release History:
3. 4.6.5.3_HwSignature_04 - 01/17/2014 - Third release.
EIP #121317,This version recalculates the method for obtaining resolution.
EIP #147244,This version will report new signature when BIOS setup was modified.
EIP #136592,This version delay the HardwareSignature excution sequence.
EIP #133658,This version excute this function only once.
2. 4.6.5.3_HwSignature_03 - 02/25/2013 - Second release.
EIP #109014, This version recalculate the total checksum , and it includes hardware device,firmware update times , and the return checksum provided by external call.
1. 4.6.5.3_HwSignature_01 - 10/18/2012 - First release.
EIP #102484

© American Megatrends Inc.


Function by File Name

AMIBIOS Function Reference

By File Name

The following is a list of the source files.
For a list in alphabetical order, see In Alphabetical Order.

  • HardwareChangeDetect.c
  • HardwareChangeProtocol.h
  • HardwareSignatureManagement.c
  • HardwareSignatureManagement.dxs
  • HardwareSignatureManagement.mak
Built on 20:22:12 01/17/14


HardwareChangeDetect.c

Description:
This file will detect the current Hardware configuration.

The following functions are used in the file: HardwareChangeDetect.c.

Function | Description
CRC32 | A cyclic redundancy check (CRC) is an error-detecting code commonly used in storage devices to detect accidental changes to raw data.
DetectPS2KeyboardMouseState | This function gets the SIO variable from NVRAM. It records the PS2 KB/ Mouse are present or not.
GetDiskInfoData | Calculate the disk checksum , include port number and serial number. Calculate the CRC32 checksum with port number and serial number of all disks.
GetEdidData | This function gets the checksum data of EDID.
GetMemMapData | This function detects the current memory size and memory map data.
GetPciDeviceData | This function detects the current PCI number and calculate the checksum of Bus number/Device number/Function number, VID/DID.
GetResolutionData | This function gets all resolution data and calculates the the checksum of resolution data.
GetUsbDeviceData | This function detects the current number of the USB devices and calculate the checksum of Parent Port Num/Interface Num, and VID/PID.
GetVideoData | This function gets the checksum of EDID and calculates the checksum of all resolution data.
IsDifferentMemorySize | This function compares the current and previous memory sizes.


CRC32 in the HardwareChangeDetect.c

Function : CRC32

File: HardwareChangeDetect.c
Description:
A cyclic redundancy check (CRC) is an error-detecting code
commonly used in storage devices to detect accidental changes to raw data.
Input:
IN  UINT8   *fpData - Pointer to the start of data that will be calculated.
IN  UINT16  Length - The length of data
IN  UINT8   ExtenData - The count(byte) of zero data that will be included
           when calculate CRC32.
Output:
UINT32  CRC32 checksum
Notes:


DetectPS2KeyboardMouseState in the HardwareChangeDetect.c

Function : DetectPS2KeyboardMouseState

File: HardwareChangeDetect.c
Description:
This function gets the SIO variable from NVRAM. It records the PS2 KB/
Mouse are present or not.
Input:
IN     HW_CONFIG_TYPE ConfigType- Current Type is PS2 KB or PS2 Mouse
IN OUT BOOLEAN        *bPresent - Current Type is present or not.
Output:
EFI_STATUS
EFI_NOT_FOUND - SIO variable doesn't exist.
EFI_SUCCESS - Get SIO variable successfully.
Notes:
The tokens "DETECT_PS2_MOUSE" and "DETECT_PS2_KEYBOARD" need to enable.


GetDiskInfoData in the HardwareChangeDetect.c

Function : GetDiskInfoData

File: HardwareChangeDetect.c
Description:
Calculate the disk checksum , include port number and serial number.
Calculate the CRC32 checksum with port number and serial number of all disks.
Input:
OUT HW_DISK_DATA *pHardwareDiskData - Get current Disk data.
Output:
HW_DISK_DATA  *pHardwareDiskData
CRC32 checksum - Get the current Disk data successfully.
~(CDSchecksum of previous disk data) - Get the current Disk data failure.

EFI_STATUS
EFI_SUCCESS - Get the current Disk data successfully.
EFI_NOT_READY - Get the current Disk data unsuccessfully.


GetEdidData in the HardwareChangeDetect.c

Function : GetEdidData

File: HardwareChangeDetect.c
Description:
This function gets the checksum data of EDID.
Input:
IN OUT HW_VIDEO_DATA *pHardwareVideoData - Record the EdidCheckNum of
                              current Video data.
Output:
EFI_STATUS
EFI_SUCCESS - Get the checksum data of EDID successfully.
EFI_NOT_FOUND - EfiEdidDiscoveredProtocolGuid interface not found.
EFI_INVALID_PARAMETER - Invalid parameter.


GetMemMapData in the HardwareChangeDetect.c

Function : GetMemMapData

File: HardwareChangeDetect.c
Description:
This function detects the current memory size and memory map data.
Input:
IN OUT HW_MEMORY_MAP_DATA *pMemMapConfigData - Current memory map data
                                  and memory size(MB)
Output:
EFI_STATUS
EFI_SUCCESS - Detect the current memory map data successfully.
Other - Get MemoryMap failed or allocate pool failed.


GetPciDeviceData in the HardwareChangeDetect.c

Function : GetPciDeviceData

File: HardwareChangeDetect.c
Description:
This function detects the current PCI number and calculate the checksum
of Bus number/Device number/Function number, VID/DID.
Input:
IN OUT HW_PCI_DATA *pHardwarePciData -Get current PCI data.
Output:
EFI_STATUS
EFI_SUCCESS - Detect the current PCI data successfully.
EFI_INVALID_PARAMETER - input data pHardwarePciData is NULL
Other - Get PCI data failed.


GetResolutionData in the HardwareChangeDetect.c

Function : GetResolutionData

File: HardwareChangeDetect.c
Description:
This function gets all resolution data and calculates the the checksum of
resolution data.
Input:
IN OUT HW_VIDEO_DATA *pHardwareVideoData -Record the ResolutionChecksum of
                             current Video data.
Output:
EFI_STATUS
EFI_SUCCESS - Get all resolution data and calculate checksum successfully.
EFI_NOT_FOUND - EfiGraphicsOutputProtocolGuid interface not found.
EFI_INVALID_PARAMETER - Invalid parameter.


GetUsbDeviceData in the HardwareChangeDetect.c

Function : GetUsbDeviceData

File: HardwareChangeDetect.c
Description:
This function detects the current number of the USB devices and calculate
the checksum of Parent Port Num/Interface Num, and VID/PID.
Input:
IN OUT HW_USB_DATA *pHardwareUsbData -Get current USB data.
Output:
EFI_STATUS
EFI_SUCCESS - Detect the current USB data successfully.
EFI_INVALID_PARAMETER - input data pHardwareUsbData is NULL
Other - Get USB data failed.


GetVideoData in the HardwareChangeDetect.c

Function : GetVideoData

File: HardwareChangeDetect.c
Description:
This function gets the checksum of EDID and calculates the checksum
of all resolution data.
Input:
IN OUT HW_VIDEO_DATA *pHardwareVideoData -Get current Video data.
Output:
EFI_STATUS
EFI_SUCCESS - Get the current Video data successfully.
EFI_UNSUPPORTED - Get the current Video data failed.


IsDifferentMemorySize in the HardwareChangeDetect.c

Function : IsDifferentMemorySize

File: HardwareChangeDetect.c
Description:
This function compares the current and previous memory sizes.
Input:
IN UINT32 CurMemorySizeMb - Current memory size (MB)
IN UINT32 PreMemorySizeMb - Previous memory size (MB)
Output:
BOOLEAN
TRUE - Memory sizes are different.
FALSE - Memory sizes are similar.


HardwareChangeProtocol.h

Description:
The header file for Hardware change protocol.

The following data structures are used in the file: HardwareChangeProtocol.h.

Variable | Description
DISK_STRUCTURE | This structure represents the Disk configuration data which contains port number and serial number .
HW_CONFIG_DATA | This structure represents the hardware configuration data which contains PS2 Keyboard/Mouse configuration, Memory Map configuration, PCI configuration Data, USB configuration Data, Video configuration data, Disk configuration data, Firmware update times, and Checksum which external function given.
HW_DISK_DATA | This structure represents the Disk configuration data with checksum.
HW_MEMORY_MAP_DATA | This structure represents the memory map data which contains memory size(Megabyte) and checksum of the runtime memory type.
HW_PCI_DATA | This structure represents the PCI configuration data which contains number of PCI/PCIE devices, checksum of Bus number/Device number/ Function number, and checksum of VID/DID.
HW_USB_DATA | This structure represents the USB configuration data which contains number of USB devices, checksum of VID/PID, and checksum of Port number and Interface number.
HW_VIDEO_DATA | This structure represents the Video configuration data which contains checksum of EDID data, and checksum of resolution.


DISK_STRUCTURE in the HardwareChangeProtocol.h

Variable : DISK_STRUCTURE

File: HardwareChangeProtocol.h
Fields:

Name | Type | Description
Portnumber | UINT8 | Port number
Serialnumber | UINT8 | Serial number

Description:
This structure represents the Disk configuration data which
contains port number and serial number .


HW_CONFIG_DATA in the HardwareChangeProtocol.h

Variable : HW_CONFIG_DATA

File: HardwareChangeProtocol.h
Fields:

Name | Type | Description
bPs2Keyboard | BOOLEAN | The present state of PS2 Keyboard
bPs2Mouse | BOOLEAN | The present state of PS2 Mouse
MemMapData | HW_MEMORY_MAP_DATA | Memory configuration data
PciData | HW_PCI_DATA | PCI configuration data
UsbData | HW_USB_DATA | USB configuration data
VideoData | HW_VIDEO_DATA | Video configuration data
DiskData | HW_DISK_DATA | Disk configuration data
FirmwareUpdateCount | UINT32 | Firmware update count
ReturnChecksum | UINT32 | Checksum which the external function given

Description:
This structure represents the hardware configuration data
which contains PS2 Keyboard/Mouse configuration, Memory Map configuration,
PCI configuration Data, USB configuration Data,  Video configuration data,
Disk configuration data, Firmware update times, and Checksum which external
function given.


HW_DISK_DATA in the HardwareChangeProtocol.h

Variable : HW_DISK_DATA

File: HardwareChangeProtocol.h
Fields:

Name | Type | Description
CDSchecksum | UINT8 | Checksum

Description:
This structure represents the Disk configuration data with checksum.


HW_MEMORY_MAP_DATA in the HardwareChangeProtocol.h

Variable : HW_MEMORY_MAP_DATA

File: HardwareChangeProtocol.h
Fields:

Name | Type | Description
MemMapCheckSum | UINT8 | Checksum of the runtime memory type
MemoryMbSize | UINT32 | Total memory size(Megabyte)

Description:
This structure represents the memory map data which contains
memory size(Megabyte) and checksum of the runtime memory type.


HW_PCI_DATA in the HardwareChangeProtocol.h

Variable : HW_PCI_DATA

File: HardwareChangeProtocol.h
Fields:

Name | Type | Description
PciNum | UINT16 | Number of PCI/PCIE devices
BdfChecksum | UINT8 | Checksum of Bus number/Device number/Function number
VidDidChecksum | UINT8 | Checksum of VID/DID

Description:
This structure represents the PCI configuration data which
contains number of PCI/PCIE devices, checksum of Bus number/Device number/
Function number, and checksum of VID/DID.


HW_USB_DATA in the HardwareChangeProtocol.h

Variable : HW_USB_DATA

File: HardwareChangeProtocol.h
Fields:

Name | Type | Description
UsbNum | UINT16 | Number of USB devices
VidPidChecksum | UINT8 | Checksum of VID/PID
PortNumInterfaceNumChecksum | UINT8 | Checksum of Port number and Interface number

Description:
This structure represents the USB configuration data which
contains number of USB devices, checksum of VID/PID, and checksum of Port
number and Interface number.


HW_VIDEO_DATA in the HardwareChangeProtocol.h

Variable : HW_VIDEO_DATA

File: HardwareChangeProtocol.h
Fields:

Name | Type | Description
EdidCheckNum | UINT8 | Checksum of EDID data
ResolutionChecksum | UINT8 | Checksum of resolution

Description:
This structure represents the Video configuration data which
contains checksum of EDID data, and checksum of resolution.


HardwareSignatureManagement.c

Description:
This file will install the HardwareChange protocol. The
hardware signature data of the FACS table will be
updated when the ReadyToBoot event is signaled.

The following functions are used in the file: HardwareSignatureManagement.c.

Function | Description
DetectAndSetDiskConfig | This function detects the Disk configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetMemoryMapConfig | This function detects the memory map configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetMemorySizeConfig | This function detects the memory size configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetPciConfig | This function detects the PCI configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetPs2KeyboardConfig | This function detects the PS2 Keyboard configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetPs2MouseConfig | This function detects the PS2 Mouse configurations and sets this config. to global variable gCurHardwareConfigData.
DetectAndSetUsbConfig | This function detects the USB configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetVideoConfig | This function detects the Video configurations and sets this configuration to global variable gCurHardwareConfigData.
GetFacsTable | This function returns address of memory where FACS ACPI table resides
GetFirmwareUpdateCountFromNvram | This function gets the firmware update times from NVRAM.
GetHardwareConfigDataFromNvram | This function gets the hardware configuration data from NVRAM.
GetSetupUpdateCountFromNvram | This function gets the setup update times from NVRAM.
HardwareSignatureUpdateEntryPoint | This function is a driver entry point that installs a protocol to set the hardware configurations. These hardware configurations will determine the hardware ignature of the FACS table.
QuickSort | This function sorts the external checksum in ascending order.
SaveCountToNvramAfterFwUpdate | This function saves the global variable 'gFwUpdateCount' to NVRAM after the firmware updated.
SaveFwUpdateCountToMemory | This function gets update counts from NVRAM and copy this data to the global variable 'gFwUpdateCount' before updating the firmware. The NVRAM data could erase during firmware update, so we need to save the data to memory first.
SetDiskConfigState | This function sets the Disk configurations to global variable gCurHardwareConfigData.
SetFirmwareUpdateCountToNvram | This function saves the firmware update times into NVRAM.
SetHardwareConfigData | This function sets the hardware configuration data for each configuration type.
SetHardwareConfigDataToNvram | This function writes the hardware configurations to NVRAM.
SetMemoryMapConfigState | This function sets the memory map configurations to global variable gCurHardwareConfigData.
SetMemorySizeConfigState | This function sets the memory size configurations to global variable gCurHardwareConfigData.
SetPciConfigState | This function sets the PCI configurations to global variable gCurHardwareConfigData.
SetPs2KeyboardState | This function sets the PS2 Keyboard configurations to global variable gCurHardwareConfigData.
SetPs2MouseState | This function sets the PS2 Mouse configurations to global variable gCurHardwareConfigData.
SetUsbConfigState | This function sets the USB configurations to global variable gCurHardwareConfigData.
SetVideoConfigState | This function sets the Video configurations to global variable gCurHardwareConfigData.
SignalHardwareSignatureChange | This function will update the global variable 'gExternalFunCallCount' and save the checksum value in the global variable gCurHardwareConfigData(ReturnChecksum array).
Swap | This function swaps the two input data.
UpdateHardwareSignatureData | This function will be called when ReadyToBoot event will be signaled and will update the hardware signature data of the FACS table.


DetectAndSetDiskConfig in the HardwareSignatureManagement.c

Function : DetectAndSetDiskConfig

File: HardwareSignatureManagement.c
Description:
This function detects the Disk configurations and sets this configuration
to global variable gCurHardwareConfigData.
Input:
IN UINTN BufferSize - Size of buffer for recording the Disk data.
IN VOID  *Buffer - Buffer for recording the Disk data.
Output:
EFI_STATUS
EFI_SUCCESS - Disk configuration is set successfully.
EFI_INVALID_PARAMETER - BufferSize is incorrect.
Other - Get Disk data failed.
Notes:
If Buffer is NULL and BufferSize is 0, the function will save the
detected Disk data to gCurHardwareConfigData. Otherwise, it will save
the input data (Buffer).


DetectAndSetMemoryMapConfig in the HardwareSignatureManagement.c

Function : DetectAndSetMemoryMapConfig

File: HardwareSignatureManagement.c
Description:
This function detects the memory map configurations and sets this
configuration to global variable gCurHardwareConfigData.
Input:
IN UINTN BufferSize - Size of buffer for recording the memory map data.
IN VOID  *Buffer - Buffer for recording the memory map data.
Output:
EFI_STATUS
EFI_SUCCESS - Memory map config. is set successfully.
EFI_INVALID_PARAMETER - BufferSize is incorrect.
Other - Get memory map data failed.
Notes:
If Buffer is NULL and BufferSize is 0, the function will save the
detected memory map data to gCurHardwareConfigData. Otherwise, it will
save the input data(Buffer).


DetectAndSetMemorySizeConfig in the HardwareSignatureManagement.c

Function : DetectAndSetMemorySizeConfig

File: HardwareSignatureManagement.c
Description:
This function detects the memory size configurations and sets this
configuration to global variable gCurHardwareConfigData.
Input:
IN UINTN BufferSize - Size of buffer for recording the memory size.
IN VOID *Buffer - Buffer for recording the memory size.
Output:
EFI_STATUS
EFI_SUCCESS - Memory size config. is set successfully.
Other - Detect the memory size failed or set the memory size
configuration failed.
Notes:
If Buffer is NULL and BufferSize is 0, the function will save the
detected size(DetectMemSize) to gCurHardwareConfigData. Otherwise, it
will compare the input data(Buffer) and the detected size(DetectMemSize)
to determine which one should be saved.


DetectAndSetPciConfig in the HardwareSignatureManagement.c

Function : DetectAndSetPciConfig

File: HardwareSignatureManagement.c
Description:
This function detects the PCI configurations and sets this configuration
to global variable gCurHardwareConfigData.
Input:
IN UINTN BufferSize - Size of buffer for recording the PCI data.
IN VOID  *Buffer - Buffer for recording the PCI data.
Output:
EFI_STATUS
EFI_SUCCESS - PCI config. is set successfully.
EFI_INVALID_PARAMETER - BufferSize is incorrect.
Other - Get PCI data failed.
Notes:
If Buffer is NULL and BufferSize is 0, the function will save the
detected PCI data to gCurHardwareConfigData. Otherwise, it will save
the input data (Buffer).


DetectAndSetPs2KeyboardConfig in the HardwareSignatureManagement.c

Function : DetectAndSetPs2KeyboardConfig

File: HardwareSignatureManagement.c
Description:
This function detects the PS2 Keyboard configurations and sets this
configuration to global variable gCurHardwareConfigData.
Input:
IN UINTN BufferSize - Size of buffer for recording the PS2 Keyboard
         configuration. It should be one byte.
IN VOID *Buffer - Buffer for recording the PS2 Keyboard configuration.
     If *Buffer is 1, it means the PS2 Keyboard is present.
     If *Buffer is 0, the PS2 Keyboard is not present
Output:
EFI_STATUS
EFI_SUCCESS - PS2 Keyboard config. is set successfully.
Other - Set PS2 Keyboard config. failed.
Notes:
If Buffer is NULL and BufferSize is 0, the function will save the
detected data to gCurHardwareConfigData. Otherwise,  it will compare the
input data and the  detected data to determine the PS2 Keyboard is
present or not.


DetectAndSetPs2MouseConfig in the HardwareSignatureManagement.c

Function : DetectAndSetPs2MouseConfig

File: HardwareSignatureManagement.c
Description:
This function detects the PS2 Mouse configurations and sets this config.
to global variable gCurHardwareConfigData.
Input:
IN UINTN BufferSize - Size of buffer for recording the PS2 Mouse config.
         It should be one byte.
IN VOID  *Buffer - Buffer for recording the PS2 Mouse configuration. If
      *Buffer is 1, it means the PS2 Mouse is present. If
      *Buffer is 0, the PS2 Mouse is not present
Output:
EFI_STATUS
EFI_SUCCESS - PS2 Mouse config. is set successfully.
Other - Set PS2 Mouse configuration failed.
Notes:
If Buffer is NULL and BufferSize is 0, the function will save the
detected data to gCurHardwareConfigData. Otherwise,  it will compare
the input data and the detected data to determine the PS2 Mouse is
present or not.


DetectAndSetUsbConfig in the HardwareSignatureManagement.c

Function : DetectAndSetUsbConfig

File: HardwareSignatureManagement.c
Description:
This function detects the USB configurations and sets this configuration
to global variable gCurHardwareConfigData.
Input:
IN UINTN BufferSize - Size of buffer for recording USB data.
IN VOID  *Buffer - Buffer for recording the USB data.
Output:
EFI_STATUS
EFI_SUCCESS - USB config. is set successfully.
EFI_INVALID_PARAMETER - BufferSize is incorrect.
Other - Get USB data failed.
Notes:
If Buffer is NULL and BufferSize is 0, the function will save the
detected USB data to gCurHardwareConfigData. Otherwise, it will save the
input data (Buffer).


DetectAndSetVideoConfig in the HardwareSignatureManagement.c

Function : DetectAndSetVideoConfig

File: HardwareSignatureManagement.c
Description:
This function detects the Video configurations and sets this configuration
to global variable gCurHardwareConfigData.
Input:
IN UINTN BufferSize - Size of buffer for recording the Video data.
IN VOID  *Buffer - Buffer for recording the Video data.
Output:
EFI_STATUS
EFI_SUCCESS - Video configuration is set successfully.
EFI_INVALID_PARAMETER - BufferSize is incorrect.
Other - Get Video data failed.
Notes:
If Buffer is NULL and BufferSize is 0, the function will save the
detected Video data to gCurHardwareConfigData. Otherwise, it will save
the input data (Buffer).


GetFacsTable in the HardwareSignatureManagement.c

Function : GetFacsTable

File: HardwareSignatureManagement.c
Description:
This function returns address of memory where FACS ACPI table resides
Input:
IN OUT EFI_PHYSICAL_ADDRESS *AcpiFacsTable - address of FACS table
Output:
EFI_STATUS
EFI_NOT_READY - Can't find the EfiAcpiSupportGuid protocol
EFI_NOT_FOUND - Can't find the FADT table
EFI_SUCCESS - Table was found successfully


GetFirmwareUpdateCountFromNvram in the HardwareSignatureManagement.c

Function : GetFirmwareUpdateCountFromNvram

File: HardwareSignatureManagement.c
Description:
This function gets the firmware update times from NVRAM.
Input:
IN OUT UINT32 *ChangeTime - The firmware update times.
Output:
EFI_STATUS
EFI_INVALID_PARAMETER - ChangeTime is NULL.
EFI_SUCCESS - Get the firmware update change times successfully.


GetHardwareConfigDataFromNvram in the HardwareSignatureManagement.c

Function : GetHardwareConfigDataFromNvram

File: HardwareSignatureManagement.c
Description:
This function gets the hardware configuration data from NVRAM.
Input:
IN OUT HW_CONFIG_DATA *HardwareConfigData - The hardware configuration data of NVRAM.
Output:
EFI_STATUS
EFI_INVALID_PARAMETER - HardwareConfigData is NULL.
EFI_NOT_FOUND - It is the first boot. There is no Hardware
     configuration data.
EFI_SUCCESS - Get the hardware configuration data successfully.


GetSetupUpdateCountFromNvram in the HardwareSignatureManagement.c

Function : GetSetupUpdateCountFromNvram

File: HardwareSignatureManagement.c
Description:
This function gets the setup update times from NVRAM.
Input:
IN OUT UINT32 *ChangeTime - The setup update times.
Output:
EFI_STATUS
EFI_INVALID_PARAMETER - ChangeTime is NULL.
EFI_SUCCESS - Get the firmware update change times successfully.


HardwareSignatureUpdateEntryPoint in the HardwareSignatureManagement.c

Function : HardwareSignatureUpdateEntryPoint

File: HardwareSignatureManagement.c
Description:
This function is a driver entry point that installs a protocol to set the
hardware configurations. These hardware configurations will determine the
hardware ignature of the FACS table.
Input:
IN EFI_HANDLE       ImageHandle - Image handle
IN EFI_SYSTEM_TABLE *SystemTable - pointer to system table
Output:
EFI_STATUS
EFI_SUCCESS - Function executed successfully.
Other - Function executed unsuccessfully.
Notes:
This function also creates ReadyToBoot event to update the hardware
signature of the FACS table.


QuickSort in the HardwareSignatureManagement.c

Function : QuickSort

File: HardwareSignatureManagement.c
Description:
This function sorts the external checksum in ascending order.
Input:
IN OUT UINT32 *ChecksumData - all checksum data
IN     UINT32 LChecksumPosition - the first position of checksum data
IN     UINT32 RChecksumPosition - the last position of checksum data
Output:
None
Notes:
The sorted data will be saved in ChecksumData.


SaveCountToNvramAfterFwUpdate in the HardwareSignatureManagement.c

Function : SaveCountToNvramAfterFwUpdate

File: HardwareSignatureManagement.c
Description:
This function saves the global variable 'gFwUpdateCount' to NVRAM after
the firmware updated.
Input:
None
Output:
None


SaveFwUpdateCountToMemory in the HardwareSignatureManagement.c

Function : SaveFwUpdateCountToMemory

File: HardwareSignatureManagement.c
Description:
This function gets update counts from NVRAM and copy this data to the
global variable 'gFwUpdateCount' before updating the firmware. The NVRAM
data could erase during firmware update, so we need to save the data to
memory first.
Input:
None
Output:
None
Modified:
gFwUpdateCount


SetDiskConfigState in the HardwareSignatureManagement.c

Function : SetDiskConfigState

File: HardwareSignatureManagement.c
Description:
This function sets the Disk configurations to global variable
gCurHardwareConfigData.
Input:
IN HW_DISK_DATA DiskConfig - Current Disk data
Output:
None


SetFirmwareUpdateCountToNvram in the HardwareSignatureManagement.c

Function : SetFirmwareUpdateCountToNvram

File: HardwareSignatureManagement.c
Description:
This function saves the firmware update times into NVRAM.
Input:
IN UINT32 *ChangeTime - Firmware update times.
Output:
EFI_STATUS
EFI_INVALID_PARAMETER - ChangeTime is invalid
EFI_SUCCESS - ChangeTime is written successfully


SetHardwareConfigData in the HardwareSignatureManagement.c

Function : SetHardwareConfigData

File: HardwareSignatureManagement.c
Description:
This function sets the hardware configuration data for each configuration
type.
Input:
IN HW_CONFIG_TYPE  ConfigType - the hardware configuration type
IN UINTN           BufferSize - Size of buffer for recording the
                   configuration data.
IN VOID            *Buffer - Buffer for recording the config. data.
Output:
EFI_STATUS
EFI_INVALID_PARAMETER - ConfigType is incorrect. Buffer is NULL and
             BufferSize is not zero.
EFI_SUCCESS - Set the hardware configuration data successfully.


SetHardwareConfigDataToNvram in the HardwareSignatureManagement.c

Function : SetHardwareConfigDataToNvram

File: HardwareSignatureManagement.c
Description:
This function writes the hardware configurations to NVRAM.
Input:
IN HW_CONFIG_DATA   *HardwareConfigData - current HW config. data
Output:
EFI_STATUS
EFI_INVALID_PARAMETER - HardwareConfigData is invalid
EFI_SUCCESS - HW Config. is written successfully


SetMemoryMapConfigState in the HardwareSignatureManagement.c

Function : SetMemoryMapConfigState

File: HardwareSignatureManagement.c
Description:
This function sets the memory map configurations to global variable
gCurHardwareConfigData.
Input:
IN HW_MEMORY_MAP_DATA MemMapConfig - Current memory map data
Output:
None


SetMemorySizeConfigState in the HardwareSignatureManagement.c

Function : SetMemorySizeConfigState

File: HardwareSignatureManagement.c
Description:
This function sets the memory size configurations to global variable
gCurHardwareConfigData.
Input:
IN UINT32 MemorySizeMb - Current memory size (MB)
IN UINTN  BufferSize - Size of buffer for recording the memory size.
Output:
EFI_STATUS
EFI_INVALID_PARAMETER - Buffer size is too small to record the memory
             size.
EFI_SUCCESS - Memory size config. is set successfully


SetPciConfigState in the HardwareSignatureManagement.c

Function : SetPciConfigState

File: HardwareSignatureManagement.c
Description:
This function sets the PCI configurations to global variable
gCurHardwareConfigData.
Input:
IN HW_PCI_DATA PciConfig - Current PCI data
Output:
None


SetPs2KeyboardState in the HardwareSignatureManagement.c

Function : SetPs2KeyboardState

File: HardwareSignatureManagement.c
Description:
This function sets the PS2 Keyboard configurations to global variable
gCurHardwareConfigData.
Input:
IN BOOLEAN bPresent - If valuse is TRUE, PS2 Keyboard is present.
         If valuse is FALSE, PS2 Keyboard is not present.
Output:
None


SetPs2MouseState in the HardwareSignatureManagement.c

Function : SetPs2MouseState

File: HardwareSignatureManagement.c
Description:
This function sets the PS2 Mouse configurations to global variable
gCurHardwareConfigData.
Input:
IN BOOLEAN bPresent - If valuse is TRUE, PS2 Mouse is present.
         If valuse is FALSE, PS2 Mouse is not present.
Output:
None


SetUsbConfigState in the HardwareSignatureManagement.c

Function : SetUsbConfigState

File: HardwareSignatureManagement.c
Description:
This function sets the USB configurations to global variable
gCurHardwareConfigData.
Input:
IN HW_USB_DATA UsbConfig - Current USB data
Output:
None


SetVideoConfigState in the HardwareSignatureManagement.c

Function : SetVideoConfigState

File: HardwareSignatureManagement.c
Description:
This function sets the Video configurations to global variable
gCurHardwareConfigData.
Input:
IN HW_VIDEO_DATA VideoConfig - Current Video data
Output:
None


SignalHardwareSignatureChange in the HardwareSignatureManagement.c

Function : SignalHardwareSignatureChange

File: HardwareSignatureManagement.c
Description:
This function will update the global variable 'gExternalFunCallCount' and
save the checksum value in the global variable
gCurHardwareConfigData(ReturnChecksum array).
Input:
IN UINT32 ReturnChecksum - The checksum value that external function gives.
Output:
EFI_STATUS
EFI_OUT_OF_RESOURCES - The global variable 'gExternalFunCallCount' is
            larger than and equal to LIMIT_PROTOCOL_CALLED.
EFI_SUCCESS - Record the checksum which external function gives successfully
Modified:
gExternalFunCallCount, gCurHardwareConfigData.ReturnChecksum
Notes:
The global variable gExternalFunCallCount will be increased.


Swap in the HardwareSignatureManagement.c

Function : Swap

File: HardwareSignatureManagement.c
Description:
This function swaps the two input data.
Input:
IN OUT UINT32 *LChecksumPosition - Left checksum position
IN OUT UINT32 *RChecksumPosition - Right checksum position
Output:
None


UpdateHardwareSignatureData in the HardwareSignatureManagement.c

Function : UpdateHardwareSignatureData

File: HardwareSignatureManagement.c
Description:
This function will be called when ReadyToBoot event will be signaled and
will update the hardware signature data of the FACS table.
Input:
IN EFI_EVENT Event - signalled event
IN VOID      *Context - calling context
Output:
EFI_STATUS
EFI_NOT_READY - GetFacsTable() can't find the EfiAcpiSupportGuid protocol.
EFI_NOT_FOUND - GetFacsTable() can't find the FADT table.
EFI_SUCCESS - Hardware Signature was updated successfully.
Other - Hardware Signature could't be updated.
Notes:
This function also writes the hardware configurations to NVRAM.


HardwareSignatureManagement.dxs

Description:
Dependency expression file for Hardware Signature update Driver.


HardwareSignatureManagement.mak

Description:
Make file for the Hardware signature Management component


Functions in Alphabetical Order

In Alphabetical Order

The following topics provide a list in alphabetical order.
For a list by file name, see By File Name.

  • C
  • D
  • G
  • H
  • I
  • Q
  • S
  • U


Functions in Alphabetical Order

C

Function | Description
CRC32 | A cyclic redundancy check (CRC) is an error-detecting code commonly used in storage devices to detect accidental changes to raw data.


Functions in Alphabetical Order

D

Function | Description
DetectAndSetDiskConfig | This function detects the Disk configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetMemoryMapConfig | This function detects the memory map configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetMemorySizeConfig | This function detects the memory size configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetPciConfig | This function detects the PCI configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetPs2KeyboardConfig | This function detects the PS2 Keyboard configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetPs2MouseConfig | This function detects the PS2 Mouse configurations and sets this config. to global variable gCurHardwareConfigData.
DetectAndSetUsbConfig | This function detects the USB configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectAndSetVideoConfig | This function detects the Video configurations and sets this configuration to global variable gCurHardwareConfigData.
DetectPS2KeyboardMouseState | This function gets the SIO variable from NVRAM. It records the PS2 KB/ Mouse are present or not.

Data Structure | Description
DISK_STRUCTURE | This structure represents the Disk configuration data which contains port number and serial number .


Functions in Alphabetical Order

G

Function | Description
GetDiskInfoData | Calculate the disk checksum , include port number and serial number. Calculate the CRC32 checksum with port number and serial number of all disks.
GetEdidData | This function gets the checksum data of EDID.
GetFacsTable | This function returns address of memory where FACS ACPI table resides
GetFirmwareUpdateCountFromNvram | This function gets the firmware update times from NVRAM.
GetHardwareConfigDataFromNvram | This function gets the hardware configuration data from NVRAM.
GetMemMapData | This function detects the current memory size and memory map data.
GetPciDeviceData | This function detects the current PCI number and calculate the checksum of Bus number/Device number/Function number, VID/DID.
GetResolutionData | This function gets all resolution data and calculates the the checksum of resolution data.
GetSetupUpdateCountFromNvram | This function gets the setup update times from NVRAM.
GetUsbDeviceData | This function detects the current number of the USB devices and calculate the checksum of Parent Port Num/Interface Num, and VID/PID.
GetVideoData | This function gets the checksum of EDID and calculates the checksum of all resolution data.


Functions in Alphabetical Order

H

Function | Description
HardwareSignatureUpdateEntryPoint | This function is a driver entry point that installs a protocol to set the hardware configurations. These hardware configurations will determine the hardware ignature of the FACS table.

Data Structure | Description
HW_CONFIG_DATA | This structure represents the hardware configuration data which contains PS2 Keyboard/Mouse configuration, Memory Map configuration, PCI configuration Data, USB configuration Data, Video configuration data, Disk configuration data, Firmware update times, and Checksum which external function given.
HW_DISK_DATA | This structure represents the Disk configuration data with checksum.
HW_MEMORY_MAP_DATA | This structure represents the memory map data which contains memory size(Megabyte) and checksum of the runtime memory type.
HW_PCI_DATA | This structure represents the PCI configuration data which contains number of PCI/PCIE devices, checksum of Bus number/Device number/ Function number, and checksum of VID/DID.
HW_USB_DATA | This structure represents the USB configuration data which contains number of USB devices, checksum of VID/PID, and checksum of Port number and Interface number.
HW_VIDEO_DATA | This structure represents the Video configuration data which contains checksum of EDID data, and checksum of resolution.


Functions in Alphabetical Order

I

Function | Description
IsDifferentMemorySize | This function compares the current and previous memory sizes.


Functions in Alphabetical Order

Q

Function | Description
QuickSort | This function sorts the external checksum in ascending order.


Functions in Alphabetical Order

S

Function | Description
SaveCountToNvramAfterFwUpdate | This function saves the global variable 'gFwUpdateCount' to NVRAM after the firmware updated.
SaveFwUpdateCountToMemory | This function gets update counts from NVRAM and copy this data to the global variable 'gFwUpdateCount' before updating the firmware. The NVRAM data could erase during firmware update, so we need to save the data to memory first.
SetDiskConfigState | This function sets the Disk configurations to global variable gCurHardwareConfigData.
SetFirmwareUpdateCountToNvram | This function saves the firmware update times into NVRAM.
SetHardwareConfigData | This function sets the hardware configuration data for each configuration type.
SetHardwareConfigDataToNvram | This function writes the hardware configurations to NVRAM.
SetMemoryMapConfigState | This function sets the memory map configurations to global variable gCurHardwareConfigData.
SetMemorySizeConfigState | This function sets the memory size configurations to global variable gCurHardwareConfigData.
SetPciConfigState | This function sets the PCI configurations to global variable gCurHardwareConfigData.
SetPs2KeyboardState | This function sets the PS2 Keyboard configurations to global variable gCurHardwareConfigData.
SetPs2MouseState | This function sets the PS2 Mouse configurations to global variable gCurHardwareConfigData.
SetUsbConfigState | This function sets the USB configurations to global variable gCurHardwareConfigData.
SetVideoConfigState | This function sets the Video configurations to global variable gCurHardwareConfigData.
SignalHardwareSignatureChange | This function will update the global variable 'gExternalFunCallCount' and save the checksum value in the global variable gCurHardwareConfigData(ReturnChecksum array).
Swap | This function swaps the two input data.


Functions in Alphabetical Order

U

Function | Description
UpdateHardwareSignatureData | This function will be called when ReadyToBoot event will be signaled and will update the hardware signature data of the FACS table.


General Information