iPXE
Functions | Variables
efiprefix.c File Reference
#include <stdlib.h>
#include <errno.h>
#include <ipxe/device.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_driver.h>
#include <ipxe/efi/efi_snp.h>
#include <ipxe/efi/efi_autoboot.h>
#include <ipxe/efi/efi_watchdog.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
EFI_STATUS EFIAPI _efi_start (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
 EFI entry point.
static int efi_probe (struct root_device *rootdev __unused)
 Probe EFI root bus.
static void efi_remove (struct root_device *rootdev __unused)
 Remove EFI root bus.

Variables

static struct root_driver efi_root_driver
 EFI root device driver.
struct root_device efi_root_device __root_device
 EFI root device.

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER  )
EFI_STATUS EFIAPI _efi_start ( EFI_HANDLE  image_handle,
EFI_SYSTEM_TABLE systab 
)

EFI entry point.

Parameters:
image_handleImage handle
systabSystem table
Return values:
efircEFI return status code

Definition at line 38 of file efiprefix.c.

References efi_driver_reconnect_all(), efi_init(), efi_loaded_image, efi_set_autoboot(), efi_snp_claim(), efi_snp_release(), efi_watchdog_start(), efi_watchdog_stop(), EFIRC, main(), rc, and EFI_LOADED_IMAGE_PROTOCOL::Unload.

                                                          {
        EFI_STATUS efirc;
        int rc;

        /* Initialise EFI environment */
        if ( ( efirc = efi_init ( image_handle, systab ) ) != 0 )
                goto err_init;

        /* Record autoboot device (if any) */
        efi_set_autoboot();

        /* Claim SNP devices for use by iPXE */
        efi_snp_claim();

        /* Start watchdog holdoff timer */
        efi_watchdog_start();

        /* Call to main() */
        if ( ( rc = main() ) != 0 ) {
                efirc = EFIRC ( rc );
                goto err_main;
        }

 err_main:
        efi_watchdog_stop();
        efi_snp_release();
        efi_loaded_image->Unload ( image_handle );
        efi_driver_reconnect_all();
 err_init:
        return efirc;
}
static int efi_probe ( struct root_device *rootdev  __unused) [static]

Probe EFI root bus.

Parameters:
rootdevEFI root device

Definition at line 76 of file efiprefix.c.

References efi_driver_connect_all().

                                                              {

        return efi_driver_connect_all();
}
static void efi_remove ( struct root_device *rootdev  __unused) [static]

Remove EFI root bus.

Parameters:
rootdevEFI root device

Definition at line 86 of file efiprefix.c.

References efi_driver_disconnect_all().


Variable Documentation

struct root_driver efi_root_driver [static]
Initial value:
 {
        .probe = efi_probe,
        .remove = efi_remove,
}

EFI root device driver.

Definition at line 92 of file efiprefix.c.

struct root_device efi_root_device __root_device
Initial value:
 {
        .dev = { .name = "EFI" },
        .driver = &efi_root_driver,
}

EFI root device.

Definition at line 98 of file efiprefix.c.