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)
 
 EFI_USE_TABLE (SMBIOS3_TABLE, &smbios3_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...
 
static struct smbios3_entrysmbios3_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() [1/2]

EFI_USE_TABLE ( SMBIOS_TABLE  ,
smbios_entry,
 
)

◆ EFI_USE_TABLE() [2/2]

EFI_USE_TABLE ( SMBIOS3_TABLE  ,
smbios3_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 47 of file efi_smbios.c.

47  {
48 
49  /* Use 64-bit table if present */
53  smbios->count = 0;
54  smbios->version =
56  DBG ( "Found 64-bit SMBIOS v%d.%d entry point at %p (%lx+%zx)\n",
58  user_to_phys ( smbios->address, 0 ), smbios->len );
59  return 0;
60  }
61 
62  /* Otherwise, use 32-bit table if present */
67  smbios->version =
69  DBG ( "Found 32-bit SMBIOS v%d.%d entry point at %p (%lx+%zx)\n",
71  user_to_phys ( smbios->address, 0 ), smbios->len );
72  return 0;
73  }
74 
75  DBG ( "No SMBIOS table provided\n" );
76  return -ENODEV;
77 }
uint32_t signature
Signature.
Definition: smbios.h:55
#define SMBIOS_SIGNATURE
Signature for 32-bit SMBIOS entry point.
Definition: smbios.h:36
unsigned int count
Number of SMBIOS structures.
Definition: smbios.h:214
unsigned long user_to_phys(userptr_t userptr, off_t offset)
Convert user pointer to physical address.
size_t len
Length of SMBIOS structures.
Definition: smbios.h:212
userptr_t phys_to_user(unsigned long phys_addr)
Convert physical address to user pointer.
SMBIOS entry point descriptor.
Definition: smbios.h:208
#define SMBIOS3_SIGNATURE
Signature for 64-bit SMBIOS entry point.
Definition: smbios.h:40
uint16_t version
SMBIOS version.
Definition: smbios.h:216
uint16_t smbios_len
Structure table length.
Definition: smbios.h:75
uint32_t signature
Signature.
Definition: smbios.h:96
SMBIOS 32-bit entry point.
Definition: smbios.h:50
uint32_t smbios_address
Structure table address.
Definition: smbios.h:77
#define SMBIOS_VERSION(major, minor)
Calculate SMBIOS version.
Definition: smbios.h:226
#define ENODEV
No such device.
Definition: errno.h:509
uint16_t smbios_count
Number of SMBIOS structures.
Definition: smbios.h:79
uint8_t minor
Minor version.
Definition: smbios.h:63
uint8_t minor
Minor version.
Definition: smbios.h:106
userptr_t address
Start of SMBIOS structures.
Definition: smbios.h:210
uint32_t smbios_len
Structure table length.
Definition: smbios.h:114
uint64_t smbios_address
Structure table address.
Definition: smbios.h:116
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
uint8_t major
Major version.
Definition: smbios.h:61
uint8_t major
Major version.
Definition: smbios.h:104
SMBIOS 64-bit entry point.
Definition: smbios.h:91

References smbios::address, smbios::count, DBG, ENODEV, smbios::len, smbios_entry::major, smbios3_entry::major, smbios_entry::minor, smbios3_entry::minor, phys_to_user(), smbios_entry::signature, smbios3_entry::signature, SMBIOS3_SIGNATURE, smbios_entry::smbios_address, smbios3_entry::smbios_address, smbios_entry::smbios_count, smbios_entry::smbios_len, smbios3_entry::smbios_len, SMBIOS_SIGNATURE, SMBIOS_VERSION, user_to_phys(), 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.

◆ smbios3_entry

struct smbios3_entry* smbios3_entry
static

SMBIOS configuration table.

Definition at line 38 of file efi_smbios.c.