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