]> git.proxmox.com Git - mirror_edk2.git/blame - Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
1. PI SMBIOS Checkin. Major change include:
[mirror_edk2.git] / Nt32Pkg / MiscSubClassPlatformDxe / MiscResetCapabilitiesFunction.c
CommitLineData
1fdd39d3 1/*++\r
2\r
3Copyright (c) 2009, Intel Corporation. All rights reserved. <BR> \r
4This software and associated documentation (if any) is furnished\r
5under a license and may only be used or copied in accordance\r
6with the terms of the license. Except as permitted by such\r
7license, no part of this software or documentation may be\r
8reproduced, stored in a retrieval system, or transmitted in any\r
9form or by any means without the express written consent of\r
10Intel Corporation.\r
11\r
12Module Name:\r
13\r
14 MiscResetCapabilitiesFunction.c\r
15 \r
16Abstract: \r
17\r
18 ResetCapabilities.\r
19 SMBIOS type 23.\r
20\r
21--*/\r
22\r
23\r
24#include "MiscSubclassDriver.h"\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 // Make handle chosen by smbios protocol.add automatically.\r
63 // \r
64 SmbiosRecord->Hdr.Handle = 0; \r
65 SmbiosRecord->Capabilities = *(UINT8*)&(ForType23InputData->ResetCapabilities);\r
66 SmbiosRecord->ResetCount = (UINT16)ForType23InputData->ResetCount;\r
67 SmbiosRecord->ResetLimit = (UINT16)ForType23InputData->ResetLimit; \r
68 SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;\r
69 SmbiosRecord->Timeout = (UINT16)ForType23InputData->ResetTimeout;\r
70\r
71 //\r
72 // Now we have got the full smbios record, call smbios protocol to add this record.\r
73 //\r
74 SmbiosHandle = 0;\r
75 Status = Smbios-> Add(\r
76 Smbios, \r
77 NULL,\r
78 &SmbiosHandle, \r
79 (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
80 );\r
81 FreePool(SmbiosRecord);\r
82 return Status;\r
83}\r
84\r