]>
Commit | Line | Data |
---|---|---|
3cbfba02 DW |
1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r | |
4 | \r\r | |
5 | This program and the accompanying materials are licensed and made available under\r\r | |
6 | the terms and conditions of the BSD License that accompanies this distribution. \r\r | |
7 | The full text of the license may be found at \r\r | |
8 | http://opensource.org/licenses/bsd-license.php. \r\r | |
9 | \r\r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r\r | |
12 | \r\r | |
13 | \r | |
14 | Module Name:\r | |
15 | \r | |
16 | MiscResetCapabilitiesFunction.c\r | |
17 | \r | |
18 | Abstract:\r | |
19 | \r | |
20 | ResetCapabilities.\r | |
21 | SMBIOS type 23.\r | |
22 | \r | |
23 | --*/\r | |
24 | \r | |
25 | \r | |
26 | #include "CommonHeader.h"\r | |
27 | \r | |
28 | #include "MiscSubclassDriver.h"\r | |
29 | \r | |
30 | /**\r | |
31 | This function makes boot time changes to the contents of the\r | |
32 | MiscOemString (Type 11).\r | |
33 | \r | |
34 | @param RecordData Pointer to copy of RecordData from the Data Table.\r | |
35 | \r | |
36 | @retval EFI_SUCCESS All parameters were valid.\r | |
37 | @retval EFI_UNSUPPORTED Unexpected RecordType value.\r | |
38 | @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r | |
39 | \r | |
40 | **/\r | |
41 | MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)\r | |
42 | {\r | |
43 | EFI_STATUS Status;\r | |
44 | EFI_SMBIOS_HANDLE SmbiosHandle;\r | |
45 | SMBIOS_TABLE_TYPE23 *SmbiosRecord;\r | |
46 | EFI_MISC_RESET_CAPABILITIES *ForType23InputData;\r | |
47 | \r | |
48 | ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;\r | |
49 | \r | |
50 | //\r | |
51 | // First check for invalid parameters.\r | |
52 | //\r | |
53 | if (RecordData == NULL) {\r | |
54 | return EFI_INVALID_PARAMETER;\r | |
55 | }\r | |
56 | \r | |
57 | \r | |
58 | //\r | |
59 | // Two zeros following the last string.\r | |
60 | //\r | |
61 | SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r | |
62 | ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r | |
63 | \r | |
64 | SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;\r | |
65 | SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);\r | |
66 | \r | |
67 | //\r | |
68 | // Make handle chosen by smbios protocol.add automatically.\r | |
69 | //\r | |
70 | SmbiosRecord->Hdr.Handle = 0;\r | |
71 | SmbiosRecord->Capabilities = *(UINT8*)&(ForType23InputData->ResetCapabilities);\r | |
72 | SmbiosRecord->ResetCount = (UINT16)ForType23InputData->ResetCount;\r | |
73 | SmbiosRecord->ResetLimit = (UINT16)ForType23InputData->ResetLimit;\r | |
74 | SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;\r | |
75 | SmbiosRecord->Timeout = (UINT16)ForType23InputData->ResetTimeout;\r | |
76 | \r | |
77 | //\r | |
78 | // Now we have got the full smbios record, call smbios protocol to add this record.\r | |
79 | //\r | |
80 | SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r | |
81 | Status = Smbios-> Add(\r | |
82 | Smbios,\r | |
83 | NULL,\r | |
84 | &SmbiosHandle,\r | |
85 | (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r | |
86 | );\r | |
87 | FreePool(SmbiosRecord);\r | |
88 | return Status;\r | |
89 | }\r | |
90 | \r |