2020-04-16 09:15:26 +02:00
|
|
|
/*
|
|
|
|
* smbios.h
|
|
|
|
*
|
|
|
|
* Created on: 16 Apr 2020
|
|
|
|
* Author: jief
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLATFORM_SMBIOS_H_
|
|
|
|
#define PLATFORM_SMBIOS_H_
|
|
|
|
|
2021-02-06 18:16:46 +01:00
|
|
|
extern "C" {
|
|
|
|
#include <IndustryStandard/AppleSmBios.h>
|
|
|
|
}
|
|
|
|
|
2020-04-16 09:48:13 +02:00
|
|
|
// 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
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT32 ModuleSize;
|
|
|
|
UINT32 Frequency;
|
2021-04-03 16:42:49 +02:00
|
|
|
XString8 Vendor;
|
|
|
|
XString8 PartNo;
|
|
|
|
XString8 SerialNo;
|
|
|
|
UINT8 Type;
|
|
|
|
bool InUse;
|
2020-04-16 09:48:13 +02:00
|
|
|
} RAM_SLOT_INFO;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
UINT32 Frequency;
|
|
|
|
UINT32 Divider;
|
|
|
|
UINT8 TRC;
|
|
|
|
UINT8 TRP;
|
|
|
|
UINT8 RAS;
|
|
|
|
UINT8 Channels;
|
|
|
|
UINT8 Slots;
|
|
|
|
UINT8 Type;
|
|
|
|
UINT8 SPDInUse;
|
|
|
|
UINT8 SMBIOSInUse;
|
|
|
|
UINT8 pad[2];
|
|
|
|
|
|
|
|
RAM_SLOT_INFO SPD[MAX_RAM_SLOTS * 4];
|
|
|
|
RAM_SLOT_INFO SMBIOS[MAX_RAM_SLOTS * 4];
|
|
|
|
|
|
|
|
} MEM_STRUCTURE;
|
|
|
|
|
|
|
|
|
2020-04-16 09:15:26 +02:00
|
|
|
extern APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable;
|
2021-02-06 18:16:46 +01:00
|
|
|
|
2020-04-16 09:48:13 +02:00
|
|
|
extern MEM_STRUCTURE gRAM;
|
2020-04-16 09:15:26 +02:00
|
|
|
extern BOOLEAN gMobile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UINTN
|
|
|
|
iStrLen(
|
|
|
|
CONST CHAR8* String,
|
|
|
|
UINTN MaxLen
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2020-10-03 19:02:31 +02:00
|
|
|
PrepatchSmbios (void);
|
2020-04-16 09:15:26 +02:00
|
|
|
|
2020-10-03 19:02:31 +02:00
|
|
|
void
|
|
|
|
PatchSmbios (void);
|
2020-04-16 09:15:26 +02:00
|
|
|
|
2020-10-03 19:02:31 +02:00
|
|
|
void
|
|
|
|
FinalizeSmbios (void);
|
2020-04-16 09:15:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* PLATFORM_SMBIOS_H_ */
|