]>
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 |
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(MiscResetCapabilities)\r | |
30 | {\r | |
31 | EFI_STATUS Status;\r | |
32 | EFI_SMBIOS_HANDLE SmbiosHandle;\r | |
33 | SMBIOS_TABLE_TYPE23 *SmbiosRecord;\r | |
34 | EFI_MISC_RESET_CAPABILITIES *ForType23InputData;\r | |
35 | \r | |
36 | ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;\r | |
37 | \r | |
38 | //\r | |
39 | // First check for invalid parameters.\r | |
40 | //\r | |
41 | if (RecordData == NULL) {\r | |
42 | return EFI_INVALID_PARAMETER;\r | |
43 | }\r | |
44 | \r | |
45 | \r | |
46 | //\r | |
47 | // Two zeros following the last string.\r | |
48 | //\r | |
49 | SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r | |
50 | ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r | |
51 | \r | |
52 | SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;\r | |
53 | SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);\r | |
54 | //\r | |
55 | // Make handle chosen by smbios protocol.add automatically.\r | |
56 | // \r | |
57 | SmbiosRecord->Hdr.Handle = 0; \r | |
58 | SmbiosRecord->Capabilities = *(UINT8*)&(ForType23InputData->ResetCapabilities);\r | |
59 | SmbiosRecord->ResetCount = (UINT16)ForType23InputData->ResetCount;\r | |
60 | SmbiosRecord->ResetLimit = (UINT16)ForType23InputData->ResetLimit; \r | |
61 | SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;\r | |
62 | SmbiosRecord->Timeout = (UINT16)ForType23InputData->ResetTimeout;\r | |
63 | \r | |
64 | //\r | |
65 | // Now we have got the full smbios record, call smbios protocol to add this record.\r | |
66 | //\r | |
7ee85aa2 SZ |
67 | Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r |
68 | \r | |
1fdd39d3 | 69 | FreePool(SmbiosRecord);\r |
70 | return Status;\r | |
71 | }\r | |
72 | \r |