3 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 MiscResetCapabilitiesFunction.c
26 #include "CommonHeader.h"
28 #include "MiscSubclassDriver.h"
30 This function makes boot time changes to the contents of the
31 MiscOemString (Type 11).
33 @param RecordData Pointer to copy of RecordData from the Data Table.
35 @retval EFI_SUCCESS All parameters were valid.
36 @retval EFI_UNSUPPORTED Unexpected RecordType value.
37 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
41 MISC_SMBIOS_TABLE_FUNCTION(SystemLanguageString
)
44 EFI_SMBIOS_HANDLE SmbiosHandle
;
45 SMBIOS_TABLE_TYPE13
*SmbiosRecord
;
47 CHAR8
*OptionalStrStart
;
49 STRING_REF TokenToGet
;
53 // First check for invalid parameters.
55 if (RecordData
== NULL
) {
56 return EFI_INVALID_PARAMETER
;
59 TokenToGet
= STRING_TOKEN (STR_MISC_SYSTEM_LANGUAGE_EN_US
);
60 Str
= SmbiosMiscGetString (TokenToGet
);
61 StrLeng
= StrLen(Str
);
62 if (StrLeng
> SMBIOS_STRING_MAX_LENGTH
) {
63 return EFI_UNSUPPORTED
;
67 // Two zeros following the last string.
69 SmbiosRecord
= AllocatePool(sizeof (SMBIOS_TABLE_TYPE13
) + StrLeng
+ 1 + 1);
70 ZeroMem(SmbiosRecord
, sizeof (SMBIOS_TABLE_TYPE13
) + StrLeng
+ 1 + 1);
72 SmbiosRecord
->Hdr
.Type
= EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION
;
73 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE13
);
76 // Make handle chosen by smbios protocol.add automatically.
78 SmbiosRecord
->Hdr
.Handle
= 0;
79 SmbiosRecord
->InstallableLanguages
= 1;
80 SmbiosRecord
->Flags
= 1;
81 SmbiosRecord
->CurrentLanguages
= 1;
82 OptionalStrStart
= (CHAR8
*)(SmbiosRecord
+ 1);
83 UnicodeStrToAsciiStr(Str
, OptionalStrStart
);
86 // Now we have got the full smbios record, call smbios protocol to add this record.
88 SmbiosHandle
= SMBIOS_HANDLE_PI_RESERVED
;
89 Status
= Smbios
-> Add(
93 (EFI_SMBIOS_TABLE_HEADER
*) SmbiosRecord
95 FreePool(SmbiosRecord
);