OpenCore  1.0.4
OpenCore Bootloader
1.0.4
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SmbiosPatch.c File Reference
#include <Uefi.h>
#include <Protocol/PciRootBridgeIo.h>
#include <Guid/AppleVariable.h>
#include <Guid/OcVariable.h>
#include <Guid/SmBios.h>
#include <Library/BaseMemoryLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcCpuLib.h>
#include <Library/OcSmbiosLib.h>
#include <Library/OcMemoryLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcVariableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <IndustryStandard/AppleSmBios.h>
#include <IndustryStandard/Pci.h>
#include "DebugSmbios.h"
#include "SmbiosInternal.h"
#include <IndustryStandard/ProcessorInfo.h>

Go to the source code of this file.

Macros

#define SMBIOS_OVERRIDE_S(Table, Field, Original, Value, Index, Fallback)
 
#define SMBIOS_OVERRIDE_V(Table, Field, Original, Value, Fallback)
 
#define SMBIOS_ACCESSIBLE(Table, Field)
 

Functions

STATIC APPLE_SMBIOS_STRUCTURE_POINTER SmbiosGetOriginalStructure (IN SMBIOS_TYPE Type, IN UINT16 Index)
 
STATIC UINT16 SmbiosGetOriginalStructureCount (IN SMBIOS_TYPE Type)
 
STATIC BOOLEAN SmbiosHasValidOemFormFactor (IN APPLE_SMBIOS_STRUCTURE_POINTER Original)
 
STATIC UINT8 SmbiosGetFormFactor (IN OC_SMBIOS_DATA *Data, IN APPLE_SMBIOS_STRUCTURE_POINTER Original)
 
