OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcSmbiosLib.h File Reference

Go to the source code of this file.

Data Structures

struct  OC_SMBIOS_MEMORY_DEVICE_DATA_
 
struct  OC_SMBIOS_DATA_
 
struct  OC_SMBIOS_TABLE_
 

Macros

#define OC_SMBIOS_VENDOR_NAME   "Acidanthera"
 

Typedefs

typedef struct OC_SMBIOS_MEMORY_DEVICE_DATA_ OC_SMBIOS_MEMORY_DEVICE_DATA
 
typedef struct OC_SMBIOS_DATA_ OC_SMBIOS_DATA
 
typedef enum OC_SMBIOS_UPDATE_MODE_ OC_SMBIOS_UPDATE_MODE
 
typedef struct OC_SMBIOS_TABLE_ OC_SMBIOS_TABLE
 

Enumerations

enum  OC_SMBIOS_UPDATE_MODE_ { OcSmbiosUpdateTryOverwrite = 0 , OcSmbiosUpdateCreate = 1 , OcSmbiosUpdateOverwrite = 2 , OcSmbiosUpdateCustom = 3 }
 

Functions

EFI_STATUS OcSmbiosTablePrepare (IN OUT OC_SMBIOS_TABLE *SmbiosTable)
 
VOID OcSmbiosTableFree (IN OUT OC_SMBIOS_TABLE *Table)
 
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)
 
VOID OcSmbiosGetSmcVersion (IN CONST UINT8 *SmcRevision, OUT UINT8 *SmcVersion)
 
OC_SMBIOS_UPDATE_MODE OcSmbiosGetUpdateMode (IN CONST CHAR8 *UpdateMode)
 
EFI_STATUS OcSmbiosDump (IN EFI_FILE_PROTOCOL *Root)
 

Detailed Description

OcSmbiosLib

Copyright (c) 2019, vit9696

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 OcSmbiosLib.h.

Macro Definition Documentation

◆ OC_SMBIOS_VENDOR_NAME

#define OC_SMBIOS_VENDOR_NAME   "Acidanthera"

Definition at line 33 of file OcSmbiosLib.h.

Typedef Documentation

◆ OC_SMBIOS_DATA

◆ OC_SMBIOS_MEMORY_DEVICE_DATA

◆ OC_SMBIOS_TABLE

◆ OC_SMBIOS_UPDATE_MODE

Enumeration Type Documentation

◆ OC_SMBIOS_UPDATE_MODE_

Enumerator
OcSmbiosUpdateTryOverwrite 
OcSmbiosUpdateCreate 
OcSmbiosUpdateOverwrite 
OcSmbiosUpdateCustom 

Definition at line 129 of file OcSmbiosLib.h.

Function Documentation

◆ 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.

◆ OcSmbiosDump()

EFI_STATUS OcSmbiosDump ( IN EFI_FILE_PROTOCOL * Root)

Dump current SMBIOS data into specified directory under EntryV#.bin/DataV#.bin names, where # is SMBIOS version: 1, 3, or both.

Parameters
[in]RootDirectory to dump SMBIOS data.
Return values
EFI_SUCCESSon success.

Definition at line 35 of file SmbiosDump.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.