iPXE
Functions | Variables
efi_smbios.c File Reference

iPXE SMBIOS API for EFI More...

#include <errno.h>
#include <ipxe/smbios.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/Guid/SmBios.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
 EFI_USE_TABLE (SMBIOS_TABLE, &smbios_entry, 0)
 
static int efi_find_smbios (struct smbios *smbios)
 Find SMBIOS. More...
 
 PROVIDE_SMBIOS (efi, find_smbios, efi_find_smbios)
 

Variables

static struct smbios_entrysmbios_entry
 SMBIOS configuration table. More...
 

Detailed Description

iPXE SMBIOS API for EFI

Definition in file efi_smbios.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ EFI_USE_TABLE()

EFI_USE_TABLE ( SMBIOS_TABLE  ,
smbios_entry,
 
)

◆ efi_find_smbios()

static int efi_find_smbios ( struct smbios smbios)
static

Find SMBIOS.

Parameters
smbiosSMBIOS entry point descriptor structure to fill in
Return values
rcReturn status code

Definition at line 43 of file efi_smbios.c.

43  {
44 
45  if ( ! smbios_entry ) {
46  DBG ( "No SMBIOS table provided\n" );
47  return -ENODEV;
48  }
49 
51  DBG ( "Invalid SMBIOS signature\n" );
52  return -ENODEV;
53  }
54 
58  smbios->version =
60  DBG ( "Found SMBIOS v%d.%d entry point at %p (%x+%zx)\n",
63 
64  return 0;
65 }
uint32_t signature
Signature.
Definition: smbios.h:49
#define SMBIOS_SIGNATURE
Signature for SMBIOS entry point.
Definition: smbios.h:35
unsigned int count
Number of SMBIOS structures.
Definition: smbios.h:170
size_t len
Length of SMBIOS structures.
Definition: smbios.h:168
userptr_t phys_to_user(unsigned long phys_addr)
Convert physical address to user pointer.
SMBIOS entry point descriptor.
Definition: smbios.h:164
uint16_t version
SMBIOS version.
Definition: smbios.h:172
uint16_t smbios_len
Structure table length.
Definition: smbios.h:69
SMBIOS entry point.
Definition: smbios.h:44
uint32_t smbios_address
Structure table address.
Definition: smbios.h:71
#define SMBIOS_VERSION(major, minor)
Calculate SMBIOS version.
Definition: smbios.h:182
#define ENODEV
No such device.
Definition: errno.h:509
uint16_t smbios_count
Number of SMBIOS structures.
Definition: smbios.h:73
uint8_t minor
Minor version.
Definition: smbios.h:57
userptr_t address
Start of SMBIOS structures.
Definition: smbios.h:166
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
uint8_t major
Major version.
Definition: smbios.h:55

References smbios::address, smbios::count, DBG, ENODEV, smbios::len, smbios_entry::major, smbios_entry::minor, phys_to_user(), smbios_entry::signature, smbios_entry::smbios_address, smbios_entry::smbios_count, smbios_entry::smbios_len, SMBIOS_SIGNATURE, SMBIOS_VERSION, and smbios::version.

◆ PROVIDE_SMBIOS()

PROVIDE_SMBIOS ( efi  ,
find_smbios  ,
efi_find_smbios   
)

Variable Documentation

◆ smbios_entry

struct smbios_entry* smbios_entry
static

SMBIOS configuration table.

Definition at line 34 of file efi_smbios.c.