]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscResetCapabilitiesFunction.c
MdePkg/UefiDebugLibConOut: make global variable static
[mirror_edk2.git] / Vlv2TbltDevicePkg / SmBiosMiscDxe / MiscResetCapabilitiesFunction.c
CommitLineData
3cbfba02
DW
1/*++\r
2\r
3Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
4 \r\r
9dc8036d
MK
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
3cbfba02
DW
7 \r\r
8\r
9Module Name:\r
10\r
11 MiscResetCapabilitiesFunction.c\r
12\r
13Abstract:\r
14\r
15 ResetCapabilities.\r
16 SMBIOS type 23.\r
17\r
18--*/\r
19\r
20\r
21#include "CommonHeader.h"\r
22\r
23#include "MiscSubclassDriver.h"\r
24\r
25/**\r
26 This function makes boot time changes to the contents of the\r
27 MiscOemString (Type 11).\r
28\r
29 @param RecordData Pointer to copy of RecordData from the Data Table.\r
30\r
31 @retval EFI_SUCCESS All parameters were valid.\r
32 @retval EFI_UNSUPPORTED Unexpected RecordType value.\r
33 @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r
34\r
35**/\r
36MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)\r
37{\r
38 EFI_STATUS Status;\r
39 EFI_SMBIOS_HANDLE SmbiosHandle;\r
40 SMBIOS_TABLE_TYPE23 *SmbiosRecord;\r
41 EFI_MISC_RESET_CAPABILITIES *ForType23InputData;\r
42\r
43 ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;\r
44\r
45 //\r
46 // First check for invalid parameters.\r
47 //\r
48 if (RecordData == NULL) {\r
49 return EFI_INVALID_PARAMETER;\r
50 }\r
51\r
52\r
53 //\r
54 // Two zeros following the last string.\r
55 //\r
56 SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r
57 ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r
58\r
59 SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;\r
60 SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);\r
61\r
62 //\r
63 // Make handle chosen by smbios protocol.add automatically.\r
64 //\r
65 SmbiosRecord->Hdr.Handle = 0;\r
66 SmbiosRecord->Capabilities = *(UINT8*)&(ForType23InputData->ResetCapabilities);\r
67 SmbiosRecord->ResetCount = (UINT16)ForType23InputData->ResetCount;\r
68 SmbiosRecord->ResetLimit = (UINT16)ForType23InputData->ResetLimit;\r
69 SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;\r
70 SmbiosRecord->Timeout = (UINT16)ForType23InputData->ResetTimeout;\r
71\r
72 //\r
73 // Now we have got the full smbios record, call smbios protocol to add this record.\r
74 //\r
75 SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
76 Status = Smbios-> Add(\r
77 Smbios,\r
78 NULL,\r
79 &SmbiosHandle,\r
80 (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
81 );\r
82 FreePool(SmbiosRecord);\r
83 return Status;\r
84}\r
85\r