TianoCore EDK2 master
|
#include "SmbiosDxe.h"
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | GetSmbiosStructureSize (IN CONST EFI_SMBIOS_PROTOCOL *This, IN EFI_SMBIOS_TABLE_HEADER *Head, OUT UINTN *Size, OUT UINTN *NumberOfStrings) |
BOOLEAN EFIAPI | CheckSmbiosHandleExistance (IN LIST_ENTRY *Head, IN EFI_SMBIOS_HANDLE Handle) |
VOID EFIAPI | GetMaxSmbiosHandle (IN CONST EFI_SMBIOS_PROTOCOL *This, IN OUT EFI_SMBIOS_HANDLE *MaxHandle) |
EFI_STATUS EFIAPI | GetAvailableSmbiosHandle (IN CONST EFI_SMBIOS_PROTOCOL *This, IN OUT EFI_SMBIOS_HANDLE *Handle) |
EFI_STATUS EFIAPI | SmbiosAdd (IN CONST EFI_SMBIOS_PROTOCOL *This, IN EFI_HANDLE ProducerHandle OPTIONAL, IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle, IN EFI_SMBIOS_TABLE_HEADER *Record) |
EFI_STATUS EFIAPI | SmbiosUpdateString (IN CONST EFI_SMBIOS_PROTOCOL *This, IN EFI_SMBIOS_HANDLE *SmbiosHandle, IN UINTN *StringNumber, IN CHAR8 *String) |
EFI_STATUS EFIAPI | SmbiosRemove (IN CONST EFI_SMBIOS_PROTOCOL *This, IN EFI_SMBIOS_HANDLE SmbiosHandle) |
EFI_STATUS EFIAPI | SmbiosGetNext (IN CONST EFI_SMBIOS_PROTOCOL *This, IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle, IN EFI_SMBIOS_TYPE *Type OPTIONAL, OUT EFI_SMBIOS_TABLE_HEADER **Record, OUT EFI_HANDLE *ProducerHandle OPTIONAL) |
EFI_STATUS EFIAPI | GetNextSmbiosRecord (IN CONST EFI_SMBIOS_PROTOCOL *This, IN OUT EFI_SMBIOS_ENTRY **CurrentSmbiosEntry, OUT EFI_SMBIOS_TABLE_HEADER **Record) |
EFI_STATUS EFIAPI | SmbiosCreateTable (OUT VOID **TableEntryPointStructure) |
EFI_STATUS EFIAPI | SmbiosCreate64BitTable (OUT VOID **TableEntryPointStructure) |
VOID EFIAPI | SmbiosTableConstruction (BOOLEAN Smbios32BitTable, BOOLEAN Smbios64BitTable) |
STATIC BOOLEAN | IsValidSmbios20Table (IN VOID *TableEntry, OUT VOID **TableAddress, OUT UINTN *TableMaximumSize, OUT UINT8 *MajorVersion, OUT UINT8 *MinorVersion) |
STATIC BOOLEAN | IsValidSmbios30Table (IN VOID *TableEntry, OUT VOID **TableAddress, OUT UINTN *TableMaximumSize, OUT UINT8 *MajorVersion, OUT UINT8 *MinorVersion) |
STATIC EFI_STATUS | ParseAndAddExistingSmbiosTable (IN EFI_HANDLE ImageHandle, IN SMBIOS_STRUCTURE_POINTER Smbios, IN UINTN Length, IN UINT8 MajorVersion, IN UINT8 MinorVersion) |
EFI_STATUS | RetrieveSmbiosFromHob (IN EFI_HANDLE ImageHandle) |
EFI_STATUS EFIAPI | SmbiosDriverEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
This code produces the Smbios protocol. It also responsible for constructing SMBIOS table into system table.
Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SmbiosDxe.c.
BOOLEAN EFIAPI CheckSmbiosHandleExistance | ( | IN LIST_ENTRY * | Head, |
IN EFI_SMBIOS_HANDLE | Handle | ||
) |
Determin whether an SmbiosHandle has already in use.
Head | Pointer to the beginning of SMBIOS structure. |
Handle | A unique handle will be assigned to the SMBIOS record. |
TRUE | Smbios handle already in use. |
FALSE | Smbios handle is NOT used. |
Definition at line 258 of file SmbiosDxe.c.
EFI_STATUS EFIAPI GetAvailableSmbiosHandle | ( | IN CONST EFI_SMBIOS_PROTOCOL * | This, |
IN OUT EFI_SMBIOS_HANDLE * | Handle | ||
) |
Get an SmbiosHandle that could use.
This | The EFI_SMBIOS_PROTOCOL instance. |
SmbiosHandle | A unique handle will be assigned to the SMBIOS record. |
EFI_SUCCESS | Smbios handle got. |
EFI_OUT_OF_RESOURCES | Smbios handle is NOT available. |
Definition at line 311 of file SmbiosDxe.c.
VOID EFIAPI GetMaxSmbiosHandle | ( | IN CONST EFI_SMBIOS_PROTOCOL * | This, |
IN OUT EFI_SMBIOS_HANDLE * | MaxHandle | ||
) |
Get the max SmbiosHandle that could be use.
This | The EFI_SMBIOS_PROTOCOL instance. |
MaxHandle | The max handle that could be assigned to the SMBIOS record. |
Definition at line 286 of file SmbiosDxe.c.
EFI_STATUS EFIAPI GetNextSmbiosRecord | ( | IN CONST EFI_SMBIOS_PROTOCOL * | This, |
IN OUT EFI_SMBIOS_ENTRY ** | CurrentSmbiosEntry, | ||
OUT EFI_SMBIOS_TABLE_HEADER ** | Record | ||
) |
Allow the caller to discover all of the SMBIOS records.
This | The EFI_SMBIOS_PROTOCOL instance. |
CurrentSmbiosEntry | On exit, points to the SMBIOS entry on the list which includes the returned SMBIOS record information. If *CurrentSmbiosEntry is NULL on entry, then the first SMBIOS entry on the list will be returned. |
Record | On exit, points to the SMBIOS Record consisting of the formatted area followed by the unformatted area. The unformatted area optionally contains text strings. |
EFI_SUCCESS | SMBIOS record information was successfully returned in Record. CurrentSmbiosEntry points to the SMBIOS entry which includes the returned SMBIOS record information. |
EFI_NOT_FOUND | There is no more SMBIOS entry. |
Definition at line 995 of file SmbiosDxe.c.
EFI_STATUS EFIAPI GetSmbiosStructureSize | ( | IN CONST EFI_SMBIOS_PROTOCOL * | This, |
IN EFI_SMBIOS_TABLE_HEADER * | Head, | ||
OUT UINTN * | Size, | ||
OUT UINTN * | NumberOfStrings | ||
) |
Get the full size of SMBIOS structure including optional strings that follow the formatted structure.
This | The EFI_SMBIOS_PROTOCOL instance. |
Head | Pointer to the beginning of SMBIOS structure. |
Size | The returned size. |
NumberOfStrings | The returned number of optional strings that follow the formatted structure. |
EFI_SUCCESS | Size retured in Size. |
EFI_INVALID_PARAMETER | Input SMBIOS structure mal-formed or Size is NULL. |
Definition at line 172 of file SmbiosDxe.c.
STATIC BOOLEAN IsValidSmbios20Table | ( | IN VOID * | TableEntry, |
OUT VOID ** | TableAddress, | ||
OUT UINTN * | TableMaximumSize, | ||
OUT UINT8 * | MajorVersion, | ||
OUT UINT8 * | MinorVersion | ||
) |
Validates a SMBIOS 2.0 table entry point.
TableEntry | The SmBios table entry to validate. |
TableAddress | On exit, point to the smbios table addres. |
TableMaximumSize | On exit, point to the maximum size of the table. |
TRUE | SMBIOS table entry point is valid. |
FALSE | SMBIOS table entry point is malformed. |
Definition at line 1451 of file SmbiosDxe.c.
STATIC BOOLEAN IsValidSmbios30Table | ( | IN VOID * | TableEntry, |
OUT VOID ** | TableAddress, | ||
OUT UINTN * | TableMaximumSize, | ||
OUT UINT8 * | MajorVersion, | ||
OUT UINT8 * | MinorVersion | ||
) |
Validates a SMBIOS 3.0 table entry point.
TableEntry | The SmBios table entry to validate. |
TableAddress | On exit, point to the smbios table addres. |
TableMaximumSize | On exit, point to the maximum size of the table. |
TRUE | SMBIOS table entry point is valid. |
FALSE | SMBIOS table entry point is malformed. |
Definition at line 1531 of file SmbiosDxe.c.
STATIC EFI_STATUS ParseAndAddExistingSmbiosTable | ( | IN EFI_HANDLE | ImageHandle, |
IN SMBIOS_STRUCTURE_POINTER | Smbios, | ||
IN UINTN | Length, | ||
IN UINT8 | MajorVersion, | ||
IN UINT8 | MinorVersion | ||
) |
Parse an existing SMBIOS table and insert it using SmbiosAdd.
ImageHandle | The EFI_HANDLE to this driver. |
Smbios | The SMBIOS table to parse. |
Length | The length of the SMBIOS table. |
EFI_SUCCESS | SMBIOS table was parsed and installed. |
EFI_OUT_OF_RESOURCES | Record was not added due to lack of system resources. |
EFI_INVALID_PARAMETER | Smbios is not a correct smbios table |
Definition at line 1589 of file SmbiosDxe.c.
EFI_STATUS RetrieveSmbiosFromHob | ( | IN EFI_HANDLE | ImageHandle | ) |
Retrieve SMBIOS from Hob.
ImageHandle | Module's image handle |
EFI_SUCCESS | Smbios from Hob is installed. |
Other | No Smbios from Hob is installed. |
Definition at line 1698 of file SmbiosDxe.c.
EFI_STATUS EFIAPI SmbiosAdd | ( | IN CONST EFI_SMBIOS_PROTOCOL * | This, |
IN EFI_HANDLE ProducerHandle | OPTIONAL, | ||
IN OUT EFI_SMBIOS_HANDLE * | SmbiosHandle, | ||
IN EFI_SMBIOS_TABLE_HEADER * | Record | ||
) |
Add an SMBIOS record.
This | The EFI_SMBIOS_PROTOCOL instance. |
ProducerHandle | The handle of the controller or driver associated with the SMBIOS information. NULL means no handle. |
SmbiosHandle | On entry, the handle of the SMBIOS record to add. If FFFEh, then a unique handle will be assigned to the SMBIOS record. If the SMBIOS handle is already in use, EFI_ALREADY_STARTED is returned and the SMBIOS record is not updated. |
Record | The data for the fixed portion of the SMBIOS record. The format of the record is determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or a set of null terminated strings and a null. |
EFI_SUCCESS | Record was added. |
EFI_OUT_OF_RESOURCES | Record was not added due to lack of system resources. |
EFI_ALREADY_STARTED | The SmbiosHandle passed in was already in use. |
Definition at line 356 of file SmbiosDxe.c.
EFI_STATUS EFIAPI SmbiosCreate64BitTable | ( | OUT VOID ** | TableEntryPointStructure | ) |
Assembles SMBIOS 64-bit table from the SMBIOS protocol. Produce Table Entry Point and return the pointer to it.
TableEntryPointStructure | On exit, points to the SMBIOS entrypoint structure. |
EFI_SUCCESS | Structure created sucessfully. |
EFI_OUT_OF_RESOURCES | No enough memory. |
Definition at line 1247 of file SmbiosDxe.c.
EFI_STATUS EFIAPI SmbiosCreateTable | ( | OUT VOID ** | TableEntryPointStructure | ) |
Assembles SMBIOS table from the SMBIOS protocol. Produce Table Entry Point and return the pointer to it.
TableEntryPointStructure | On exit, points to the SMBIOS entrypoint structure. |
EFI_SUCCESS | Structure created sucessfully. |
EFI_OUT_OF_RESOURCES | No enough memory. |
Definition at line 1048 of file SmbiosDxe.c.
EFI_STATUS EFIAPI SmbiosDriverEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Driver to produce Smbios protocol and pre-allocate 1 page for the final SMBIOS table.
ImageHandle | Module's image handle |
SystemTable | Pointer of EFI_SYSTEM_TABLE |
EFI_SUCCESS | Smbios protocol installed |
Other | No protocol installed, unload driver. |
Definition at line 1763 of file SmbiosDxe.c.
EFI_STATUS EFIAPI SmbiosGetNext | ( | IN CONST EFI_SMBIOS_PROTOCOL * | This, |
IN OUT EFI_SMBIOS_HANDLE * | SmbiosHandle, | ||
IN EFI_SMBIOS_TYPE *Type | OPTIONAL, | ||
OUT EFI_SMBIOS_TABLE_HEADER ** | Record, | ||
OUT EFI_HANDLE *ProducerHandle | OPTIONAL | ||
) |
Allow the caller to discover all or some of the SMBIOS records.
This | The EFI_SMBIOS_PROTOCOL instance. |
SmbiosHandle | On entry, points to the previous handle of the SMBIOS record. On exit, points to the next SMBIOS record handle. If it is FFFEh on entry, then the first SMBIOS record handle will be returned. If it returns FFFEh on exit, then there are no more SMBIOS records. |
Type | On entry it means return the next SMBIOS record of type Type. If a NULL is passed in this functionally it ignored. Type is not modified by the GetNext() function. |
Record | On exit, points to the SMBIOS Record consisting of the formatted area followed by the unformatted area. The unformatted area optionally contains text strings. |
ProducerHandle | On exit, points to the ProducerHandle registered by Add(). If no ProducerHandle was passed into Add() NULL is returned. If a NULL pointer is passed in no data will be returned |
EFI_SUCCESS | SMBIOS record information was successfully returned in Record. |
EFI_NOT_FOUND | The SMBIOS record with SmbiosHandle was the last available record. |
Definition at line 909 of file SmbiosDxe.c.
EFI_STATUS EFIAPI SmbiosRemove | ( | IN CONST EFI_SMBIOS_PROTOCOL * | This, |
IN EFI_SMBIOS_HANDLE | SmbiosHandle | ||
) |
Remove an SMBIOS record.
This | The EFI_SMBIOS_PROTOCOL instance. |
SmbiosHandle | The handle of the SMBIOS record to remove. |
EFI_SUCCESS | SMBIOS record was removed. |
EFI_INVALID_PARAMETER | SmbiosHandle does not specify a valid SMBIOS record. |
Definition at line 804 of file SmbiosDxe.c.
VOID EFIAPI SmbiosTableConstruction | ( | BOOLEAN | Smbios32BitTable, |
BOOLEAN | Smbios64BitTable | ||
) |
Create Smbios Table and installs the Smbios Table to the System Table.
Smbios32BitTable | The flag to update 32-bit table. |
Smbios64BitTable | The flag to update 64-bit table. |
Definition at line 1414 of file SmbiosDxe.c.
EFI_STATUS EFIAPI SmbiosUpdateString | ( | IN CONST EFI_SMBIOS_PROTOCOL * | This, |
IN EFI_SMBIOS_HANDLE * | SmbiosHandle, | ||
IN UINTN * | StringNumber, | ||
IN CHAR8 * | String | ||
) |
Update the string associated with an existing SMBIOS record.
This | The EFI_SMBIOS_PROTOCOL instance. |
SmbiosHandle | SMBIOS Handle of structure that will have its string updated. |
StringNumber | The non-zero string number of the string to update |
String | Update the StringNumber string with String. |
EFI_SUCCESS | SmbiosHandle had its StringNumber String updated. |
EFI_INVALID_PARAMETER | SmbiosHandle does not exist. |
EFI_UNSUPPORTED | String was not added because it is longer than the SMBIOS Table supports. |
EFI_NOT_FOUND | The StringNumber.is not valid for this SMBIOS record. |
Definition at line 550 of file SmbiosDxe.c.
SMBIOS_TABLE_ENTRY_POINT* EntryPointStructure = NULL |
Definition at line 25 of file SmbiosDxe.c.
SMBIOS_TABLE_ENTRY_POINT EntryPointStructureData |
Definition at line 26 of file SmbiosDxe.c.
IS_SMBIOS_TABLE_VALID_ENTRY mIsSmbiosTableValid[] |
Definition at line 152 of file SmbiosDxe.c.
UINTN mPre64BitAllocatedPages = 0 |
Definition at line 20 of file SmbiosDxe.c.
UINTN mPreAllocatedPages = 0 |
Definition at line 19 of file SmbiosDxe.c.
SMBIOS_INSTANCE mPrivateData |
Definition at line 17 of file SmbiosDxe.c.
SMBIOS_TABLE_3_0_ENTRY_POINT* Smbios30EntryPointStructure = NULL |
Definition at line 102 of file SmbiosDxe.c.
SMBIOS_TABLE_3_0_ENTRY_POINT Smbios30EntryPointStructureData |
Definition at line 103 of file SmbiosDxe.c.