OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
SmbiosInternal.h File Reference
#include <IndustryStandard/AppleSmBios.h>
#include <Library/BaseOverflowLib.h>
#include <Library/OcSmbiosLib.h>

Go to the source code of this file.

Data Structures

struct  OC_SMBIOS_MAPPING_
 

Macros

#define SMBIOS_STRUCTURE_TERMINATOR_SIZE   2
 
#define OC_SMBIOS_MAX_MAPPING   512
 

Typedefs

typedef struct OC_SMBIOS_MAPPING_ OC_SMBIOS_MAPPING
 

Enumerations

enum  {
  OcSmbiosInvalidHandle , OcSmbiosBiosInformationHandle , OcSmbiosSystemInformationHandle , OcSmbiosBaseboardInformationHandle ,
  OcSmbiosSystemEnclosureHandle , OcSmbiosMemoryControllerInformationHandle , OcSmbiosMemoryModuleInformatonHandle , OcSmbiosOnboardDeviceInformationHandle ,
  OcSmbiosOemStringsHandle , OcSmbiosSystemConfigurationOptionsHandle , OcSmbiosBiosLanguageInformationHandle , OcSmbiosGroupAssociationsHandle ,
  OcSmbiosSystemEventLogHandle , OcSmbios32BitMemoryErrorInformationHandle , OcSmbiosBuiltInPointingDeviceHandle , OcSmbiosPortableBatteryHandle ,
  OcSmbiosSystemResetHandle , OcSmbiosHardwareSecurityHandle , OcSmbiosSystemPowerControlsHandle , OcSmbiosVoltageProbeHandle ,
  OcSmbiosCoolingDeviceHandle , OcSmbiosTemperatureProbeHandle , OcSmbiosElectricalCurrentProbeHandle , OcSmbiosOutOfBandRemoteAccessHandle ,
  OcSmbiosBootIntegrityServiceHandle , OcSmbiosSystemBootInformationHandle , OcSmbios64BitMemoryErrorInformationHandle , OcSmbiosManagementDeviceHandle ,
  OcSmbiosManagementDeviceComponentHandle , OcSmbiosManagementDeviceThresholdDataHandle , OcSmbiosMemoryChannelHandle , OcSmbiosIpmiDeviceInformationHandle ,
  OcSmbiosSystemPowerSupplyHandle , OcSmbiosAdditionalInformationHandle , OcSmbiosOnboardDevicesExtendedInformationHandle , OcSmbiosManagementControllerHostInterfaceHandle ,
  OcSmbiosTpmDeviceHandle , OcSmbiosInactiveHandle , OcSmbiosEndOfTableHandle , OcAppleSmbiosFirmwareInformationHandle ,
  OcAppleSmbiosMemorySpdDataHandle , OcAppleSmbiosProcessorTypeHandle , OcAppleSmbiosProcessorBusSpeedHandle , OcAppleSmbiosPlatformFeatureHandle ,
  OcAppleSmbiosSmcInformationHandle , OcSmbiosLastReservedHandle , OcSmbiosAutomaticHandle = 128
}
 

Functions

 STATIC_ASSERT (OcSmbiosAutomaticHandle > OcSmbiosLastReservedHandle, "Inconsistent handle IDs")
 
EFI_STATUS SmbiosExtendTable (IN OUT OC_SMBIOS_TABLE *Table, IN UINT32 Size)
 
UINT8 SmbiosOverrideString (IN OUT OC_SMBIOS_TABLE *Table, IN CONST CHAR8 *Override OPTIONAL, IN OUT UINT8 *Index)
 
EFI_STATUS SmbiosInitialiseStruct (IN OUT OC_SMBIOS_TABLE *Table, IN SMBIOS_TYPE Type, IN UINT8 MinLength, IN UINT16 Index)
 
VOID SmbiosFinaliseStruct (IN OUT OC_SMBIOS_TABLE *Table)
 
CHAR8 * SmbiosGetString (IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN SMBIOS_TABLE_STRING StringIndex)
 
