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>
#include <ipxe/efi/efi_blacklist.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. More...
 
static int efi_probe (struct root_device *rootdev __unused)
 Probe EFI root bus. More...
 
static void efi_remove (struct root_device *rootdev __unused)
 Remove EFI root bus. More...
 

Variables

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

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ _efi_start()

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 39 of file efiprefix.c.

40  {
41  EFI_STATUS efirc;
42  int rc;
43 
44  /* Initialise EFI environment */
45  if ( ( efirc = efi_init ( image_handle, systab ) ) != 0 )
46  goto err_init;
47 
48  /* Record autoboot device (if any) */
50 
51  /* Claim SNP devices for use by iPXE */
52  efi_snp_claim();
53 
54  /* Start watchdog holdoff timer */
56 
57  /* Call to main() */
58  if ( ( rc = main() ) != 0 ) {
59  efirc = EFIRC ( rc );
60  goto err_main;
61  }
62 
63  err_main:
66  efi_loaded_image->Unload ( image_handle );
68  err_init:
69  return efirc;
70 }
EFI_LOADED_IMAGE_PROTOCOL * efi_loaded_image
Loaded image protocol for this image.
Definition: efi_init.c:33
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
static void efi_snp_claim(void)
Claim network devices for use by iPXE.
Definition: efi_snp.h:88
void efi_set_autoboot(void)
Identify autoboot device.
Definition: efi_autoboot.c:41
void efi_driver_reconnect_all(void)
Reconnect original EFI drivers to all possible devices.
Definition: efi_driver.c:573
static void efi_watchdog_start(void)
Start EFI watchdog holdoff timer.
Definition: efi_watchdog.h:17
static void efi_watchdog_stop(void)
Stop EFI watchdog holdoff timer.
Definition: efi_watchdog.h:26
EFI_IMAGE_UNLOAD Unload
Definition: LoadedImage.h:79
static void efi_snp_release(void)
Release network devices for use via SNP.
Definition: efi_snp.h:96
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
EFI_STATUS efi_init(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
Initialise EFI environment.
Definition: efi_init.c:97
__asmcall int main(void)
Main entry point.
Definition: main.c:28
#define EFIRC(rc)
Convert an iPXE status code to an EFI status code.
Definition: efi.h:149

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_probe()

static int efi_probe ( struct root_device *rootdev  __unused)
static

Probe EFI root bus.

Parameters
rootdevEFI root device

Definition at line 77 of file efiprefix.c.

77  {
78 
79  /* Unloaded any blacklisted drivers */
81 
82  /* Connect our drivers */
83  return efi_driver_connect_all();
84 }
int efi_driver_connect_all(void)
Connect EFI driver to all possible devices.
Definition: efi_driver.c:551
void efi_unload_blacklist(void)
Unload any blacklisted drivers.

References efi_driver_connect_all(), and efi_unload_blacklist().

◆ efi_remove()

static void efi_remove ( struct root_device *rootdev  __unused)
static

Remove EFI root bus.

Parameters
rootdevEFI root device

Definition at line 91 of file efiprefix.c.

91  {
92 
93  /* Disconnect our drivers */
95 }
void efi_driver_disconnect_all(void)
Disconnect EFI driver from all possible devices.
Definition: efi_driver.c:562

References efi_driver_disconnect_all().

Variable Documentation

◆ efi_root_driver

struct root_driver efi_root_driver
static
Initial value:
= {
.probe = efi_probe,
.remove = efi_remove,
}
static void efi_remove(struct root_device *rootdev __unused)
Remove EFI root bus.
Definition: efiprefix.c:91
static int efi_probe(struct root_device *rootdev __unused)
Probe EFI root bus.
Definition: efiprefix.c:77

EFI root device driver.

Definition at line 98 of file efiprefix.c.

◆ __root_device

struct root_device efi_root_device __root_device
Initial value:
= {
.dev = { .name = "EFI" },
.driver = &efi_root_driver,
}
static struct root_driver efi_root_driver
EFI root device driver.
Definition: efiprefix.c:98

EFI root device.

Definition at line 104 of file efiprefix.c.