3 Copyright (c) 2009, Intel Corporation. All rights reserved. <BR>
4 This software and associated documentation (if any) is furnished
5 under a license and may only be used or copied in accordance
6 with the terms of the license. Except as permitted by such
7 license, no part of this software or documentation may be
8 reproduced, stored in a retrieval system, or transmitted in any
9 form or by any means without the express written consent of
14 MiscResetCapabilitiesFunction.c
24 #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
);
62 // Make handle chosen by smbios protocol.add automatically.
64 SmbiosRecord
->Hdr
.Handle
= 0;
65 SmbiosRecord
->Capabilities
= *(UINT8
*)&(ForType23InputData
->ResetCapabilities
);
66 SmbiosRecord
->ResetCount
= (UINT16
)ForType23InputData
->ResetCount
;
67 SmbiosRecord
->ResetLimit
= (UINT16
)ForType23InputData
->ResetLimit
;
68 SmbiosRecord
->TimerInterval
= (UINT16
)ForType23InputData
->ResetTimerInterval
;
69 SmbiosRecord
->Timeout
= (UINT16
)ForType23InputData
->ResetTimeout
;
72 // Now we have got the full smbios record, call smbios protocol to add this record.
75 Status
= Smbios
-> Add(
79 (EFI_SMBIOS_TABLE_HEADER
*) SmbiosRecord
81 FreePool(SmbiosRecord
);