3 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 MiscResetCapabilitiesFunction.c
26 #include "CommonHeader.h"
28 #include "MiscSubclassDriver.h"
31 This function makes boot time changes to the contents of the
32 MiscOemString (Type 11).
34 @param RecordData Pointer to copy of RecordData from the Data Table.
36 @retval EFI_SUCCESS All parameters were valid.
37 @retval EFI_UNSUPPORTED Unexpected RecordType value.
38 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
41 MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities
)
44 EFI_SMBIOS_HANDLE SmbiosHandle
;
45 SMBIOS_TABLE_TYPE23
*SmbiosRecord
;
46 EFI_MISC_RESET_CAPABILITIES
*ForType23InputData
;
48 ForType23InputData
= (EFI_MISC_RESET_CAPABILITIES
*)RecordData
;
51 // First check for invalid parameters.
53 if (RecordData
== NULL
) {
54 return EFI_INVALID_PARAMETER
;
59 // Two zeros following the last string.
61 SmbiosRecord
= AllocatePool(sizeof (SMBIOS_TABLE_TYPE23
) + 1 + 1);
62 ZeroMem(SmbiosRecord
, sizeof (SMBIOS_TABLE_TYPE23
) + 1 + 1);
64 SmbiosRecord
->Hdr
.Type
= EFI_SMBIOS_TYPE_SYSTEM_RESET
;
65 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE23
);
68 // Make handle chosen by smbios protocol.add automatically.
70 SmbiosRecord
->Hdr
.Handle
= 0;
71 SmbiosRecord
->Capabilities
= *(UINT8
*)&(ForType23InputData
->ResetCapabilities
);
72 SmbiosRecord
->ResetCount
= (UINT16
)ForType23InputData
->ResetCount
;
73 SmbiosRecord
->ResetLimit
= (UINT16
)ForType23InputData
->ResetLimit
;
74 SmbiosRecord
->TimerInterval
= (UINT16
)ForType23InputData
->ResetTimerInterval
;
75 SmbiosRecord
->Timeout
= (UINT16
)ForType23InputData
->ResetTimeout
;
78 // Now we have got the full smbios record, call smbios protocol to add this record.
80 SmbiosHandle
= SMBIOS_HANDLE_PI_RESERVED
;
81 Status
= Smbios
-> Add(
85 (EFI_SMBIOS_TABLE_HEADER
*) SmbiosRecord
87 FreePool(SmbiosRecord
);