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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI StringTableAddString (IN STRING_TABLE *CONST StrTable, IN CONST CHAR8 *Str, OUT UINT8 *StrRef OPTIONAL)
 
UINTN EFIAPI StringTableGetStringSetSize (IN STRING_TABLE *CONST StrTable)
 
EFI_STATUS EFIAPI StringTablePublishStringSet (IN STRING_TABLE *CONST StrTable, IN CHAR8 *CONST SmbiosStringAreaStart, IN CONST UINTN SmbiosStringAreaSize)
 
EFI_STATUS EFIAPI StringTableInitialize (IN STRING_TABLE *CONST StrTable, IN UINTN MaxStringElements)
 
EFI_STATUS EFIAPI StringTableFree (IN STRING_TABLE *CONST StrTable)
 

Detailed Description

SMBIOS String Table Helper

Copyright (c) 2022, Arm Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
  • DSP0134 - SMBIOS Specification Version 3.6.0, 2022-06-17

Definition in file SmbiosStringTableLib.c.

Function Documentation

◆ StringTableAddString()

EFI_STATUS EFIAPI StringTableAddString ( IN STRING_TABLE *CONST  StrTable,
IN CONST CHAR8 *  Str,
OUT UINT8 *StrRef  OPTIONAL 
)

Add a string to the string table.

Parameters
[in]StrTablePointer to the string table
[in]StrPointer to the string
[out]StrRefOptional pointer to retrieve the string field reference of the string in the string table
Returns
EFI_SUCCESS Success
EFI_INVALID_PARAMETER Invalid string table pointer
EFI_BUFFER_TOO_SMALL Insufficient space to add string

Definition at line 31 of file SmbiosStringTableLib.c.

◆ StringTableFree()

EFI_STATUS EFIAPI StringTableFree ( IN STRING_TABLE *CONST  StrTable)

Free memory allocated for the string elements in the string table.

Parameters
[in]StrTablePointer to the string table
Returns
EFI_SUCCESS Success
EFI_INVALID_PARAMETER Invalid string table pointer or string elements

Definition at line 216 of file SmbiosStringTableLib.c.

◆ StringTableGetStringSetSize()

UINTN EFIAPI StringTableGetStringSetSize ( IN STRING_TABLE *CONST  StrTable)

Returns the total size required to publish the strings to the SMBIOS string area.

Parameters
[in]StrTablePointer to the string table
Returns
Total size required to publish the strings in the SMBIOS string area.

Definition at line 81 of file SmbiosStringTableLib.c.

◆ StringTableInitialize()

EFI_STATUS EFIAPI StringTableInitialize ( IN STRING_TABLE *CONST  StrTable,
IN UINTN  MaxStringElements 
)

Initialise the string table and allocate memory for the string elements.

Parameters
[in]StrTablePointer to the string table
[in]MaxStringElementsMaximum number of strings that the string table can hold.
Returns
EFI_SUCCESS Success
EFI_INVALID_PARAMETER Invalid string table pointer
EFI_OUT_OF_RESOURCES Failed to allocate memory for string elements

Definition at line 182 of file SmbiosStringTableLib.c.

◆ StringTablePublishStringSet()

EFI_STATUS EFIAPI StringTablePublishStringSet ( IN STRING_TABLE *CONST  StrTable,
IN CHAR8 *CONST  SmbiosStringAreaStart,
IN CONST UINTN  SmbiosStringAreaSize 
)

Iterate through the string table and publish the strings in the SMBIOS string area.

Parameters
[in]StrTablePointer to the string table
[in]SmbiosStringAreaStartStart address of the SMBIOS string area.
[in]SmbiosStringAreaSizeSize of the SMBIOS string area.
Returns
EFI_SUCCESS Success
EFI_INVALID_PARAMETER Invalid string table pointer
EFI_BUFFER_TOO_SMALL Insufficient space to publish strings

Definition at line 120 of file SmbiosStringTableLib.c.