]>
Commit | Line | Data |
---|---|---|
5e973c96 | 1 | /** @file\r |
1fdd39d3 | 2 | ResetCapabilities.\r |
3 | SMBIOS type 23.\r | |
5e973c96 | 4 | \r |
7ee85aa2 | 5 | Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r |
9d2eedba | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
1fdd39d3 | 7 | \r |
5e973c96 | 8 | **/\r |
1fdd39d3 | 9 | \r |
10 | \r | |
11 | #include "MiscSubclassDriver.h"\r | |
12 | /**\r | |
13 | This function makes boot time changes to the contents of the\r | |
14 | MiscOemString (Type 11).\r | |
15 | \r | |
16 | @param RecordData Pointer to copy of RecordData from the Data Table. \r | |
17 | \r | |
18 | @retval EFI_SUCCESS All parameters were valid.\r | |
19 | @retval EFI_UNSUPPORTED Unexpected RecordType value.\r | |
20 | @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r | |
21 | \r | |
22 | **/\r | |
23 | MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)\r | |
24 | {\r | |
25 | EFI_STATUS Status;\r | |
26 | EFI_SMBIOS_HANDLE SmbiosHandle;\r | |
27 | SMBIOS_TABLE_TYPE23 *SmbiosRecord;\r | |
28 | EFI_MISC_RESET_CAPABILITIES *ForType23InputData;\r | |
29 | \r | |
30 | ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;\r | |
31 | \r | |
32 | //\r | |
33 | // First check for invalid parameters.\r | |
34 | //\r | |
35 | if (RecordData == NULL) {\r | |
36 | return EFI_INVALID_PARAMETER;\r | |
37 | }\r | |
38 | \r | |
39 | \r | |
40 | //\r | |
41 | // Two zeros following the last string.\r | |
42 | //\r | |
43 | SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r | |
44 | ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r | |
45 | \r | |
46 | SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;\r | |
47 | SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);\r | |
48 | //\r | |
49 | // Make handle chosen by smbios protocol.add automatically.\r | |
50 | // \r | |
51 | SmbiosRecord->Hdr.Handle = 0; \r | |
52 | SmbiosRecord->Capabilities = *(UINT8*)&(ForType23InputData->ResetCapabilities);\r | |
53 | SmbiosRecord->ResetCount = (UINT16)ForType23InputData->ResetCount;\r | |
54 | SmbiosRecord->ResetLimit = (UINT16)ForType23InputData->ResetLimit; \r | |
55 | SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;\r | |
56 | SmbiosRecord->Timeout = (UINT16)ForType23InputData->ResetTimeout;\r | |
57 | \r | |
58 | //\r | |
59 | // Now we have got the full smbios record, call smbios protocol to add this record.\r | |
60 | //\r | |
7ee85aa2 SZ |
61 | Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r |
62 | \r | |
1fdd39d3 | 63 | FreePool(SmbiosRecord);\r |
64 | return Status;\r | |
65 | }\r | |
66 | \r |