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.
 PROVIDE_SMBIOS (efi, find_smbios, efi_find_smbios)

Variables

static struct smbios_entrysmbios_entry
 SMBIOS configuration table.

Detailed Description

iPXE SMBIOS API for EFI

Definition in file efi_smbios.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER  )
EFI_USE_TABLE ( SMBIOS_TABLE  ,
smbios_entry,
 
)
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.

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.

                                                     {

        if ( ! smbios_entry ) {
                DBG ( "No SMBIOS table provided\n" );
                return -ENODEV;
        }

        if ( smbios_entry->signature != SMBIOS_SIGNATURE ) {
                DBG ( "Invalid SMBIOS signature\n" );
                return -ENODEV;
        }

        smbios->address = phys_to_user ( smbios_entry->smbios_address );
        smbios->len = smbios_entry->smbios_len;
        smbios->count = smbios_entry->smbios_count;
        smbios->version =
                SMBIOS_VERSION ( smbios_entry->major, smbios_entry->minor );
        DBG ( "Found SMBIOS v%d.%d entry point at %p (%x+%zx)\n",
              smbios_entry->major, smbios_entry->minor, smbios_entry,
              smbios_entry->smbios_address, smbios->len );

        return 0;
}

Variable Documentation

struct smbios_entry* smbios_entry [static]

SMBIOS configuration table.

Definition at line 34 of file efi_smbios.c.