3 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 MiscResetCapabilitiesFunction.c
21 #include "CommonHeader.h"
23 #include "MiscSubclassDriver.h"
26 This function makes boot time changes to the contents of the
27 MiscOemString (Type 11).
29 @param RecordData Pointer to copy of RecordData from the Data Table.
31 @retval EFI_SUCCESS All parameters were valid.
32 @retval EFI_UNSUPPORTED Unexpected RecordType value.
33 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
36 MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities
)
39 EFI_SMBIOS_HANDLE SmbiosHandle
;
40 SMBIOS_TABLE_TYPE23
*SmbiosRecord
;
41 EFI_MISC_RESET_CAPABILITIES
*ForType23InputData
;
43 ForType23InputData
= (EFI_MISC_RESET_CAPABILITIES
*)RecordData
;
46 // First check for invalid parameters.
48 if (RecordData
== NULL
) {
49 return EFI_INVALID_PARAMETER
;
54 // Two zeros following the last string.
56 SmbiosRecord
= AllocatePool(sizeof (SMBIOS_TABLE_TYPE23
) + 1 + 1);
57 ZeroMem(SmbiosRecord
, sizeof (SMBIOS_TABLE_TYPE23
) + 1 + 1);
59 SmbiosRecord
->Hdr
.Type
= EFI_SMBIOS_TYPE_SYSTEM_RESET
;
60 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE23
);
63 // Make handle chosen by smbios protocol.add automatically.
65 SmbiosRecord
->Hdr
.Handle
= 0;
66 SmbiosRecord
->Capabilities
= *(UINT8
*)&(ForType23InputData
->ResetCapabilities
);
67 SmbiosRecord
->ResetCount
= (UINT16
)ForType23InputData
->ResetCount
;
68 SmbiosRecord
->ResetLimit
= (UINT16
)ForType23InputData
->ResetLimit
;
69 SmbiosRecord
->TimerInterval
= (UINT16
)ForType23InputData
->ResetTimerInterval
;
70 SmbiosRecord
->Timeout
= (UINT16
)ForType23InputData
->ResetTimeout
;
73 // Now we have got the full smbios record, call smbios protocol to add this record.
75 SmbiosHandle
= SMBIOS_HANDLE_PI_RESERVED
;
76 Status
= Smbios
-> Add(
80 (EFI_SMBIOS_TABLE_HEADER
*) SmbiosRecord
82 FreePool(SmbiosRecord
);