mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-23 11:35:19 +01:00
946a6428b5
Refactor ACPI_NAME_LIST as XString8Array. Create ACPI_RENAME_DEVICE and ACPI_NAME to replace ACPI_NAME_LIST. Change RAM_SLOT_INFO and MEM_STRUCTURE into class. Improve XObjArray::RemoveWithoutFreeingAtIndex. Create XStringArray::ExtractFromPos. Move CheckFatalError and CheckError to BasicIO.
77 lines
1.4 KiB
C++
77 lines
1.4 KiB
C++
/*
|
|
* smbios.h
|
|
*
|
|
* Created on: 16 Apr 2020
|
|
* Author: jief
|
|
*/
|
|
|
|
#ifndef PLATFORM_SMBIOS_H_
|
|
#define PLATFORM_SMBIOS_H_
|
|
|
|
extern "C" {
|
|
#include <IndustryStandard/AppleSmBios.h>
|
|
}
|
|
|
|
// The maximum number of RAM slots to detect
|
|
// even for 3-channels chipset X58 there are no more then 8 slots
|
|
#define MAX_RAM_SLOTS 24
|
|
// The maximum sane frequency for a RAM module
|
|
#define MAX_RAM_FREQUENCY 5000
|
|
|
|
class RAM_SLOT_INFO {
|
|
public:
|
|
UINT32 ModuleSize = UINT32();
|
|
UINT32 Frequency = UINT32();
|
|
XString8 Vendor = XString8();
|
|
XString8 PartNo = XString8();
|
|
XString8 SerialNo = XString8();
|
|
UINT8 Type = UINT8();
|
|
bool InUse = bool();
|
|
};
|
|
|
|
class MEM_STRUCTURE
|
|
{
|
|
public:
|
|
UINT32 Frequency = UINT32();
|
|
UINT32 Divider = UINT32();
|
|
UINT8 TRC = UINT8();
|
|
UINT8 TRP = UINT8();
|
|
UINT8 RAS = UINT8();
|
|
UINT8 Channels = UINT8();
|
|
UINT8 Slots = UINT8();
|
|
UINT8 Type = UINT8();
|
|
UINT8 SPDInUse = UINT8();
|
|
UINT8 SMBIOSInUse = UINT8();
|
|
|
|
RAM_SLOT_INFO SPD[MAX_RAM_SLOTS * 4];
|
|
RAM_SLOT_INFO SMBIOS[MAX_RAM_SLOTS * 4];
|
|
|
|
};
|
|
|
|
|
|
extern APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable;
|
|
|
|
extern MEM_STRUCTURE gRAM;
|
|
extern BOOLEAN gMobile;
|
|
|
|
|
|
|
|
UINTN
|
|
iStrLen(
|
|
CONST CHAR8* String,
|
|
UINTN MaxLen
|
|
);
|
|
|
|
EFI_STATUS
|
|
PrepatchSmbios (void);
|
|
|
|
void
|
|
PatchSmbios (void);
|
|
|
|
void
|
|
FinalizeSmbios (void);
|
|
|
|
|
|
|
|
#endif /* PLATFORM_SMBIOS_H_ */
|