]>
Commit | Line | Data |
---|---|---|
5e973c96 | 1 | /** @file\r |
1fdd39d3 | 2 | boot information boot time changes.\r |
3 | SMBIOS type 11.\r | |
5e973c96 | 4 | \r |
7ee85aa2 | 5 | Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r |
8f2a5f80 | 6 | This program and the accompanying materials\r |
5e973c96 | 7 | are licensed and made available under the terms and conditions of the BSD License\r |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
1fdd39d3 | 13 | \r |
5e973c96 | 14 | **/\r |
1fdd39d3 | 15 | \r |
16 | \r | |
17 | #include "MiscSubclassDriver.h"\r | |
18 | /**\r | |
19 | This function makes boot time changes to the contents of the\r | |
20 | MiscOemString (Type 11).\r | |
21 | \r | |
22 | @param RecordData Pointer to copy of RecordData from the Data Table. \r | |
23 | \r | |
24 | @retval EFI_SUCCESS All parameters were valid.\r | |
25 | @retval EFI_UNSUPPORTED Unexpected RecordType value.\r | |
26 | @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r | |
27 | \r | |
28 | **/\r | |
29 | MISC_SMBIOS_TABLE_FUNCTION(OemString)\r | |
30 | {\r | |
31 | UINTN OemStrLen;\r | |
32 | CHAR8 *OptionalStrStart;\r | |
33 | EFI_STATUS Status;\r | |
34 | EFI_STRING OemStr;\r | |
35 | STRING_REF TokenToGet;\r | |
36 | EFI_SMBIOS_HANDLE SmbiosHandle;\r | |
37 | SMBIOS_TABLE_TYPE11 *SmbiosRecord;\r | |
38 | \r | |
39 | //\r | |
40 | // First check for invalid parameters.\r | |
41 | //\r | |
42 | if (RecordData == NULL) {\r | |
43 | return EFI_INVALID_PARAMETER;\r | |
44 | }\r | |
45 | \r | |
46 | TokenToGet = STRING_TOKEN (STR_MISC_OEM_STRING);\r | |
47 | OemStr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r | |
48 | OemStrLen = StrLen(OemStr);\r | |
49 | if (OemStrLen > SMBIOS_STRING_MAX_LENGTH) {\r | |
50 | return EFI_UNSUPPORTED;\r | |
51 | }\r | |
52 | \r | |
53 | //\r | |
54 | // Two zeros following the last string.\r | |
55 | //\r | |
56 | SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);\r | |
57 | ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);\r | |
58 | \r | |
59 | SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_OEM_STRINGS;\r | |
60 | SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE11);\r | |
61 | //\r | |
62 | // Make handle chosen by smbios protocol.add automatically.\r | |
63 | // \r | |
64 | SmbiosRecord->Hdr.Handle = 0; \r | |
65 | SmbiosRecord->StringCount = 1;\r | |
66 | OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r | |
67 | UnicodeStrToAsciiStr(OemStr, OptionalStrStart);\r | |
68 | \r | |
69 | //\r | |
70 | // Now we have got the full smbios record, call smbios protocol to add this record.\r | |
71 | //\r | |
7ee85aa2 SZ |
72 | Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r |
73 | \r | |
1fdd39d3 | 74 | FreePool(SmbiosRecord);\r |
75 | return Status;\r | |
76 | }\r |