Intel Extensible Firmware Interface Instrukcja Użytkownika Strona 95

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 108
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 94
EFI System Table
Version 1.10 12/01/02 4-17
4.7.3 EFI Driver Model Example (Unloadable)
The following is the same EFI Driver Model example as above, except it also includes the code
required to allow the driver to be unloaded through the boot service Unload()
. Any protocols
installed or memory allocated in AbcEntryPoint() must be uninstalled or freed in the
AbcUnload().
extern EFI_GUID gEfiLoadedImageProtocolGuid;
extern EFI_GUID gEfiDriverBindingProtocolGuid;
EFI_BOOT_SERVICES_TABLE *gBS;
static EFI_DRIVER_BINDING_PROTOCOL mAbcDriverBinding = {
AbcSupported,
AbcStart,
AbcStop,
1,
NULL,
NULL
};
EFI_STATUS
AbcUnload (
IN EFI_HANDLE ImageHandle
);
AbcEntryPoint(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
gBS = SystemTable->BootServices;
Status = gBS->OpenProtocol (
ImageHandle,
&gEfiLoadedImageProtocolGuid,
&LoadedImage,
ImageHandle,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR (Status)) {
return Status;
}
LoadedImage->Unload = AbcUnload;
mAbcDriverBinding->ImageHandle = ImageHandle;
mAbcDriverBinding->DriverBindingHandle = ImageHandle;
Status = gBS->InstallMultipleProtocolInterfaces(
&mAbcDriverBinding->DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, &mAbcDriverBinding,
NULL
);
return Status;
}
Przeglądanie stron 94
1 2 ... 90 91 92 93 94 95 96 97 98 99 100 ... 107 108

Komentarze do niniejszej Instrukcji

Brak uwag