]> git.proxmox.com Git - mirror_edk2.git/blame - UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
According to PI errata 0000654 and 000811, we need use 0xFFFE to instead of 0 for...
[mirror_edk2.git] / UnixPkg / MiscSubClassPlatformDxe / MiscResetCapabilitiesFunction.c
CommitLineData
1adf568b 1/** @file\r
aaa2cc19 2 ResetCapabilities.\r
3 SMBIOS type 23.\r
4\r
a762a877 5 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
f9b8ab56 6 This program and the accompanying materials\r
1adf568b 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
aaa2cc19 13\r
1adf568b 14**/\r
aaa2cc19 15\r
16#include "MiscSubClassDriver.h"\r
17/**\r
18 This function makes boot time changes to the contents of the\r
19 MiscOemString (Type 11).\r
20\r
21 @param RecordData Pointer to copy of RecordData from the Data Table. \r
22\r
23 @retval EFI_SUCCESS All parameters were valid.\r
24 @retval EFI_UNSUPPORTED Unexpected RecordType value.\r
25 @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r
26\r
27**/\r
28MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)\r
29{\r
30 EFI_STATUS Status;\r
31 EFI_SMBIOS_HANDLE SmbiosHandle;\r
32 SMBIOS_TABLE_TYPE23 *SmbiosRecord;\r
33 EFI_MISC_RESET_CAPABILITIES *ForType23InputData;\r
34 \r
35 ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;\r
36\r
37 //\r
38 // First check for invalid parameters.\r
39 //\r
40 if (RecordData == NULL) {\r
41 return EFI_INVALID_PARAMETER;\r
42 }\r
43\r
44\r
45 //\r
46 // Two zeros following the last string.\r
47 //\r
48 SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r
49 ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r
50\r
51 SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;\r
52 SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);\r
53 //\r
54 // Make handle chosen by smbios protocol.add automatically.\r
55 // \r
56 SmbiosRecord->Hdr.Handle = 0; \r
57 SmbiosRecord->Capabilities = *(UINT8*)&(ForType23InputData->ResetCapabilities);\r
58 SmbiosRecord->ResetCount = (UINT16)ForType23InputData->ResetCount;\r
59 SmbiosRecord->ResetLimit = (UINT16)ForType23InputData->ResetLimit; \r
60 SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;\r
61 SmbiosRecord->Timeout = (UINT16)ForType23InputData->ResetTimeout;\r
62\r
63 //\r
64 // Now we have got the full smbios record, call smbios protocol to add this record.\r
65 //\r
a762a877
SZ
66 Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
67\r
aaa2cc19 68 FreePool(SmbiosRecord);\r
69 return Status;\r
70}\r
71\r