UINT8 SmbiosSetString (IN OUT CHAR8 **Buffer, IN CONST CHAR8 *String, IN UINT32 Length, IN OUT UINT8 *Index)
 
UINT32 SmbiosGetStructureLength (IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN UINT32 SmbiosTableSize)
 
APPLE_SMBIOS_STRUCTURE_POINTER SmbiosGetStructureOfType (IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN UINT32 SmbiosTableSize, IN SMBIOS_TYPE Type, IN UINT16 Index)
 
UINT16 SmbiosGetStructureCount (IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN UINT32 SmbiosTableSize, IN SMBIOS_TYPE Type)
 

Detailed Description

Copyright (C) 2016 - 2017, The HermitCrabs Lab. All rights reserved.

All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file SmbiosInternal.h.

Macro Definition Documentation

◆ OC_SMBIOS_MAX_MAPPING

#define OC_SMBIOS_MAX_MAPPING   512

Definition at line 30 of file SmbiosInternal.h.

◆ SMBIOS_STRUCTURE_TERMINATOR_SIZE

#define SMBIOS_STRUCTURE_TERMINATOR_SIZE   2

Definition at line 25 of file SmbiosInternal.h.

Typedef Documentation

◆ OC_SMBIOS_MAPPING

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OcSmbiosInvalidHandle 
OcSmbiosBiosInformationHandle 
OcSmbiosSystemInformationHandle 
OcSmbiosBaseboardInformationHandle 
OcSmbiosSystemEnclosureHandle 
OcSmbiosMemoryControllerInformationHandle 
OcSmbiosMemoryModuleInformatonHandle 
OcSmbiosOnboardDeviceInformationHandle 
OcSmbiosOemStringsHandle 
OcSmbiosSystemConfigurationOptionsHandle 
OcSmbiosBiosLanguageInformationHandle 
OcSmbiosGroupAssociationsHandle 
OcSmbiosSystemEventLogHandle 
OcSmbios32BitMemoryErrorInformationHandle 
OcSmbiosBuiltInPointingDeviceHandle 
OcSmbiosPortableBatteryHandle 
OcSmbiosSystemResetHandle 
OcSmbiosHardwareSecurityHandle 
OcSmbiosSystemPowerControlsHandle 
OcSmbiosVoltageProbeHandle 
OcSmbiosCoolingDeviceHandle 
OcSmbiosTemperatureProbeHandle 
OcSmbiosElectricalCurrentProbeHandle 
OcSmbiosOutOfBandRemoteAccessHandle 
OcSmbiosBootIntegrityServiceHandle 
OcSmbiosSystemBootInformationHandle 
OcSmbios64BitMemoryErrorInformationHandle 
OcSmbiosManagementDeviceHandle 
OcSmbiosManagementDeviceComponentHandle 
OcSmbiosManagementDeviceThresholdDataHandle 
OcSmbiosMemoryChannelHandle 
OcSmbiosIpmiDeviceInformationHandle 
OcSmbiosSystemPowerSupplyHandle 
OcSmbiosAdditionalInformationHandle 
OcSmbiosOnboardDevicesExtendedInformationHandle 
OcSmbiosManagementControllerHostInterfaceHandle 
OcSmbiosTpmDeviceHandle 
OcSmbiosInactiveHandle 
OcSmbiosEndOfTableHandle 
OcAppleSmbiosFirmwareInformationHandle 
OcAppleSmbiosMemorySpdDataHandle 
OcAppleSmbiosProcessorTypeHandle 
OcAppleSmbiosProcessorBusSpeedHandle 
OcAppleSmbiosPlatformFeatureHandle 
OcAppleSmbiosSmcInformationHandle 
OcSmbiosLastReservedHandle 
OcSmbiosAutomaticHandle 

Definition at line 39 of file SmbiosInternal.h.

Function Documentation

◆ SmbiosExtendTable()

EFI_STATUS SmbiosExtendTable ( IN OUT OC_SMBIOS_TABLE * Table,
IN UINT32 Size )

