Intel Extensible Firmware Interface User Manual

Page 93

Advertising
background image

EFI System Table

Version 1.10

12/01/02

4-15

//
// Use the EFI Runtime Services Table to get the current time and date.
//
Status = gRT->GetTime (&Time, NULL)
if (EFI_ERROR (Status)) {
return Status;
}

return Status;
}

The following example shows the EFI image entry point for an EFI Driver that does not follow the
EFI Driver Model. Since this driver returns

EFI_SUCCESS

, it will stay resident in memory after

it exits.


EFI_SYSTEM_TABLE *gST;
EFI_BOOT_SERVICES_TABLE *gBS;
EFI_RUNTIME_SERVICES_TABLE *gRT;

EfiDriverEntryPoint(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)

{
gST = SystemTable;
gBS = gST->BootServices;
gRT = gST->RuntimeServices;

//
// Implement driver initialization here.
//

return EFI_SUCCESS;
}

The following example shows the EFI image entry point for an EFI Driver that also does not follow
the EFI Driver Model. Since this driver returns

EFI_DEVICE_ERROR

, it will not stay resident in

memory after it exits.


EFI_SYSTEM_TABLE *gST;
EFI_BOOT_SERVICES_TABLE *gBS;
EFI_RUNTIME_SERVICES_TABLE *gRT;

EfiDriverEntryPoint(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)

{
gST = SystemTable;
gBS = gST->BootServices;
gRT = gST->RuntimeServices;

Advertising