OpenCore
1.0.4
OpenCore Bootloader
|
#include <Library/OcCpuLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcMacInfoLib.h>
#include <IndustryStandard/AppleSmBios.h>
#include <Guid/OcSmBios.h>
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) |
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.
#define OC_SMBIOS_VENDOR_NAME "Acidanthera" |
Definition at line 33 of file OcSmbiosLib.h.
typedef struct OC_SMBIOS_DATA_ OC_SMBIOS_DATA |
typedef struct OC_SMBIOS_MEMORY_DEVICE_DATA_ OC_SMBIOS_MEMORY_DEVICE_DATA |
typedef struct OC_SMBIOS_TABLE_ OC_SMBIOS_TABLE |
typedef enum OC_SMBIOS_UPDATE_MODE_ OC_SMBIOS_UPDATE_MODE |
Enumerator | |
---|---|
OcSmbiosUpdateTryOverwrite | |
OcSmbiosUpdateCreate | |
OcSmbiosUpdateOverwrite | |
OcSmbiosUpdateCustom |
Definition at line 129 of file OcSmbiosLib.h.
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.
[in,out] | SmbiosTable | SMBIOS Table handle. |
[in] | Data | SMBIOS overrides. |
[in] | Mode | SMBIOS update mode. |
[in] | CpuInfo | CPU information. |
EFI_SUCCESS | on success. |
Definition at line 2021 of file SmbiosPatch.c.
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.
[in] | Root | Directory to dump SMBIOS data. |
EFI_SUCCESS | on success. |
Definition at line 35 of file SmbiosDump.c.
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.
[in,out] | SmbiosTable | SMBIOS Table handle. |
[out] | ProductName | Export SMBIOS Type 1 product name, requiring OC_OEM_NAME_MAX bytes. |
[out] | SerialNumber | Export SMBIOS Type 1 product serial, requiring OC_OEM_SERIAL_MAX bytes. |
[out] | SystemUuid | Export SMBIOS Type 1 system UUID. UUID is always returned in RAW format. |
[out] | Mlb | Export SMBIOS Type 2 board serial, requiring OC_OEM_SERIAL_MAX bytes. |
[out] | Rom | Export ROM serial, requiring OC_OEM_ROM_MAX bytes. |
[out] | UuidIsRawEncoded | Pass FALSE to assume SMBIOS stores SystemUuid in Little Endian format and needs byte-swap. |
[in] | UseVariableStorage | Export OEM information to NVRAM. |
Definition at line 2220 of file SmbiosPatch.c.
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).
[in] | SmcRevision | SMC revision in REV key format. |
[out] | SmcVersion | SMC revision in SMBIOS format. |
Definition at line 1885 of file SmbiosPatch.c.
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.
[in] | UpdateMode | in ASCII format. |
Definition at line 1996 of file SmbiosPatch.c.
VOID OcSmbiosTableFree | ( | IN OUT OC_SMBIOS_TABLE * | Table | ) |
Free SMBIOS table
[in,out] | Table | Current table buffer. |
EFI_SUCCESS | on success |
Definition at line 1581 of file SmbiosPatch.c.
EFI_STATUS OcSmbiosTablePrepare | ( | IN OUT OC_SMBIOS_TABLE * | SmbiosTable | ) |
Prepare new SMBIOS table based on host data.
SmbiosTable |
EFI_SUCCESS | if buffer is ready to be filled. |
Definition at line 1452 of file SmbiosPatch.c.