STATIC BOOLEAN PatchBiosInformation (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC VOID PatchSystemInformation (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC VOID PatchBaseboardInformation (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC VOID PatchSystemEnclosure (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC VOID PatchCacheInformation (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN OUT UINT16 *Index, IN SMBIOS_HANDLE OriginalHandle, OUT SMBIOS_HANDLE *NewHandle)
 
STATIC VOID PatchProcessorInformation (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN OC_CPU_INFO *CpuInfo)
 
STATIC VOID PatchSystemPorts (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC VOID PatchSystemSlots (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC VOID PatchMemoryArray (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN APPLE_SMBIOS_STRUCTURE_POINTER Original, IN UINT16 Index, OUT SMBIOS_HANDLE *Handle)
 
STATIC VOID CreateMemoryArray (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, OUT SMBIOS_HANDLE *Handle)
 
STATIC VOID PatchMemoryDevice (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN SMBIOS_HANDLE MemoryArrayHandle, IN APPLE_SMBIOS_STRUCTURE_POINTER Original, IN UINT16 Index, OUT SMBIOS_HANDLE *Handle)
 
STATIC VOID CreateMemoryDevice (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN OC_SMBIOS_MEMORY_DEVICE_DATA *DeviceData, IN SMBIOS_HANDLE MemoryArrayHandle, IN UINT16 Index, OUT SMBIOS_HANDLE *Handle)
 
STATIC VOID PatchMemoryMappedAddress (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN SMBIOS_HANDLE MemoryArrayHandle, IN APPLE_SMBIOS_STRUCTURE_POINTER Original, IN UINT16 Index, IN OUT OC_SMBIOS_MAPPING *Mapping, IN OUT UINT16 *MappingNum)
 
STATIC VOID PatchMemoryMappedDevice (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN APPLE_SMBIOS_STRUCTURE_POINTER Original, IN UINT16 Index, IN SMBIOS_HANDLE MemoryDeviceHandle, IN OC_SMBIOS_MAPPING *Mapping, IN UINT16 MappingNum)
 
STATIC VOID PatchPortableBatteryDevice (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC VOID PatchBootInformation (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC VOID CreateOrPatchAppleFirmwareVolume (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN BOOLEAN HasAppleSMBIOS)
 
STATIC VOID CreateAppleProcessorType (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN OC_CPU_INFO *CpuInfo)
 
STATIC VOID CreateAppleProcessorSpeed (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN OC_CPU_INFO *CpuInfo)
 
STATIC VOID CreateOrPatchApplePlatformFeature (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN BOOLEAN HasAppleSMBIOS)
 
STATIC VOID CreateOrPatchAppleSmcInformation (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data, IN BOOLEAN HasAppleSMBIOS)
 
STATIC VOID CreateSmBiosEndOfTable (IN OUT OC_SMBIOS_TABLE *Table, IN OC_SMBIOS_DATA *Data)
 
STATIC EFI_STATUS SmbiosHandleLegacyRegion (BOOLEAN Unlock)
 
EFI_STATUS OcSmbiosTablePrepare (IN OUT OC_SMBIOS_TABLE *SmbiosTable)
 
VOID OcSmbiosTableFree (IN OUT OC_SMBIOS_TABLE *Table)
 
STATIC EFI_STATUS SmbiosTableAllocate (IN UINT16 TableLength, IN OUT SMBIOS_TABLE_ENTRY_POINT **TableEntryPoint, IN OUT SMBIOS_TABLE_3_0_ENTRY_POINT **TableEntryPoint3, IN OUT VOID **TableAddress, IN OUT VOID **TableAddress3)
 
STATIC EFI_STATUS SmbiosTableApply (IN OUT OC_SMBIOS_TABLE *SmbiosTable, IN OC_SMBIOS_UPDATE_MODE Mode)
 
VOID OcSmbiosGetSmcVersion (IN CONST UINT8 *SmcRevision, OUT UINT8 *SmcVersion)
 
OC_SMBIOS_UPDATE_MODE OcSmbiosGetUpdateMode (IN CONST CHAR8 *UpdateMode)
 
EFI_STATUS OcSmbiosCreate (IN OUT OC_SMBIOS_TABLE *SmbiosTable, IN OC_SMBIOS_DATA *Data, IN OC_SMBIOS_UPDATE_MODE Mode, IN OC_CPU_INFO *CpuInfo)
 
VOID OcSmbiosExtractOemInfo (IN OC_SMBIOS_TABLE *SmbiosTable, OUT CHAR8 *ProductName OPTIONAL, OUT CHAR8 *SerialNumber OPTIONAL, OUT EFI_GUID *SystemUuid OPTIONAL, OUT CHAR8 *Mlb OPTIONAL, OUT UINT8 *Rom OPTIONAL, IN BOOLEAN UuidIsRawEncoded, IN BOOLEAN UseVariableStorage)
 

Variables

STATIC SMBIOS_TABLE_ENTRY_POINT * mOriginalSmbios
 
STATIC SMBIOS_TABLE_3_0_ENTRY_POINT * mOriginalSmbios3
 
STATIC APPLE_SMBIOS_STRUCTURE_POINTER mOriginalTable
 
STATIC UINT32 mOriginalTableSize
 

Detailed Description

Copyright (C) 2016 - 2018, 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 SmbiosPatch.c.

Macro Definition Documentation

◆ SMBIOS_ACCESSIBLE

#define SMBIOS_ACCESSIBLE ( Table,
Field )
Value:
(((UINT8 *) &(Table).Field - (Table).Raw + sizeof ((Table).Field)) <= (Table).Standard.Hdr->Length)

Definition at line 79 of file SmbiosPatch.c.

◆ SMBIOS_OVERRIDE_S

#define SMBIOS_OVERRIDE_S ( Table,
Field,
Original,
Value,
Index,
Fallback )
Value:
do { \
CONST CHAR8 *RealValue__ = (Value); \
if (RealValue__ == NULL && ((Original).Raw) != NULL && (Original).Raw + (Original).Standard.Hdr->Length \
>= ((UINT8 *)&((Original).Field) + sizeof (SMBIOS_TABLE_STRING))) { \
RealValue__ = SmbiosGetString ((Original), ((Original).Field)); \
} \
(((Table)->CurrentPtr).Field) = SmbiosOverrideString ( \
(Table), \
RealValue__ != NULL ? RealValue__ : (Fallback), \
(Index) \
); \
} while (0)
CHAR8 * SmbiosGetString(IN APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable, IN SMBIOS_TABLE_STRING String)
UINT8 SmbiosOverrideString(IN OC_SMBIOS_TABLE *Table, IN CONST CHAR8 *Override OPTIONAL, IN UINT8 *Index)

Definition at line 51 of file SmbiosPatch.c.

◆ SMBIOS_OVERRIDE_V

#define SMBIOS_OVERRIDE_V ( Table,
Field,
Original,
Value,
Fallback )
Value:
do { \
if ((Value) != NULL) { \
CopyMem (&(((Table)->CurrentPtr).Field), (Value), sizeof ((((Table)->CurrentPtr).Field))); \
} else if ((Original).Raw != NULL && (Original).Raw + (Original).Standard.Hdr->Length \
>= ((UINT8 *)&((Original).Field) + sizeof ((((Table)->CurrentPtr).Field)))) { \
CopyMem (&(((Table)->CurrentPtr).Field), &((Original).Field), sizeof ((((Table)->CurrentPtr).Field))); \
} else if ((Fallback) != NULL) { \
CopyMem (&(((Table)->CurrentPtr).Field), (Fallback), sizeof ((((Table)->CurrentPtr).Field))); \
} else { \
/* No ZeroMem call as written area is guaranteed to be 0 */ \
} \
} while (0)

Definition at line 65 of file SmbiosPatch.c.

Function Documentation

◆ CreateAppleProcessorSpeed()

STATIC VOID CreateAppleProcessorSpeed ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN OC_CPU_INFO * CpuInfo )

Type 132

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.
[in]CpuInfoPointer to a valid pico cpu info structure.

Definition at line 1233 of file SmbiosPatch.c.

◆ CreateAppleProcessorType()

STATIC VOID CreateAppleProcessorType ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN OC_CPU_INFO * CpuInfo )

Type 131

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.
[in]CpuInfoPointer to a valid pico cpu info structure.

Definition at line 1204 of file SmbiosPatch.c.

◆ CreateMemoryArray()

STATIC VOID CreateMemoryArray ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
OUT SMBIOS_HANDLE * Handle )

Type 16

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 774 of file SmbiosPatch.c.

◆ CreateMemoryDevice()

STATIC VOID CreateMemoryDevice ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN OC_SMBIOS_MEMORY_DEVICE_DATA * DeviceData,
IN SMBIOS_HANDLE MemoryArrayHandle,
IN UINT16 Index,
OUT SMBIOS_HANDLE * Handle )

Type 17

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 909 of file SmbiosPatch.c.

◆ CreateOrPatchAppleFirmwareVolume()

STATIC VOID CreateOrPatchAppleFirmwareVolume ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN BOOLEAN HasAppleSMBIOS )