Allocate bytes in SMBIOS table if necessary

Parameters
[in,out]TableCurrent table buffer.
[in]SizeAmount of free bytes needed.
Return values
EFI_SUCCESSon success

Definition at line 34 of file SmbiosInternal.c.

◆ SmbiosFinaliseStruct()

VOID SmbiosFinaliseStruct ( IN OUT OC_SMBIOS_TABLE * Table)

Finalise SMBIOS structure

Parameters
[in]TablePointer to location containing the current address within the buffer.
Return values

Definition at line 332 of file SmbiosInternal.c.

◆ SmbiosGetString()

CHAR8 * SmbiosGetString ( IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable,
IN SMBIOS_TABLE_STRING StringIndex )

Obtain string from previously validated structure.

Parameters
[in]SmbiosTable
[in]StringIndexString Index to retrieve
Return values

Definition at line 362 of file SmbiosInternal.c.

◆ SmbiosGetStructureCount()

UINT16 SmbiosGetStructureCount ( IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable,
IN UINT32 SmbiosTableSize,
IN SMBIOS_TYPE Type )

Obtain structure count of specified type.

Parameters
[in]SmbiosTablePointer to SMBIOS table.
[in]SmbiosTableSizeSMBIOS table size
Return values
structurecount or 0

Definition at line 501 of file SmbiosInternal.c.

◆ SmbiosGetStructureLength()

UINT32 SmbiosGetStructureLength ( IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable,
IN UINT32 SmbiosTableSize )

Obtain and validate structure length.

Parameters
[in]SmbiosTable
[in]SmbiosTableSizeSMBIOS table size
Return values
tablelength or 0 for invalid

Definition at line 415 of file SmbiosInternal.c.

◆ SmbiosGetStructureOfType()

APPLE_SMBIOS_STRUCTURE_POINTER SmbiosGetStructureOfType ( IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable,
IN UINT32 SmbiosTableSize,
IN SMBIOS_TYPE Type,
IN UINT16 Index )

Obtain and validate Nth structure of specified type.

Parameters
[in]SmbiosTablePointer to SMBIOS table.
[in]SmbiosTableSizeSMBIOS table size
[in]TypeSMBIOS table type
[in]IndexSMBIOS table index starting from 1
Return values
foundtable or NULL

Definition at line 444 of file SmbiosInternal.c.

◆ SmbiosInitialiseStruct()

EFI_STATUS SmbiosInitialiseStruct ( IN OUT OC_SMBIOS_TABLE * Table,
IN SMBIOS_TYPE Type,
IN UINT8 MinLength,
IN UINT16 Index )

Initialise SMBIOS structure

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]TypeTable type.
[in]MinLengthInitial length of the table.
[in]IndexTable index, normally 1.
Return values

Definition at line 304 of file SmbiosInternal.c.

◆ SmbiosOverrideString()

UINT8 SmbiosOverrideString ( IN OUT OC_SMBIOS_TABLE * Table,
IN CONST CHAR8 *Override OPTIONAL,
IN OUT UINT8 * Index )

Write override string to SMBIOS table

Parameters
[in,out]TableCurrent table buffer.
[in]OverrideString data override.
[in,out]IndexPointer to current string index, incremented on success.
Return values
assignedstring index or 0

◆ SmbiosSetString()

UINT8 SmbiosSetString ( IN OUT CHAR8 ** Buffer,
IN CONST CHAR8 * String,
IN UINT32 Length,
IN OUT UINT8 * Index )

Write string to SMBIOS structure

Parameters
[in,out]BufferPointer to location containing the current address within the buffer.
[in]StringBuffer containing the null terminated ascii string.
[in]LengthString length to write.
[in,out]IndexPointer to current string index, incremented on success.
Return values
assignedstring index or 0

Definition at line 395 of file SmbiosInternal.c.

◆ STATIC_ASSERT()

STATIC_ASSERT ( OcSmbiosAutomaticHandle ,
OcSmbiosLastReservedHandle ,
"Inconsistent handle IDs"  )