Intel Extensible Firmware Interface Manuel d'utilisateur Page 95

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 108
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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;
}
Vue de la page 94
1 2 ... 90 91 92 93 94 95 96 97 98 99 100 ... 107 108

Commentaires sur ces manuels

Pas de commentaire