Type 128

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.
[in]HasAppleSMBIOSTRUE if Apple SMBIOS present.

Definition at line 1157 of file SmbiosPatch.c.

◆ CreateOrPatchApplePlatformFeature()

STATIC VOID CreateOrPatchApplePlatformFeature ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN BOOLEAN HasAppleSMBIOS )

Type 133

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.
[in]HasAppleSMBIOSTRUE if Apple SMBIOS present.

Definition at line 1269 of file SmbiosPatch.c.

◆ CreateOrPatchAppleSmcInformation()

STATIC VOID CreateOrPatchAppleSmcInformation ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN BOOLEAN HasAppleSMBIOS )

Type 134

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.
[in]HasAppleSMBIOSTRUE if Apple SMBIOS present.

Definition at line 1310 of file SmbiosPatch.c.

◆ CreateSmBiosEndOfTable()

STATIC VOID CreateSmBiosEndOfTable ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 127

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 1350 of file SmbiosPatch.c.

◆ OcSmbiosCreate()

EFI_STATUS OcSmbiosCreate ( IN OUT OC_SMBIOS_TABLE * SmbiosTable,
IN OC_SMBIOS_DATA * Data,
IN OC_SMBIOS_UPDATE_MODE Mode,
IN OC_CPU_INFO * CpuInfo )

Create new SMBIOS based on specified overrides.

Parameters
[in,out]SmbiosTableSMBIOS Table handle.
[in]DataSMBIOS overrides.
[in]ModeSMBIOS update mode.
[in]CpuInfoCPU information.
Return values
EFI_SUCCESSon success.

Definition at line 2021 of file SmbiosPatch.c.

◆ OcSmbiosExtractOemInfo()

VOID OcSmbiosExtractOemInfo ( IN OC_SMBIOS_TABLE * SmbiosTable,
OUT CHAR8 *ProductName OPTIONAL,
OUT CHAR8 *SerialNumber OPTIONAL,
OUT EFI_GUID *SystemUuid OPTIONAL,
OUT CHAR8 *Mlb OPTIONAL,
OUT UINT8 *Rom OPTIONAL,
IN BOOLEAN UuidIsRawEncoded,
IN BOOLEAN UseVariableStorage )

Extract OEM information from SMBIOS to different places. Note, for MLB and ROM NVRAM values take precedence.

