3 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 MiscResetCapabilitiesFunction.c
21 #include "CommonHeader.h"
23 #include "MiscSubclassDriver.h"
25 This function makes boot time changes to the contents of the
26 MiscOemString (Type 11).
28 @param RecordData Pointer to copy of RecordData from the Data Table.
30 @retval EFI_SUCCESS All parameters were valid.
31 @retval EFI_UNSUPPORTED Unexpected RecordType value.
32 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
36 MISC_SMBIOS_TABLE_FUNCTION(SystemLanguageString
)
39 EFI_SMBIOS_HANDLE SmbiosHandle
;
40 SMBIOS_TABLE_TYPE13
*SmbiosRecord
;
42 CHAR8
*OptionalStrStart
;
44 STRING_REF TokenToGet
;
48 // First check for invalid parameters.
50 if (RecordData
== NULL
) {
51 return EFI_INVALID_PARAMETER
;
54 TokenToGet
= STRING_TOKEN (STR_MISC_SYSTEM_LANGUAGE_EN_US
);
55 Str
= SmbiosMiscGetString (TokenToGet
);
56 StrLeng
= StrLen(Str
);
57 if (StrLeng
> SMBIOS_STRING_MAX_LENGTH
) {
58 return EFI_UNSUPPORTED
;
62 // Two zeros following the last string.
64 SmbiosRecord
= AllocatePool(sizeof (SMBIOS_TABLE_TYPE13
) + StrLeng
+ 1 + 1);
65 ZeroMem(SmbiosRecord
, sizeof (SMBIOS_TABLE_TYPE13
) + StrLeng
+ 1 + 1);
67 SmbiosRecord
->Hdr
.Type
= EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION
;
68 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE13
);
71 // Make handle chosen by smbios protocol.add automatically.
73 SmbiosRecord
->Hdr
.Handle
= 0;
74 SmbiosRecord
->InstallableLanguages
= 1;
75 SmbiosRecord
->Flags
= 1;
76 SmbiosRecord
->CurrentLanguages
= 1;
77 OptionalStrStart
= (CHAR8
*)(SmbiosRecord
+ 1);
78 UnicodeStrToAsciiStr(Str
, OptionalStrStart
);
81 // Now we have got the full smbios record, call smbios protocol to add this record.
83 SmbiosHandle
= SMBIOS_HANDLE_PI_RESERVED
;
84 Status
= Smbios
-> Add(
88 (EFI_SMBIOS_TABLE_HEADER
*) SmbiosRecord
90 FreePool(SmbiosRecord
);