OpenCore  1.0.4
OpenCore Bootloader
1.0.4
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SmbiosInternal.h
Go to the documentation of this file.
1
15#ifndef SMBIOS_INTERNAL_H
16#define SMBIOS_INTERNAL_H
17
19#include <Library/BaseOverflowLib.h>
20#include <Library/OcSmbiosLib.h>
21
22//
23// 2 zero bytes required in the end of each table.
24//
25#define SMBIOS_STRUCTURE_TERMINATOR_SIZE 2
26
27//
28// Max memory mapping slots
29//
30#define OC_SMBIOS_MAX_MAPPING 512
31
32//
33// According to SMBIOS spec (3.2.0, page 26) SMBIOS handle is a number from 0 to 0xFF00.
34// SMBIOS spec does not require handles to be contiguous or remain valid across SMBIOS.
35// The only requirements is uniqueness and range conformance, so we reserve select handles
36// for dedicated tables here for easier assignment. Automatic handle assignment starts with
37// OcSmbiosAutomaticHandle.
38//
39enum {
45 /* OcSmbiosProcessorInformationHandle, */
48 /* OcSmbiosCacheInformationHandle, */
49 /* OcSmbiosL1CacheHandle, */
50 /* OcSmbiosL2CacheHandle, */
51 /* OcSmbiosL3CacheHandle, */
52 /* OcSmbiosPortConnectorInformationHandle, */
53 /* OcSmbiosSystemSlotsHandle, */
60 /* OcSmbiosPhysicalMemoryArrayHandle, */
61 /* OcSmbiosMemoryDeviceHandle, */
63 /* OcSmbiosMemoryArrayMappedAddressHandle, */
64 /* OcSmbiosMemoryDeviceMappedAddressHandle, */
96
99};
100
102
103//
104// Map old handles to new ones.
105//
106typedef struct OC_SMBIOS_MAPPING_ {
107 SMBIOS_HANDLE Old;
108 SMBIOS_HANDLE New;
110
119EFI_STATUS
121 IN OUT OC_SMBIOS_TABLE *Table,
122 IN UINT32 Size
123 );
124
134UINT8
136 IN OUT OC_SMBIOS_TABLE *Table,
137 IN CONST CHAR8 *Override OPTIONAL,
138 IN OUT UINT8 *Index
139 );
140
151EFI_STATUS
153 IN OUT OC_SMBIOS_TABLE *Table,
154 IN SMBIOS_TYPE Type,
155 IN UINT8 MinLength,
156 IN UINT16 Index
157 );
158
166VOID
168 IN OUT OC_SMBIOS_TABLE *Table
169 );
170
179CHAR8 *
181 IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable,
182 IN SMBIOS_TABLE_STRING StringIndex
183 );
184
195UINT8
197 IN OUT CHAR8 **Buffer,
198 IN CONST CHAR8 *String,
199 IN UINT32 Length,
200 IN OUT UINT8 *Index
201 );
202
211UINT32
213 IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable,
214 IN UINT32 SmbiosTableSize
215 );
216
229 IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable,
230 IN UINT32 SmbiosTableSize,
231 IN SMBIOS_TYPE Type,
232 IN UINT16 Index
233 );
234
243UINT16
245 IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable,
246 IN UINT32 SmbiosTableSize,
247 IN SMBIOS_TYPE Type
248 );
249
250#endif // SMBIOS_INTERNAL_H
UINT64 Length
DMG_SIZE_DEVICE_PATH Size
OC_TYPING_BUFFER_ENTRY Buffer[OC_TYPING_BUFFER_SIZE]
Definition OcTypingLib.h:42
struct OC_SMBIOS_MAPPING_ OC_SMBIOS_MAPPING
UINT8 SmbiosOverrideString(IN OUT OC_SMBIOS_TABLE *Table, IN CONST CHAR8 *Override OPTIONAL, IN OUT UINT8 *Index)
@ OcSmbiosOutOfBandRemoteAccessHandle
@ OcSmbiosBaseboardInformationHandle
@ OcSmbiosPortableBatteryHandle
@ OcSmbiosSystemResetHandle
@ OcSmbiosOemStringsHandle
@ OcSmbiosBiosLanguageInformationHandle
@ OcSmbiosMemoryControllerInformationHandle
@ OcSmbiosGroupAssociationsHandle
@ OcSmbiosCoolingDeviceHandle
@ OcAppleSmbiosProcessorBusSpeedHandle
@ OcSmbiosAdditionalInformationHandle
@ OcSmbiosSystemConfigurationOptionsHandle
@ OcSmbiosSystemEnclosureHandle
@ OcSmbiosLastReservedHandle
@ OcSmbiosSystemEventLogHandle
@ OcSmbiosIpmiDeviceInformationHandle
@ OcSmbiosHardwareSecurityHandle
@ OcSmbiosOnboardDeviceInformationHandle
@ OcSmbiosOnboardDevicesExtendedInformationHandle
@ OcSmbiosBiosInformationHandle
@ OcSmbiosSystemPowerControlsHandle
@ OcAppleSmbiosFirmwareInformationHandle
@ OcSmbiosInvalidHandle
@ OcAppleSmbiosProcessorTypeHandle
@ OcSmbiosManagementDeviceThresholdDataHandle
@ OcSmbios32BitMemoryErrorInformationHandle
@ OcSmbiosInactiveHandle
@ OcSmbiosEndOfTableHandle
@ OcSmbiosSystemPowerSupplyHandle
@ OcAppleSmbiosPlatformFeatureHandle
@ OcSmbiosSystemInformationHandle
@ OcSmbiosBootIntegrityServiceHandle
@ OcSmbiosManagementControllerHostInterfaceHandle
@ OcSmbiosMemoryModuleInformatonHandle
@ OcSmbiosAutomaticHandle
@ OcSmbiosManagementDeviceComponentHandle
@ OcSmbios64BitMemoryErrorInformationHandle
@ OcSmbiosMemoryChannelHandle
@ OcSmbiosTpmDeviceHandle
@ OcAppleSmbiosSmcInformationHandle
@ OcSmbiosBuiltInPointingDeviceHandle
@ OcSmbiosVoltageProbeHandle
@ OcSmbiosManagementDeviceHandle
@ OcSmbiosTemperatureProbeHandle
@ OcAppleSmbiosMemorySpdDataHandle
@ OcSmbiosSystemBootInformationHandle
@ OcSmbiosElectricalCurrentProbeHandle
CHAR8 * SmbiosGetString(IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN SMBIOS_TABLE_STRING StringIndex)
EFI_STATUS SmbiosExtendTable(IN OUT OC_SMBIOS_TABLE *Table, IN UINT32 Size)
EFI_STATUS SmbiosInitialiseStruct(IN OUT OC_SMBIOS_TABLE *Table, IN SMBIOS_TYPE Type, IN UINT8 MinLength, IN UINT16 Index)
STATIC_ASSERT(OcSmbiosAutomaticHandle > OcSmbiosLastReservedHandle, "Inconsistent handle IDs")
APPLE_SMBIOS_STRUCTURE_POINTER SmbiosGetStructureOfType(IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN UINT32 SmbiosTableSize, IN SMBIOS_TYPE Type, IN UINT16 Index)
UINT32 SmbiosGetStructureLength(IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN UINT32 SmbiosTableSize)
UINT8 SmbiosSetString(IN OUT CHAR8 **Buffer, IN CONST CHAR8 *String, IN UINT32 Length, IN OUT UINT8 *Index)
VOID SmbiosFinaliseStruct(IN OUT OC_SMBIOS_TABLE *Table)
UINT16 SmbiosGetStructureCount(IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN UINT32 SmbiosTableSize, IN SMBIOS_TYPE Type)