2 boot information boot time changes.
5 Copyright (c) 2013-2016 Intel Corporation.
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include "CommonHeader.h"
19 #include "SmbiosMisc.h"
22 This function makes boot time changes to the contents of the
23 MiscOemString (Type 11).
25 @param RecordData Pointer to copy of RecordData from the Data Table.
27 @retval EFI_SUCCESS All parameters were valid.
28 @retval EFI_UNSUPPORTED Unexpected RecordType value.
29 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
32 MISC_SMBIOS_TABLE_FUNCTION(MiscOemString
)
35 CHAR8
*OptionalStrStart
;
38 STRING_REF TokenToGet
;
39 EFI_SMBIOS_HANDLE SmbiosHandle
;
40 SMBIOS_TABLE_TYPE11
*SmbiosRecord
;
43 // First check for invalid parameters.
45 if (RecordData
== NULL
) {
46 return EFI_INVALID_PARAMETER
;
49 TokenToGet
= STRING_TOKEN (STR_MISC_OEM_EN_US
);
50 OemStr
= HiiGetPackageString(&gEfiCallerIdGuid
, TokenToGet
, NULL
);
51 OemStrLen
= StrLen(OemStr
);
52 if (OemStrLen
> SMBIOS_STRING_MAX_LENGTH
) {
53 return EFI_UNSUPPORTED
;
57 // Two zeros following the last string.
59 SmbiosRecord
= AllocatePool(sizeof (SMBIOS_TABLE_TYPE11
) + OemStrLen
+ 1 + 1);
60 ZeroMem(SmbiosRecord
, sizeof (SMBIOS_TABLE_TYPE11
) + OemStrLen
+ 1 + 1);
62 SmbiosRecord
->Hdr
.Type
= EFI_SMBIOS_TYPE_OEM_STRINGS
;
63 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE11
);
65 // Make handle chosen by smbios protocol.add automatically.
67 SmbiosRecord
->Hdr
.Handle
= 0;
68 SmbiosRecord
->StringCount
= 1;
69 OptionalStrStart
= (CHAR8
*)(SmbiosRecord
+ 1);
70 UnicodeStrToAsciiStr(OemStr
, OptionalStrStart
);
73 // Now we have got the full smbios record, call smbios protocol to add this record.
75 SmbiosHandle
= SMBIOS_HANDLE_PI_RESERVED
;
76 Status
= Smbios
-> Add(
80 (EFI_SMBIOS_TABLE_HEADER
*) SmbiosRecord
82 FreePool(SmbiosRecord
);