Parameters
[in,out]SmbiosTableSMBIOS Table handle.
[out]ProductNameExport SMBIOS Type 1 product name, requiring OC_OEM_NAME_MAX bytes.
[out]SerialNumberExport SMBIOS Type 1 product serial, requiring OC_OEM_SERIAL_MAX bytes.
[out]SystemUuidExport SMBIOS Type 1 system UUID. UUID is always returned in RAW format.
[out]MlbExport SMBIOS Type 2 board serial, requiring OC_OEM_SERIAL_MAX bytes.
[out]RomExport ROM serial, requiring OC_OEM_ROM_MAX bytes.
[out]UuidIsRawEncodedPass FALSE to assume SMBIOS stores SystemUuid in Little Endian format and needs byte-swap.
[in]UseVariableStorageExport OEM information to NVRAM.

Definition at line 2220 of file SmbiosPatch.c.

◆ OcSmbiosGetSmcVersion()

VOID OcSmbiosGetSmcVersion ( IN CONST UINT8 * SmcRevision,
OUT UINT8 * SmcVersion )

Convert SMC revision from SMC REV key format (6-byte) to SMBIOS ASCII format (16-byte, APPLE_SMBIOS_SMC_VERSION_SIZE).

Parameters
[in]SmcRevisionSMC revision in REV key format.
[out]SmcVersionSMC revision in SMBIOS format.

Definition at line 1885 of file SmbiosPatch.c.

◆ OcSmbiosGetUpdateMode()

OC_SMBIOS_UPDATE_MODE OcSmbiosGetUpdateMode ( IN CONST CHAR8 * UpdateMode)

Choose update mode based on default representation. Always returns valid update mode, by falling back to Create when unknown mode was found. Known modes are: TryOverwrite, Create, Overwrite, Custom.

Parameters
[in]UpdateModein ASCII format.
Returns
SMBIS update mode in enum format.

Definition at line 1996 of file SmbiosPatch.c.

◆ OcSmbiosTableFree()

VOID OcSmbiosTableFree ( IN OUT OC_SMBIOS_TABLE * Table)

Free SMBIOS table

Parameters
[in,out]TableCurrent table buffer.
Return values
EFI_SUCCESSon success

Definition at line 1581 of file SmbiosPatch.c.

◆ OcSmbiosTablePrepare()

EFI_STATUS OcSmbiosTablePrepare ( IN OUT OC_SMBIOS_TABLE * SmbiosTable)

Prepare new SMBIOS table based on host data.

Parameters
SmbiosTable
Return values
EFI_SUCCESSif buffer is ready to be filled.

Definition at line 1452 of file SmbiosPatch.c.

◆ PatchBaseboardInformation()

STATIC VOID PatchBaseboardInformation ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 2

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 268 of file SmbiosPatch.c.

◆ PatchBiosInformation()

STATIC BOOLEAN PatchBiosInformation ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 0

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.
Return values
TRUEApple SMBIOS detected
FALSEApple SMBIOS not detected

Definition at line 177 of file SmbiosPatch.c.

◆ PatchBootInformation()

STATIC VOID PatchBootInformation ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 32

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 1128 of file SmbiosPatch.c.

◆ PatchCacheInformation()

STATIC VOID PatchCacheInformation ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN OUT UINT16 * Index,
IN SMBIOS_HANDLE OriginalHandle,
OUT SMBIOS_HANDLE * NewHandle )

Type 7

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.
[in]IndexPointer to cache table index.
[in]OriginalHandleOriginal cache table handle.
[in]NewHandlePointer to new cache table handle.

Definition at line 385 of file SmbiosPatch.c.

◆ PatchMemoryArray()

STATIC VOID PatchMemoryArray ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN APPLE_SMBIOS_STRUCTURE_POINTER Original,
IN UINT16 Index,
OUT SMBIOS_HANDLE * Handle )

Type 16

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 731 of file SmbiosPatch.c.

◆ PatchMemoryDevice()

STATIC VOID PatchMemoryDevice ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN SMBIOS_HANDLE MemoryArrayHandle,
IN APPLE_SMBIOS_STRUCTURE_POINTER Original,
IN UINT16 Index,
OUT SMBIOS_HANDLE * Handle )

Type 17

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 825 of file SmbiosPatch.c.

◆ PatchMemoryMappedAddress()

STATIC VOID PatchMemoryMappedAddress ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN SMBIOS_HANDLE MemoryArrayHandle,
IN APPLE_SMBIOS_STRUCTURE_POINTER Original,
IN UINT16 Index,
IN OUT OC_SMBIOS_MAPPING * Mapping,
IN OUT UINT16 * MappingNum )

Type 19

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 983 of file SmbiosPatch.c.

