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