iPXE
Functions | Variables
efidrvprefix.c File Reference
#include <stdlib.h>
#include <ipxe/init.h>
#include <ipxe/device.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_driver.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
EFI_STATUS EFIAPI _efidrv_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  )

◆ _efidrv_start()

EFI_STATUS EFIAPI _efidrv_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 35 of file efidrvprefix.c.

36  {
37  static struct efi_saved_tpl tpl; /* avoid triggering stack protector */
38  EFI_STATUS efirc;
39 
40  /* Initialise stack cookie */
41  efi_init_stack_guard ( image_handle );
42 
43  /* Initialise EFI environment */
44  if ( ( efirc = efi_init ( image_handle, systab ) ) != 0 )
45  return efirc;
46 
47  /* Raise TPL */
48  efi_raise_tpl ( &tpl );
49 
50  /* Initialise iPXE environment */
51  initialise();
52  startup();
53 
54  /* Restore TPL */
55  efi_restore_tpl ( &tpl );
56 
57  return 0;
58 }
static void efi_init_stack_guard(EFI_HANDLE handle)
Initialise stack cookie.
Definition: efi.h:322
void efi_raise_tpl(struct efi_saved_tpl *tpl)
Raise task priority level to internal level.
Definition: efi_init.c:394
void initialise(void)
Initialise iPXE.
Definition: init.c:52
An EFI saved task priority level.
Definition: efi.h:67
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:170
void efi_restore_tpl(struct efi_saved_tpl *tpl)
Restore task priority level.
Definition: efi_init.c:410
void startup(void)
Start up iPXE.
Definition: init.c:67

References efi_init(), efi_init_stack_guard(), efi_raise_tpl(), efi_restore_tpl(), initialise(), and startup().

◆ efi_probe()

static int efi_probe ( struct root_device *rootdev  __unused)
static

Probe EFI root bus.

Parameters
rootdevEFI root device

Definition at line 65 of file efidrvprefix.c.

65  {
66 
67  /* Do nothing */
68  return 0;
69 }

◆ efi_remove()

static void efi_remove ( struct root_device *rootdev  __unused)
static

Remove EFI root bus.

Parameters
rootdevEFI root device

Definition at line 76 of file efidrvprefix.c.

76  {
77 
79 }
void efi_driver_disconnect_all(void)
Disconnect EFI driver from all possible devices.
Definition: efi_driver.c:584

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: efidrvprefix.c:76
static int efi_probe(struct root_device *rootdev __unused)
Probe EFI root bus.
Definition: efidrvprefix.c:65

EFI root device driver.

Definition at line 82 of file efidrvprefix.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: efidrvprefix.c:82

EFI root device.

Definition at line 88 of file efidrvprefix.c.