◆ PatchMemoryMappedDevice()

STATIC VOID PatchMemoryMappedDevice ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN APPLE_SMBIOS_STRUCTURE_POINTER Original,
IN UINT16 Index,
IN SMBIOS_HANDLE MemoryDeviceHandle,
IN OC_SMBIOS_MAPPING * Mapping,
IN UINT16 MappingNum )

Type 20

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 1029 of file SmbiosPatch.c.

◆ PatchPortableBatteryDevice()

STATIC VOID PatchPortableBatteryDevice ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 22

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 1078 of file SmbiosPatch.c.

◆ PatchProcessorInformation()

STATIC VOID PatchProcessorInformation ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data,
IN OC_CPU_INFO * CpuInfo )

Type 4

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.
[in]CpuInfoPointer to a valid pico cpu info structure.

Definition at line 469 of file SmbiosPatch.c.

◆ PatchSystemEnclosure()

STATIC VOID PatchSystemEnclosure ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 3

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 318 of file SmbiosPatch.c.

◆ PatchSystemInformation()

STATIC VOID PatchSystemInformation ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 1

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 232 of file SmbiosPatch.c.

◆ PatchSystemPorts()

STATIC VOID PatchSystemPorts ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 8

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 563 of file SmbiosPatch.c.

◆ PatchSystemSlots()

STATIC VOID PatchSystemSlots ( IN OUT OC_SMBIOS_TABLE * Table,
IN OC_SMBIOS_DATA * Data )

Type 9

Parameters
[in]TablePointer to location containing the current address within the buffer.
[in]DataPointer to location containing SMBIOS data.

Definition at line 606 of file SmbiosPatch.c.

◆ SmbiosGetFormFactor()

STATIC UINT8 SmbiosGetFormFactor ( IN OC_SMBIOS_DATA * Data,
IN APPLE_SMBIOS_STRUCTURE_POINTER Original )

Definition at line 122 of file SmbiosPatch.c.

◆ SmbiosGetOriginalStructure()

STATIC APPLE_SMBIOS_STRUCTURE_POINTER SmbiosGetOriginalStructure ( IN SMBIOS_TYPE Type,
IN UINT16 Index )

Definition at line 84 of file SmbiosPatch.c.

◆ SmbiosGetOriginalStructureCount()

STATIC UINT16 SmbiosGetOriginalStructureCount ( IN SMBIOS_TYPE Type)

Definition at line 98 of file SmbiosPatch.c.

◆ SmbiosHandleLegacyRegion()

STATIC EFI_STATUS SmbiosHandleLegacyRegion ( BOOLEAN Unlock)

Lock or unlock legacy region if used

Parameters
UnlockTRUE to unlock, FALSE to lock

Definition at line 1373 of file SmbiosPatch.c.

◆ SmbiosHasValidOemFormFactor()

STATIC BOOLEAN SmbiosHasValidOemFormFactor ( IN APPLE_SMBIOS_STRUCTURE_POINTER Original)

Definition at line 111 of file SmbiosPatch.c.

◆ SmbiosTableAllocate()

STATIC EFI_STATUS SmbiosTableAllocate ( IN UINT16 TableLength,
IN OUT SMBIOS_TABLE_ENTRY_POINT ** TableEntryPoint,
IN OUT SMBIOS_TABLE_3_0_ENTRY_POINT ** TableEntryPoint3,
IN OUT VOID ** TableAddress,
IN OUT VOID ** TableAddress3 )

Definition at line 1594 of file SmbiosPatch.c.

◆ SmbiosTableApply()

STATIC EFI_STATUS SmbiosTableApply ( IN OUT OC_SMBIOS_TABLE * SmbiosTable,
IN OC_SMBIOS_UPDATE_MODE Mode )

Definition at line 1666 of file SmbiosPatch.c.

Variable Documentation

◆ mOriginalSmbios

STATIC SMBIOS_TABLE_ENTRY_POINT* mOriginalSmbios

Definition at line 46 of file SmbiosPatch.c.

◆ mOriginalSmbios3

STATIC SMBIOS_TABLE_3_0_ENTRY_POINT* mOriginalSmbios3

Definition at line 47 of file SmbiosPatch.c.

◆ mOriginalTable

STATIC APPLE_SMBIOS_STRUCTURE_POINTER mOriginalTable

Definition at line 48 of file SmbiosPatch.c.

◆ mOriginalTableSize

STATIC UINT32 mOriginalTableSize

Definition at line 49 of file SmbiosPatch.c.