beautypg.com

4 efi driver model example (multiple instances) – Intel Extensible Firmware Interface User Manual

Page 96

background image

Extensible Firmware Interface Specification

4-18

12/01/02

Version 1.10


EFI_STATUS
AbcUnload (
IN EFI_HANDLE ImageHandle
)

{
EFI_STATUS Status;

Status = gBS->UninstallMultipleProtocolInterfaces (
ImageHandle,
&gEfiDriverBindingProtocolGuid, &mAbcDriverBinding,
NULL
);
return Status;
}

4.7.4

EFI Driver Model Example (Multiple Instances)

The following is the same as the first EFI Driver Model example, except it produces three

EFI_DRIVER_BINDING_PROTOCOL

instances. The first one is installed onto the driver’s

image handle. The other two are installed onto newly created handles.


extern EFI_GUID gEfiDriverBindingProtocolGuid;
EFI_BOOT_SERVICES_TABLE *gBS;

static EFI_DRIVER_BINDING_PROTOCOL mAbcDriverBindingA = {
AbcSupportedA,
AbcStartA,
AbcStopA,
1,
NULL,
NULL
};

static EFI_DRIVER_BINDING_PROTOCOL mAbcDriverBindingB = {
AbcSupportedB,
AbcStartB,
AbcStopB,
1,
NULL,
NULL
};

static EFI_DRIVER_BINDING_PROTOCOL mAbcDriverBindingC = {
AbcSupportedC,
AbcStartC,
AbcStopC,
1,
NULL,
NULL
};