Files
slimbootloader/BootloaderCorePkg/Include/Library/SmbiosInitLib.h
T
Sai T b9422c7969 Enhance Smbios Init Lib
This patch does the following updates to SmBiosInitLib:

  1. Provide AddSmbiosType() to add a SmBios Type header.
  2. Provide AddSmbiosString() to append strings to Type header.
  3. Move Finalize() to after 'PrePayloadLoading' board init phase.
     All Smbios related calls need to be done before this.
  4. Modified TGL project to adjust to these changes.

Signed-off-by: Sai T <sai.kiran.talamudupula@intel.com>
2021-11-16 12:35:12 -08:00

98 lines
2.0 KiB
C

/** @file
Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __SMBIOS_INIT_LIB_H__
#define __SMBIOS_INIT_LIB_H__
#include <IndustryStandard/SmBios.h>
#pragma pack(1)
typedef struct {
UINT8 Type;
UINT8 Idx;
CHAR8 *String;
} SMBIOS_TYPE_STRINGS;
#pragma pack()
/**
After adding and appending all Smbios Types, we need to do the following
1. Check for the table overflow
2. Add Type 127
3. Adjust the TotalLength in entry point struct
4. Update entry point & intermediate checksum
@param[in] NewMaxStructSize Maximum type size of all the types added , if called from SmbiosInit
Type Length of the current table appended , if called from AppendSmbiosType
@retval EFI_DEVICE_ERROR, if Smbios Entry is NULL
Overflow status , otherwise
**/
EFI_STATUS
FinalizeSmbios (
VOID
);
/**
Append a string to an Smbios type header
@param[in] Type Type to which a string is appended
@param[in] String String literal to be appended
@retval EFI_SUCCESS, if string is appended successfully
EFI_ERROR, otherwise
**/
EFI_STATUS
EFIAPI
AddSmbiosString (
IN UINT8 Type,
IN CHAR8 *String
);
/**
Add a particular Smbios type to the Smbios allocated region.
@param[in] HdrInfo Address of the type being added
@retval EFI_SUCCESS, if Type added successfully,
EFI_ERROR, otherwise
**/
EFI_STATUS
EFIAPI
AddSmbiosType (
IN VOID *HdrInfo
);
/**
This function is called to initialize the SmbiosStringsPtr.
**/
VOID
EFIAPI
InitSmbiosStringPtr (
VOID
);
/**
This function is called to initialize the SMBIOS tables.
@retval EFI_DEVICE_ERROR, if Smbios Entry is NULL
Status after finalizing the Smbios init
**/
EFI_STATUS
EFIAPI
SmbiosInit (
VOID
);
#endif