2 Provides library functions for common SMBIOS operations. Only available to DXE
6 Copyright (c) 2012, Apple Inc. All rights reserved.
7 Portitions Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials are licensed and made available under
9 the terms and conditions of the BSD License that accompanies this distribution.
10 The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php.
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef _SMBIOS_LIB_H__
19 #define _SMBIOS_LIB_H__
21 #include <IndustryStandard/Smbios.h>
22 #include <Protocol/Smbios.h>
26 SMBIOS_STRUCTURE
*Entry
;
28 } SMBIOS_TEMPLATE_ENTRY
;
32 InitializeSmbiosTableFromTemplate (
33 IN SMBIOS_TEMPLATE_ENTRY
*template
41 Converts a fixed SMBIOS structure and an array of pointers to strings into
42 an SMBIOS record where the strings are cat'ed on the end of the fixed record
43 and terminated via a double NULL and add to SMBIOS table.
45 SMBIOS_TABLE_TYPE32 gSmbiosType12 = {
46 { EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS, sizeof (SMBIOS_TABLE_TYPE12), 0 },
49 CHAR8 *gSmbiosType12Strings[] = {
55 AddSmbiosEntryFromTemplate (
56 (EFI_SMBIOS_TABLE_HEADER*)&gSmbiosType12,
60 @param SmbiosEntry Fixed SMBIOS structure
61 @param StringArray Array of strings to convert to an SMBIOS string pack.
67 IN SMBIOS_STRUCTURE
*SmbiosEntry
,
68 IN CHAR8
**StringArray
74 Update the string associated with an existing SMBIOS record.
76 This function allows the update of specific SMBIOS strings. The number of valid strings for any
77 SMBIOS record is defined by how many strings were present when Add() was called.
79 @param[in] SmbiosHandle SMBIOS Handle of structure that will have its string updated.
80 @param[in] StringNumber The non-zero string number of the string to update.
81 @param[in] String Update the StringNumber string with String.
83 @retval EFI_SUCCESS SmbiosHandle had its StringNumber String updated.
84 @retval EFI_INVALID_PARAMETER SmbiosHandle does not exist. Or String is invalid.
85 @retval EFI_UNSUPPORTED String was not added because it is longer than the SMBIOS Table supports.
86 @retval EFI_NOT_FOUND The StringNumber.is not valid for this SMBIOS record.
90 IN EFI_SMBIOS_HANDLE SmbiosHandle
,
91 IN SMBIOS_TABLE_STRING StringNumber
,
96 Update the string associated with an existing SMBIOS record.
98 This function allows the update of specific SMBIOS strings. The number of valid strings for any
99 SMBIOS record is defined by how many strings were present when Add() was called.
101 @param[in] SmbiosHandle SMBIOS Handle of structure that will have its string updated.
102 @param[in] StringNumber The non-zero string number of the string to update.
103 @param[in] String Update the StringNumber string with String.
105 @retval EFI_SUCCESS SmbiosHandle had its StringNumber String updated.
106 @retval EFI_INVALID_PARAMETER SmbiosHandle does not exist. Or String is invalid.
107 @retval EFI_UNSUPPORTED String was not added because it is longer than the SMBIOS Table supports.
108 @retval EFI_NOT_FOUND The StringNumber.is not valid for this SMBIOS record.
111 SmbiosUpdateUnicodeString (
112 IN EFI_SMBIOS_HANDLE SmbiosHandle
,
113 IN SMBIOS_TABLE_STRING StringNumber
,
118 Allow caller to read a specific SMBIOS string
120 @param[in] Header SMBIOS record that contains the string.
121 @param[in[ Intance Instance of SMBIOS string 0 - N-1.
123 @retval NULL Instance of Type SMBIOS string was not found.
124 @retval Other Pointer to matching SMBIOS string.
128 IN SMBIOS_STRUCTURE
*Header
,
134 Allow the caller to discover a specific SMBIOS entry, and patch it if necissary.
136 @param[in] Type Type of the next SMBIOS record to return.
137 @param[in[ Instance Instance of SMBIOS record 0 - N-1.
138 @param[out] SmbiosHandle Returns SMBIOS handle for the matching record.
140 @retval NULL Instance of Type SMBIOS record was not found.
141 @retval Other Pointer to matching SMBIOS record.
146 IN EFI_SMBIOS_TYPE Type
,
148 OUT EFI_SMBIOS_HANDLE
*SmbiosHandle
152 Remove an SMBIOS record.
154 This function removes an SMBIOS record using the handle specified by SmbiosHandle.
156 @param[in] SmbiosHandle The handle of the SMBIOS record to remove.
158 @retval EFI_SUCCESS SMBIOS record was removed.
159 @retval EFI_INVALID_PARAMETER SmbiosHandle does not specify a valid SMBIOS record.
164 OUT EFI_SMBIOS_HANDLE SmbiosHandle
171 OUT UINT8
*SmbiosMajorVersion
,
172 OUT UINT8
*SmbiosMinorVersion