3 Copyright (c) 2012 - 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.
17 MiscPhysicalArrayFunction.c
21 BIOS system Physical Array boot time changes.
27 #include "CommonHeader.h"
28 #include "MiscSubclassDriver.h"
33 This function makes boot time changes to the contents of the
34 MiscPhysicalArrayFunction (Type 16).
36 @param RecordData Pointer to copy of RecordData from the Data Table.
38 @retval EFI_SUCCESS All parameters were valid.
39 @retval EFI_UNSUPPORTED Unexpected RecordType value.
40 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
44 MISC_SMBIOS_TABLE_FUNCTION(MiscPhysicalMemoryArray
)
47 EFI_SMBIOS_HANDLE SmbiosHandle
;
48 SMBIOS_TABLE_TYPE16
*SmbiosRecord
;
49 EFI_MEMORY_ARRAY_LOCATION_DATA
*ForType16InputData
;
50 UINT32 TopOfMemory
= 8 * 1024 * 1024;
53 // First check for invalid parameters.
55 if (RecordData
== NULL
) {
56 return EFI_INVALID_PARAMETER
;
59 ForType16InputData
= (EFI_MEMORY_ARRAY_LOCATION_DATA
*)RecordData
;
62 // Two zeros following the last string.
64 SmbiosRecord
= AllocatePool(sizeof (SMBIOS_TABLE_TYPE16
) + 1);
65 ZeroMem(SmbiosRecord
, sizeof (SMBIOS_TABLE_TYPE16
) + 1);
67 SmbiosRecord
->Hdr
.Type
= EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY
;
68 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE16
);
71 // Make handle chosen by smbios protocol.add automatically.
73 SmbiosRecord
->Hdr
.Handle
= 0;
76 // ReleaseDate will be the 3rd optional string following the formatted structure.
78 SmbiosRecord
->Location
= *(UINT8
*) &ForType16InputData
->MemoryArrayLocation
;
79 SmbiosRecord
->Use
= *(UINT8
*) &ForType16InputData
->MemoryArrayUse
;
80 SmbiosRecord
->MemoryErrorCorrection
= *(UINT8
*) &ForType16InputData
->MemoryErrorCorrection
;
83 // System does not provide the error information structure
85 SmbiosRecord
->MemoryErrorInformationHandle
= 0xFFFE;
88 // Maximum memory capacity
90 SmbiosRecord
-> MaximumCapacity
= TopOfMemory
;
91 SmbiosRecord
-> NumberOfMemoryDevices
= 0x02;
94 // Now we have got the full smbios record, call smbios protocol to add this record.
96 SmbiosHandle
= SMBIOS_HANDLE_PI_RESERVED
;
97 Status
= Smbios
-> Add(
101 (EFI_SMBIOS_TABLE_HEADER
*) SmbiosRecord
103 FreePool(SmbiosRecord
);