diff options
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Hand')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Hand/DriverSupport.c | 211 | ||||
-rw-r--r-- | MdeModulePkg/Core/Dxe/Hand/Notify.c | 124 | ||||
-rw-r--r-- | MdeModulePkg/Core/Dxe/Hand/handle.c | 735 | ||||
-rw-r--r-- | MdeModulePkg/Core/Dxe/Hand/locate.c | 307 |
4 files changed, 606 insertions, 771 deletions
diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c index 72ebc8e897..09adddfb53 100644 --- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c +++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c @@ -17,7 +17,28 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. //
// Driver Support Function Prototypes
-//
+//
+/**
+ Connects a controller to a driver.
+
+ @param ControllerHandle Handle of the controller to be
+ connected.
+ @param ContextDriverImageHandles DriverImageHandle A pointer to an
+ ordered list of driver image
+ handles.
+ @param RemainingDevicePath RemainingDevicePath A pointer to
+ the device path that specifies a
+ child of the controller
+ specified by ControllerHandle.
+
+ @retval EFI_SUCCESS One or more drivers were
+ connected to ControllerHandle.
+ @retval EFI_OUT_OF_RESOURCES No enough system resources to
+ complete the request.
+ @retval EFI_NOT_FOUND No drivers were connected to
+ ControllerHandle.
+
+**/
EFI_STATUS
CoreConnectSingleController (
IN EFI_HANDLE ControllerHandle,
@@ -28,6 +49,25 @@ CoreConnectSingleController ( //
// Driver Support Functions
//
+
+/**
+ Connects one or more drivers to a controller.
+
+ @param ControllerHandle Handle of the controller to be
+ connected.
+ @param DriverImageHandle DriverImageHandle A pointer to an
+ ordered list of driver image
+ handles.
+ @param RemainingDevicePath RemainingDevicePath A pointer to
+ the device path that specifies a
+ child of the controller specified
+ by ControllerHandle.
+ @param Recursive Whether the function would be
+ called recursively or not.
+
+ @return Status code.
+
+**/
EFI_STATUS
EFIAPI
CoreConnectController (
@@ -36,28 +76,6 @@ CoreConnectController ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,
IN BOOLEAN Recursive
)
-/*++
-
-Routine Description:
-
- Connects one or more drivers to a controller.
-
-Arguments:
-
- ControllerHandle - Handle of the controller to be connected.
-
- DriverImageHandle - DriverImageHandle A pointer to an ordered list of driver image handles.
-
- RemainingDevicePath - RemainingDevicePath A pointer to the device path that specifies a child of the
- controller specified by ControllerHandle.
-
- Recursive - Whether the function would be called recursively or not.
-
-Returns:
-
- Status code.
-
---*/
{
EFI_STATUS Status;
EFI_STATUS ReturnStatus;
@@ -195,6 +213,26 @@ Returns: return ReturnStatus;
}
+
+/**
+ Add Driver Binding Protocols from Context Driver Image Handles to sorted
+ Driver Binding Protocol list.
+
+ @param DriverBindingHandle Handle of the driver binding
+ protocol.
+ @param NumberOfSortedDriverBindingProtocols Number Of sorted driver binding
+ protocols
+ @param SortedDriverBindingProtocols The sorted protocol list.
+ @param DriverBindingHandleCount Driver Binding Handle Count.
+ @param DriverBindingHandleBuffer The buffer of driver binding
+ protocol to be modified.
+ @param IsImageHandle Indicate whether
+ DriverBindingHandle is an image
+ handle
+
+ @return None.
+
+**/
VOID
AddSortedDriverBindingProtocol (
IN EFI_HANDLE DriverBindingHandle,
@@ -204,32 +242,6 @@ AddSortedDriverBindingProtocol ( IN OUT EFI_HANDLE *DriverBindingHandleBuffer,
IN BOOLEAN IsImageHandle
)
-/*++
-
-Routine Description:
-
- Add Driver Binding Protocols from Context Driver Image Handles to sorted
- Driver Binding Protocol list.
-
-Arguments:
-
- DriverBindingHandle - Handle of the driver binding protocol.
-
- NumberOfSortedDriverBindingProtocols - Number Of sorted driver binding protocols
-
- SortedDriverBindingProtocols - The sorted protocol list.
-
- DriverBindingHandleCount - Driver Binding Handle Count.
-
- DriverBindingHandleBuffer - The buffer of driver binding protocol to be modified.
-
- IsImageHandle - Indicate whether DriverBindingHandle is an image handle
-
-Returns:
-
- None.
-
---*/
{
EFI_STATUS Status;
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
@@ -324,32 +336,34 @@ Returns: }
}
+
+/**
+ Connects a controller to a driver.
+
+ @param ControllerHandle Handle of the controller to be
+ connected.
+ @param ContextDriverImageHandles DriverImageHandle A pointer to an
+ ordered list of driver image
+ handles.
+ @param RemainingDevicePath RemainingDevicePath A pointer to
+ the device path that specifies a
+ child of the controller
+ specified by ControllerHandle.
+
+ @retval EFI_SUCCESS One or more drivers were
+ connected to ControllerHandle.
+ @retval EFI_OUT_OF_RESOURCES No enough system resources to
+ complete the request.
+ @retval EFI_NOT_FOUND No drivers were connected to
+ ControllerHandle.
+
+**/
EFI_STATUS
CoreConnectSingleController (
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE *ContextDriverImageHandles OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
-/*++
-
-Routine Description:
-
- Connects a controller to a driver.
-
-Arguments:
-
- ControllerHandle - Handle of the controller to be connected.
- ContextDriverImageHandles - DriverImageHandle A pointer to an ordered list of driver image handles.
- RemainingDevicePath - RemainingDevicePath A pointer to the device path that specifies a child
- of the controller specified by ControllerHandle.
-
-Returns:
-
- EFI_SUCCESS - One or more drivers were connected to ControllerHandle.
- EFI_OUT_OF_RESOURCES - No enough system resources to complete the request.
- EFI_NOT_FOUND - No drivers were connected to ControllerHandle.
-
---*/
{
EFI_STATUS Status;
UINTN Index;
@@ -610,6 +624,40 @@ Returns: }
+
+/**
+ Disonnects a controller from a driver
+
+ @param ControllerHandle ControllerHandle The handle of
+ the controller from which
+ driver(s) are to be
+ disconnected.
+ @param DriverImageHandle DriverImageHandle The driver to
+ disconnect from ControllerHandle.
+ @param ChildHandle ChildHandle The handle of the
+ child to destroy.
+
+ @retval EFI_SUCCESS One or more drivers were
+ disconnected from the controller.
+ @retval EFI_SUCCESS On entry, no drivers are managing
+ ControllerHandle.
+ @retval EFI_SUCCESS DriverImageHandle is not NULL,
+ and on entry DriverImageHandle is
+ not managing ControllerHandle.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid
+ EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER DriverImageHandle is not NULL,
+ and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it
+ is not a valid EFI_HANDLE.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources
+ available to disconnect any
+ drivers from ControllerHandle.
+ @retval EFI_DEVICE_ERROR The controller could not be
+ disconnected because of a device
+ error.
+
+**/
EFI_STATUS
EFIAPI
CoreDisconnectController (
@@ -617,31 +665,6 @@ CoreDisconnectController ( IN EFI_HANDLE DriverImageHandle OPTIONAL,
IN EFI_HANDLE ChildHandle OPTIONAL
)
-/*++
-
-Routine Description:
-
- Disonnects a controller from a driver
-
-Arguments:
-
- ControllerHandle - ControllerHandle The handle of the controller from which driver(s)
- are to be disconnected.
- DriverImageHandle - DriverImageHandle The driver to disconnect from ControllerHandle.
- ChildHandle - ChildHandle The handle of the child to destroy.
-
-Returns:
-
- EFI_SUCCESS - One or more drivers were disconnected from the controller.
- EFI_SUCCESS - On entry, no drivers are managing ControllerHandle.
- EFI_SUCCESS - DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.
- EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
- EFI_OUT_OF_RESOURCES - There are not enough resources available to disconnect any drivers from ControllerHandle.
- EFI_DEVICE_ERROR - The controller could not be disconnected because of a device error.
-
---*/
{
EFI_STATUS Status;
IHANDLE *Handle;
diff --git a/MdeModulePkg/Core/Dxe/Hand/Notify.c b/MdeModulePkg/Core/Dxe/Hand/Notify.c index 8d64a5c883..7ee81b984e 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Notify.c +++ b/MdeModulePkg/Core/Dxe/Hand/Notify.c @@ -15,23 +15,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <DxeMain.h>
-VOID
-CoreNotifyProtocolEntry (
- IN PROTOCOL_ENTRY *ProtEntry
- )
-/*++
-
-Routine Description:
+/**
Signal event for every protocol in protocol entry.
-Arguments:
-
- ProtEntry - Protocol entry
+ @param ProtEntry Protocol entry
-Returns:
-
---*/
+**/
+VOID
+CoreNotifyProtocolEntry (
+ IN PROTOCOL_ENTRY *ProtEntry
+ )
{
PROTOCOL_NOTIFY *ProtNotify;
LIST_ENTRY *Link;
@@ -45,31 +39,23 @@ Returns: }
+
+/**
+ Removes Protocol from the protocol list (but not the handle list).
+
+ @param Handle The handle to remove protocol on.
+ @param Protocol GUID of the protocol to be moved
+ @param Interface The interface of the protocol
+
+ @return Protocol Entry
+
+**/
PROTOCOL_INTERFACE *
CoreRemoveInterfaceFromProtocol (
IN IHANDLE *Handle,
IN EFI_GUID *Protocol,
IN VOID *Interface
)
-/*++
-
-Routine Description:
-
- Removes Protocol from the protocol list (but not the handle list).
-
-Arguments:
-
- Handle - The handle to remove protocol on.
-
- Protocol - GUID of the protocol to be moved
-
- Interface - The interface of the protocol
-
-Returns:
-
- Protocol Entry
-
---*/
{
PROTOCOL_INTERFACE *Prot;
PROTOCOL_NOTIFY *ProtNotify;
@@ -107,6 +93,20 @@ Returns: +
+/**
+ Add a new protocol notification record for the request protocol.
+
+ @param Protocol The requested protocol to add the notify
+ registration
+ @param Event The event to signal
+ @param Registration Returns the registration record
+
+ @retval EFI_INVALID_PARAMETER Invalid parameter
+ @retval EFI_SUCCESS Successfully returned the registration record
+ that has been added
+
+**/
EFI_STATUS
EFIAPI
CoreRegisterProtocolNotify (
@@ -114,28 +114,6 @@ CoreRegisterProtocolNotify ( IN EFI_EVENT Event,
OUT VOID **Registration
)
-/*++
-
-Routine Description:
-
- Add a new protocol notification record for the request protocol.
-
-Arguments:
-
- Protocol - The requested protocol to add the notify registration
-
- Event - The event to signal
-
- Registration - Returns the registration record
-
-
-Returns:
-
- EFI_INVALID_PARAMETER - Invalid parameter
-
- EFI_SUCCESS - Successfully returned the registration record that has been added
-
---*/
{
PROTOCOL_ENTRY *ProtEntry;
PROTOCOL_NOTIFY *ProtNotify;
@@ -194,6 +172,21 @@ Returns: +
+/**
+ Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.
+
+ @param UserHandle Handle on which the interface is to be
+ reinstalled
+ @param Protocol The numeric ID of the interface
+ @param OldInterface A pointer to the old interface
+ @param NewInterface A pointer to the new interface
+
+ @retval EFI_SUCCESS The protocol interface was installed
+ @retval EFI_NOT_FOUND The OldInterface on the handle was not found
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
+
+**/
EFI_STATUS
EFIAPI
CoreReinstallProtocolInterface (
@@ -202,29 +195,6 @@ CoreReinstallProtocolInterface ( IN VOID *OldInterface,
IN VOID *NewInterface
)
-/*++
-
-Routine Description:
-
- Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.
-
-Arguments:
-
- UserHandle - Handle on which the interface is to be reinstalled
- Protocol - The numeric ID of the interface
- OldInterface - A pointer to the old interface
- NewInterface - A pointer to the new interface
-
-
-Returns:
-
- Status code.
-
- On EFI_SUCCESS The protocol interface was installed
- On EFI_NOT_FOUND The OldInterface on the handle was not found
- On EFI_INVALID_PARAMETER One of the parameters has an invalid value
-
---*/
{
EFI_STATUS Status;
IHANDLE *Handle;
diff --git a/MdeModulePkg/Core/Dxe/Hand/handle.c b/MdeModulePkg/Core/Dxe/Hand/handle.c index 36d81997c9..d95cef76df 100644 --- a/MdeModulePkg/Core/Dxe/Hand/handle.c +++ b/MdeModulePkg/Core/Dxe/Hand/handle.c @@ -1,6 +1,6 @@ /** @file
- UEFI handle & protocol handling
+ UEFI handle & protocol handling.
Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -28,75 +28,48 @@ EFI_LOCK gProtocolDatabaseLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL UINT64 gHandleDatabaseKey = 0;
+
+/**
+ Acquire lock on gProtocolDatabaseLock.
+
+**/
VOID
CoreAcquireProtocolLock (
VOID
)
-/*++
-
-Routine Description:
-
- Acquire lock on gProtocolDatabaseLock.
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
{
CoreAcquireLock (&gProtocolDatabaseLock);
}
+
+/**
+ Release lock on gProtocolDatabaseLock.
+
+**/
VOID
CoreReleaseProtocolLock (
VOID
)
-/*++
-
-Routine Description:
-
- Release lock on gProtocolDatabaseLock.
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
{
CoreReleaseLock (&gProtocolDatabaseLock);
}
-EFI_STATUS
-CoreValidateHandle (
- IN EFI_HANDLE UserHandle
- )
-/*++
-
-Routine Description:
+/**
Check whether a handle is a valid EFI_HANDLE
-
-Arguments:
-
- UserHandle - The handle to check
-
-Returns:
- EFI_INVALID_PARAMETER - The handle is NULL or not a valid EFI_HANDLE.
+ @param UserHandle The handle to check
- EFI_SUCCESS - The handle is valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER The handle is NULL or not a valid EFI_HANDLE.
+ @retval EFI_SUCCESS The handle is valid EFI_HANDLE.
---*/
+**/
+EFI_STATUS
+CoreValidateHandle (
+ IN EFI_HANDLE UserHandle
+ )
{
IHANDLE *Handle;
@@ -111,30 +84,22 @@ Returns: }
-PROTOCOL_ENTRY *
-CoreFindProtocolEntry (
- IN EFI_GUID *Protocol,
- IN BOOLEAN Create
- )
-/*++
-
-Routine Description:
+/**
Finds the protocol entry for the requested protocol.
-
The gProtocolDatabaseLock must be owned
-Arguments:
-
- Protocol - The ID of the protocol
-
- Create - Create a new entry if not found
+ @param Protocol The ID of the protocol
+ @param Create Create a new entry if not found
-Returns:
+ @return Protocol entry
- Protocol entry
-
---*/
+**/
+PROTOCOL_ENTRY *
+CoreFindProtocolEntry (
+ IN EFI_GUID *Protocol,
+ IN BOOLEAN Create
+ )
{
LIST_ENTRY *Link;
PROTOCOL_ENTRY *Item;
@@ -190,34 +155,25 @@ Returns: }
+
+/**
+ Finds the protocol instance for the requested handle and protocol.
+ Note: This function doesn't do parameters checking, it's caller's responsibility
+ to pass in valid parameters.
+
+ @param Handle The handle to search the protocol on
+ @param Protocol GUID of the protocol
+ @param Interface The interface for the protocol being searched
+
+ @return Protocol instance (NULL: Not found)
+
+**/
PROTOCOL_INTERFACE *
CoreFindProtocolInterface (
IN IHANDLE *Handle,
IN EFI_GUID *Protocol,
IN VOID *Interface
)
-/*++
-
-Routine Description:
-
- Finds the protocol instance for the requested handle and protocol.
-
- Note: This function doesn't do parameters checking, it's caller's responsibility
- to pass in valid parameters.
-
-Arguments:
-
- Handle - The handle to search the protocol on
-
- Protocol - GUID of the protocol
-
- Interface - The interface for the protocol being searched
-
-Returns:
-
- Protocol instance (NULL: Not found)
-
---*/
{
PROTOCOL_INTERFACE *Prot;
PROTOCOL_ENTRY *ProtEntry;
@@ -253,27 +209,22 @@ Returns: return Prot;
}
-STATIC
-EFI_STATUS
-CoreUnregisterProtocolNotifyEvent (
- IN EFI_EVENT Event
- )
-/*++
-
-Routine Description:
+/**
Removes an event from a register protocol notify list on a protocol.
-Arguments:
-
- Event - The event to search for in the protocol database.
-
-Returns:
+ @param Event The event to search for in the protocol
+ database.
- EFI_SUCCESS if the event was found and removed.
- EFI_NOT_FOUND if the event was not found in the protocl database.
+ @return EFI_SUCCESS if the event was found and removed.
+ @return EFI_NOT_FOUND if the event was not found in the protocl database.
---*/
+**/
+STATIC
+EFI_STATUS
+CoreUnregisterProtocolNotifyEvent (
+ IN EFI_EVENT Event
+ )
{
LIST_ENTRY *Link;
PROTOCOL_ENTRY *ProtEntry;
@@ -308,25 +259,20 @@ Returns: }
-EFI_STATUS
-CoreUnregisterProtocolNotify (
- IN EFI_EVENT Event
- )
-/*++
-
-Routine Description:
+/**
Removes all the events in the protocol database that match Event.
-Arguments:
-
- Event - The event to search for in the protocol database.
-
-Returns:
+ @param Event The event to search for in the protocol
+ database.
- EFI_SUCCESS when done searching the entire database.
+ @return EFI_SUCCESS when done searching the entire database.
---*/
+**/
+EFI_STATUS
+CoreUnregisterProtocolNotify (
+ IN EFI_EVENT Event
+ )
{
EFI_STATUS Status;
@@ -339,6 +285,21 @@ Returns: +
+/**
+ Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which
+ Calls the private one which contains a BOOLEAN parameter for notifications
+
+ @param UserHandle The handle to install the protocol handler on,
+ or NULL if a new handle is to be allocated
+ @param Protocol The protocol to add to the handle
+ @param InterfaceType Indicates whether Interface is supplied in
+ native form.
+ @param Interface The interface for the protocol being added
+
+ @return Status code
+
+**/
EFI_STATUS
EFIAPI
CoreInstallProtocolInterface (
@@ -347,29 +308,6 @@ CoreInstallProtocolInterface ( IN EFI_INTERFACE_TYPE InterfaceType,
IN VOID *Interface
)
-/*++
-
-Routine Description:
-
- Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which
- Calls the private one which contains a BOOLEAN parameter for notifications
-
-Arguments:
-
- UserHandle - The handle to install the protocol handler on,
- or NULL if a new handle is to be allocated
-
- Protocol - The protocol to add to the handle
-
- InterfaceType - Indicates whether Interface is supplied in native form.
-
- Interface - The interface for the protocol being added
-
-Returns:
-
- Status code
-
---*/
{
return CoreInstallProtocolInterfaceNotify (
UserHandle,
@@ -380,6 +318,24 @@ Returns: );
}
+
+/**
+ Installs a protocol interface into the boot services environment.
+
+ @param UserHandle The handle to install the protocol handler on,
+ or NULL if a new handle is to be allocated
+ @param Protocol The protocol to add to the handle
+ @param InterfaceType Indicates whether Interface is supplied in
+ native form.
+ @param Interface The interface for the protocol being added
+ @param Notify indicates whether notify the notification list
+ for this protocol
+
+ @retval EFI_INVALID_PARAMETER Invalid parameter
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
+ @retval EFI_SUCCESS Protocol interface successfully installed
+
+**/
EFI_STATUS
CoreInstallProtocolInterfaceNotify (
IN OUT EFI_HANDLE *UserHandle,
@@ -388,35 +344,6 @@ CoreInstallProtocolInterfaceNotify ( IN VOID *Interface,
IN BOOLEAN Notify
)
-/*++
-
-Routine Description:
-
- Installs a protocol interface into the boot services environment.
-
-Arguments:
-
- UserHandle - The handle to install the protocol handler on,
- or NULL if a new handle is to be allocated
-
- Protocol - The protocol to add to the handle
-
- InterfaceType - Indicates whether Interface is supplied in native form.
-
- Interface - The interface for the protocol being added
-
- Notify - indicates whether notify the notification list
- for this protocol
-
-Returns:
-
- EFI_INVALID_PARAMETER - Invalid parameter
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - Protocol interface successfully installed
-
---*/
{
PROTOCOL_INTERFACE *Prot;
PROTOCOL_ENTRY *ProtEntry;
@@ -439,7 +366,7 @@ Returns: //
// Print debug message
//
- DEBUG((EFI_D_ERROR | EFI_D_INFO, "InstallProtocolInterface: %g %p\n", Protocol, Interface));
+ DEBUG((DEBUG_ERROR | DEBUG_INFO, "InstallProtocolInterface: %g %p\n", Protocol, Interface));
Status = EFI_OUT_OF_RESOURCES;
Prot = NULL;
@@ -574,38 +501,32 @@ Done: -EFI_STATUS
-EFIAPI
-CoreInstallMultipleProtocolInterfaces (
- IN OUT EFI_HANDLE *Handle,
- ...
- )
-/*++
-
-Routine Description:
+/**
Installs a list of protocol interface into the boot services environment.
This function calls InstallProtocolInterface() in a loop. If any error
- occures all the protocols added by this function are removed. This is
+ occures all the protocols added by this function are removed. This is
basically a lib function to save space.
-Arguments:
-
- Handle - The handle to install the protocol handlers on,
- or NULL if a new handle is to be allocated
- ... - EFI_GUID followed by protocol instance. A NULL terminates the
- list. The pairs are the arguments to InstallProtocolInterface().
- All the protocols are added to Handle.
+ @param Handle The handle to install the protocol handlers on,
+ or NULL if a new handle is to be allocated
+ @param ... EFI_GUID followed by protocol instance. A NULL
+ terminates the list. The pairs are the
+ arguments to InstallProtocolInterface(). All the
+ protocols are added to Handle.
-Returns:
+ @retval EFI_INVALID_PARAMETER Handle is NULL.
+ @retval EFI_SUCCESS Protocol interfaces successfully installed.
- EFI_INVALID_PARAMETER - Handle is NULL.
-
- EFI_SUCCESS - Protocol interfaces successfully installed.
-
---*/
+**/
+EFI_STATUS
+EFIAPI
+CoreInstallMultipleProtocolInterfaces (
+ IN OUT EFI_HANDLE *Handle,
+ ...
+ )
{
- VA_LIST args;
+ VA_LIST Args;
EFI_STATUS Status;
EFI_GUID *Protocol;
VOID *Interface;
@@ -628,17 +549,17 @@ Returns: //
// Check for duplicate device path and install the protocol interfaces
//
- VA_START (args, Handle);
+ VA_START (Args, Handle);
for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) {
//
// If protocol is NULL, then it's the end of the list
//
- Protocol = VA_ARG (args, EFI_GUID *);
+ Protocol = VA_ARG (Args, EFI_GUID *);
if (Protocol == NULL) {
break;
}
- Interface = VA_ARG (args, VOID *);
+ Interface = VA_ARG (Args, VOID *);
//
// Make sure you are installing on top a device path that has already been added.
@@ -666,10 +587,10 @@ Returns: //
// Reset the va_arg back to the first argument.
//
- VA_START (args, Handle);
+ VA_START (Args, Handle);
for (; Index > 1; Index--) {
- Protocol = VA_ARG (args, EFI_GUID *);
- Interface = VA_ARG (args, VOID *);
+ Protocol = VA_ARG (Args, EFI_GUID *);
+ Interface = VA_ARG (Args, VOID *);
CoreUninstallProtocolInterface (*Handle, Protocol, Interface);
}
*Handle = OldHandle;
@@ -682,32 +603,26 @@ Returns: return Status;
}
-EFI_STATUS
-CoreDisconnectControllersUsingProtocolInterface (
- IN EFI_HANDLE UserHandle,
- IN PROTOCOL_INTERFACE *Prot
- )
-/*++
-
-Routine Description:
+/**
Attempts to disconnect all drivers that are using the protocol interface being queried.
If failed, reconnect all drivers disconnected.
-
- Note: This function doesn't do parameters checking, it's caller's responsibility
- to pass in valid parameters.
-
-Arguments:
-
- UserHandle - The handle on which the protocol is installed
- Prot - The protocol to disconnect drivers from
+ Note: This function doesn't do parameters checking, it's caller's responsibility
+ to pass in valid parameters.
-Returns:
+ @param UserHandle The handle on which the protocol is installed
+ @param Prot The protocol to disconnect drivers from
- EFI_SUCCESS - Drivers using the protocol interface are all disconnected
- EFI_ACCESS_DENIED - Failed to disconnect one or all of the drivers
+ @retval EFI_SUCCESS Drivers using the protocol interface are all
+ disconnected
+ @retval EFI_ACCESS_DENIED Failed to disconnect one or all of the drivers
---*/
+**/
+EFI_STATUS
+CoreDisconnectControllersUsingProtocolInterface (
+ IN EFI_HANDLE UserHandle,
+ IN PROTOCOL_INTERFACE *Prot
+ )
{
EFI_STATUS Status;
BOOLEAN ItemFound;
@@ -773,6 +688,20 @@ Returns: }
+
+/**
+ Uninstalls all instances of a protocol:interfacer from a handle.
+ If the last protocol interface is remove from the handle, the
+ handle is freed.
+
+ @param UserHandle The handle to remove the protocol handler from
+ @param Protocol The protocol, of protocol:interface, to remove
+ @param Interface The interface, of protocol:interface, to remove
+
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
+ @retval EFI_SUCCESS Protocol interface successfully uninstalled.
+
+**/
EFI_STATUS
EFIAPI
CoreUninstallProtocolInterface (
@@ -780,29 +709,6 @@ CoreUninstallProtocolInterface ( IN EFI_GUID *Protocol,
IN VOID *Interface
)
-/*++
-
-Routine Description:
-
- Uninstalls all instances of a protocol:interfacer from a handle.
- If the last protocol interface is remove from the handle, the
- handle is freed.
-
-Arguments:
-
- UserHandle - The handle to remove the protocol handler from
-
- Protocol - The protocol, of protocol:interface, to remove
-
- Interface - The interface, of protocol:interface, to remove
-
-Returns:
-
- EFI_INVALID_PARAMETER - Protocol is NULL.
-
- EFI_SUCCESS - Protocol interface successfully uninstalled.
-
---*/
{
EFI_STATUS Status;
IHANDLE *Handle;
@@ -897,51 +803,45 @@ Done: +
+/**
+ Uninstalls a list of protocol interface in the boot services environment.
+ This function calls UnisatllProtocolInterface() in a loop. This is
+ basically a lib function to save space.
+
+ @param Handle The handle to uninstall the protocol
+ @param ... EFI_GUID followed by protocol instance. A NULL
+ terminates the list. The pairs are the
+ arguments to UninstallProtocolInterface(). All
+ the protocols are added to Handle.
+
+ @return Status code
+
+**/
EFI_STATUS
EFIAPI
CoreUninstallMultipleProtocolInterfaces (
IN EFI_HANDLE Handle,
...
)
-/*++
-
-Routine Description:
-
- Uninstalls a list of protocol interface in the boot services environment.
- This function calls UnisatllProtocolInterface() in a loop. This is
- basically a lib function to save space.
-
-Arguments:
-
- Handle - The handle to uninstall the protocol
-
- ... - EFI_GUID followed by protocol instance. A NULL terminates the
- list. The pairs are the arguments to UninstallProtocolInterface().
- All the protocols are added to Handle.
-
-Returns:
-
- Status code
-
---*/
{
EFI_STATUS Status;
- VA_LIST args;
+ VA_LIST Args;
EFI_GUID *Protocol;
VOID *Interface;
UINTN Index;
- VA_START (args, Handle);
+ VA_START (Args, Handle);
for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) {
//
// If protocol is NULL, then it's the end of the list
//
- Protocol = VA_ARG (args, EFI_GUID *);
+ Protocol = VA_ARG (Args, EFI_GUID *);
if (Protocol == NULL) {
break;
}
- Interface = VA_ARG (args, VOID *);
+ Interface = VA_ARG (Args, VOID *);
//
// Uninstall it
@@ -957,10 +857,10 @@ Returns: //
// Reset the va_arg back to the first argument.
//
- VA_START (args, Handle);
+ VA_START (Args, Handle);
for (; Index > 1; Index--) {
- Protocol = VA_ARG(args, EFI_GUID *);
- Interface = VA_ARG(args, VOID *);
+ Protocol = VA_ARG(Args, EFI_GUID *);
+ Interface = VA_ARG(Args, VOID *);
CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFACE, Interface);
}
}
@@ -968,29 +868,22 @@ Returns: return Status;
}
+
+/**
+ Locate a certain GUID protocol interface in a Handle's protocols.
+
+ @param UserHandle The handle to obtain the protocol interface on
+ @param Protocol The GUID of the protocol
+
+ @return The requested protocol interface for the handle
+
+**/
STATIC
PROTOCOL_INTERFACE *
CoreGetProtocolInterface (
IN EFI_HANDLE UserHandle,
IN EFI_GUID *Protocol
)
-/*++
-
-Routine Description:
-
- Locate a certain GUID protocol interface in a Handle's protocols.
-
-Arguments:
-
- UserHandle - The handle to obtain the protocol interface on
-
- Protocol - The GUID of the protocol
-
-Returns:
-
- The requested protocol interface for the handle
-
---*/
{
EFI_STATUS Status;
PROTOCOL_ENTRY *ProtEntry;
@@ -1019,6 +912,18 @@ Returns: }
+
+/**
+ Queries a handle to determine if it supports a specified protocol.
+
+ @param UserHandle The handle being queried.
+ @param Protocol The published unique identifier of the protocol.
+ @param Interface Supplies the address where a pointer to the
+ corresponding Protocol Interface is returned.
+
+ @return The requested protocol interface for the handle
+
+**/
EFI_STATUS
EFIAPI
CoreHandleProtocol (
@@ -1026,26 +931,6 @@ CoreHandleProtocol ( IN EFI_GUID *Protocol,
OUT VOID **Interface
)
-/*++
-
-Routine Description:
-
- Queries a handle to determine if it supports a specified protocol.
-
-Arguments:
-
- UserHandle - The handle being queried.
-
- Protocol - The published unique identifier of the protocol.
-
- Interface - Supplies the address where a pointer to the corresponding Protocol
- Interface is returned.
-
-Returns:
-
- The requested protocol interface for the handle
-
---*/
{
return CoreOpenProtocol (
UserHandle,
@@ -1058,6 +943,27 @@ Returns: }
+
+/**
+ Locates the installed protocol handler for the handle, and
+ invokes it to obtain the protocol interface. Usage information
+ is registered in the protocol data base.
+
+ @param UserHandle The handle to obtain the protocol interface on
+ @param Protocol The ID of the protocol
+ @param Interface The location to return the protocol interface
+ @param ImageHandle The handle of the Image that is opening the
+ protocol interface specified by Protocol and
+ Interface.
+ @param ControllerHandle The controller handle that is requiring this
+ interface.
+ @param Attributes The open mode of the protocol interface
+ specified by Handle and Protocol.
+
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
+ @retval EFI_SUCCESS Get the protocol interface.
+
+**/
EFI_STATUS
EFIAPI
CoreOpenProtocol (
@@ -1068,37 +974,6 @@ CoreOpenProtocol ( IN EFI_HANDLE ControllerHandle,
IN UINT32 Attributes
)
-/*++
-
-Routine Description:
-
- Locates the installed protocol handler for the handle, and
- invokes it to obtain the protocol interface. Usage information
- is registered in the protocol data base.
-
-Arguments:
-
- UserHandle - The handle to obtain the protocol interface on
-
- Protocol - The ID of the protocol
-
- Interface - The location to return the protocol interface
-
- ImageHandle - The handle of the Image that is opening the protocol interface
- specified by Protocol and Interface.
-
- ControllerHandle - The controller handle that is requiring this interface.
-
- Attributes - The open mode of the protocol interface specified by Handle
- and Protocol.
-
-Returns:
-
- EFI_INVALID_PARAMETER - Protocol is NULL.
-
- EFI_SUCCESS - Get the protocol interface.
-
---*/
{
EFI_STATUS Status;
PROTOCOL_INTERFACE *Prot;
@@ -1298,6 +1173,32 @@ Done: }
+
+/**
+ Closes a protocol on a handle that was opened using OpenProtocol().
+
+ @param UserHandle The handle for the protocol interface that was
+ previously opened with OpenProtocol(), and is
+ now being closed.
+ @param Protocol The published unique identifier of the protocol.
+ It is the caller's responsibility to pass in a
+ valid GUID.
+ @param AgentHandle The handle of the agent that is closing the
+ protocol interface.
+ @param ControllerHandle If the agent that opened a protocol is a driver
+ that follows the EFI Driver Model, then this
+ parameter is the controller handle that required
+ the protocol interface. If the agent does not
+ follow the EFI Driver Model, then this parameter
+ is optional and may be NULL.
+
+ @retval EFI_SUCCESS The protocol instance was closed.
+ @retval EFI_INVALID_PARAMETER Handle, AgentHandle or ControllerHandle is not a
+ valid EFI_HANDLE.
+ @retval EFI_NOT_FOUND Can not find the specified protocol or
+ AgentHandle.
+
+**/
EFI_STATUS
EFIAPI
CoreCloseProtocol (
@@ -1306,31 +1207,6 @@ CoreCloseProtocol ( IN EFI_HANDLE AgentHandle,
IN EFI_HANDLE ControllerHandle
)
-/*++
-
-Routine Description:
-
- Closes a protocol on a handle that was opened using OpenProtocol().
-
-Arguments:
-
- UserHandle - The handle for the protocol interface that was previously opened
- with OpenProtocol(), and is now being closed.
- Protocol - The published unique identifier of the protocol. It is the caller's
- responsibility to pass in a valid GUID.
- AgentHandle - The handle of the agent that is closing the protocol interface.
- ControllerHandle - If the agent that opened a protocol is a driver that follows the
- EFI Driver Model, then this parameter is the controller handle
- that required the protocol interface. If the agent does not follow
- the EFI Driver Model, then this parameter is optional and may be NULL.
-
-Returns:
-
- EFI_SUCCESS - The protocol instance was closed.
- EFI_INVALID_PARAMETER - Handle, AgentHandle or ControllerHandle is not a valid EFI_HANDLE.
- EFI_NOT_FOUND - Can not find the specified protocol or AgentHandle.
-
---*/
{
EFI_STATUS Status;
PROTOCOL_INTERFACE *ProtocolInterface;
@@ -1397,6 +1273,18 @@ Done: +
+/**
+ Return information about Opened protocols in the system
+
+ @param UserHandle The handle to close the protocol interface on
+ @param Protocol The ID of the protocol
+ @param EntryBuffer A pointer to a buffer of open protocol
+ information in the form of
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
+ @param EntryCount Number of EntryBuffer entries
+
+**/
EFI_STATUS
EFIAPI
CoreOpenProtocolInformation (
@@ -1405,27 +1293,6 @@ CoreOpenProtocolInformation ( OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
OUT UINTN *EntryCount
)
-/*++
-
-Routine Description:
-
- Return information about Opened protocols in the system
-
-Arguments:
-
- UserHandle - The handle to close the protocol interface on
-
- Protocol - The ID of the protocol
-
- EntryBuffer - A pointer to a buffer of open protocol information in the form of
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
-
- EntryCount - Number of EntryBuffer entries
-
-Returns:
-
-
---*/
{
EFI_STATUS Status;
PROTOCOL_INTERFACE *ProtocolInterface;
@@ -1500,6 +1367,30 @@ Done: +
+/**
+ Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
+ from pool.
+
+ @param UserHandle The handle from which to retrieve the list of
+ protocol interface GUIDs.
+ @param ProtocolBuffer A pointer to the list of protocol interface GUID
+ pointers that are installed on Handle.
+ @param ProtocolBufferCount A pointer to the number of GUID pointers present
+ in ProtocolBuffer.
+
+ @retval EFI_SUCCESS The list of protocol interface GUIDs installed
+ on Handle was returned in ProtocolBuffer. The
+ number of protocol interface GUIDs was returned
+ in ProtocolBufferCount.
+ @retval EFI_INVALID_PARAMETER Handle is NULL.
+ @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.
+ @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the
+ results.
+
+**/
EFI_STATUS
EFIAPI
CoreProtocolsPerHandle (
@@ -1507,35 +1398,6 @@ CoreProtocolsPerHandle ( OUT EFI_GUID ***ProtocolBuffer,
OUT UINTN *ProtocolBufferCount
)
-/*++
-
-Routine Description:
-
- Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
- from pool.
-
-Arguments:
-
- UserHandle - The handle from which to retrieve the list of protocol interface
- GUIDs.
-
- ProtocolBuffer - A pointer to the list of protocol interface GUID pointers that are
- installed on Handle.
-
- ProtocolBufferCount - A pointer to the number of GUID pointers present in
- ProtocolBuffer.
-
-Returns:
- EFI_SUCCESS - The list of protocol interface GUIDs installed on Handle was returned in
- ProtocolBuffer. The number of protocol interface GUIDs was
- returned in ProtocolBufferCount.
- EFI_INVALID_PARAMETER - Handle is NULL.
- EFI_INVALID_PARAMETER - Handle is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - ProtocolBuffer is NULL.
- EFI_INVALID_PARAMETER - ProtocolBufferCount is NULL.
- EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the results.
-
---*/
{
EFI_STATUS Status;
IHANDLE *Handle;
@@ -1600,48 +1462,35 @@ Done: }
-UINT64
-CoreGetHandleDatabaseKey (
- VOID
- )
-/*++
-
-Routine Description:
+/**
return handle database key.
-Arguments:
- None
-
-Returns:
-
- Handle database key.
-
---*/
+ @return Handle database key.
+
+**/
+UINT64
+CoreGetHandleDatabaseKey (
+ VOID
+ )
{
return gHandleDatabaseKey;
}
-VOID
-CoreConnectHandlesByKey (
- UINT64 Key
- )
-/*++
-
-Routine Description:
+/**
Go connect any handles that were created or modified while a image executed.
-Arguments:
+ @param Key The Key to show that the handle has been
+ created/modified
- Key - The Key to show that the handle has been created/modified
-
-Returns:
-
- None
---*/
+**/
+VOID
+CoreConnectHandlesByKey (
+ UINT64 Key
+ )
{
UINTN Count;
LIST_ENTRY *Link;
diff --git a/MdeModulePkg/Core/Dxe/Hand/locate.c b/MdeModulePkg/Core/Dxe/Hand/locate.c index 959e988831..9c42383791 100644 --- a/MdeModulePkg/Core/Dxe/Hand/locate.c +++ b/MdeModulePkg/Core/Dxe/Hand/locate.c @@ -38,6 +38,18 @@ IHANDLE * OUT VOID **Interface
);
+/**
+ Routine to get the next Handle, when you are searching for all handles.
+
+ @param Position Information about which Handle to seach for.
+ @param Interface Return the interface structure for the matching
+ protocol.
+
+ @retval IHANDLE An IHANDLE is returned if the next Position is
+ not the end of the list. A NULL_HANDLE is
+ returned if it's the end of the list.
+
+**/
STATIC
IHANDLE *
CoreGetNextLocateAllHandles (
@@ -45,6 +57,19 @@ CoreGetNextLocateAllHandles ( OUT VOID **Interface
);
+/**
+ Routine to get the next Handle, when you are searching for register protocol
+ notifies.
+
+ @param Position Information about which Handle to seach for.
+ @param Interface Return the interface structure for the matching
+ protocol.
+
+ @retval IHANDLE An IHANDLE is returned if the next Position is
+ not the end of the list. A NULL_HANDLE is
+ returned if it's the end of the list.
+
+**/
STATIC
IHANDLE *
CoreGetNextLocateByRegisterNotify (
@@ -52,6 +77,18 @@ CoreGetNextLocateByRegisterNotify ( OUT VOID **Interface
);
+/**
+ Routine to get the next Handle, when you are searching for a given protocol.
+
+ @param Position Information about which Handle to seach for.
+ @param Interface Return the interface structure for the matching
+ protocol.
+
+ @retval IHANDLE An IHANDLE is returned if the next Position is
+ not the end of the list. A NULL_HANDLE is
+ returned if it's the end of the list.
+
+**/
STATIC
IHANDLE *
CoreGetNextLocateByProtocol (
@@ -59,13 +96,25 @@ CoreGetNextLocateByProtocol ( OUT VOID **Interface
);
-//
-//
-//
+/**
+ Locates the requested handle(s) and returns them in Buffer.
+
+ @param SearchType The type of search to perform to locate the
+ handles
+ @param Protocol The protocol to search for
+ @param SearchKey Dependant on SearchType
+ @param BufferSize On input the size of Buffer. On output the
+ size of data returned.
+ @param Buffer The buffer to return the results in
+ @retval EFI_BUFFER_TOO_SMALL Buffer too small, required buffer size is
+ returned in BufferSize.
+ @retval EFI_INVALID_PARAMETER Invalid parameter
+ @retval EFI_SUCCESS Successfully found the requested handle(s) and
+ returns them in Buffer.
-
+**/
EFI_STATUS
EFIAPI
CoreLocateHandle (
@@ -75,35 +124,6 @@ CoreLocateHandle ( IN OUT UINTN *BufferSize,
OUT EFI_HANDLE *Buffer
)
-/*++
-
-Routine Description:
-
- Locates the requested handle(s) and returns them in Buffer.
-
-Arguments:
-
- SearchType - The type of search to perform to locate the handles
-
- Protocol - The protocol to search for
-
- SearchKey - Dependant on SearchType
-
- BufferSize - On input the size of Buffer. On output the
- size of data returned.
-
- Buffer - The buffer to return the results in
-
-
-Returns:
-
- EFI_BUFFER_TOO_SMALL - Buffer too small, required buffer size is returned in BufferSize.
-
- EFI_INVALID_PARAMETER - Invalid parameter
-
- EFI_SUCCESS - Successfully found the requested handle(s) and returns them in Buffer.
-
---*/
{
EFI_STATUS Status;
LOCATE_POSITION Position;
@@ -243,29 +263,25 @@ Returns: }
+
+/**
+ Routine to get the next Handle, when you are searching for all handles.
+
+ @param Position Information about which Handle to seach for.
+ @param Interface Return the interface structure for the matching
+ protocol.
+
+ @retval IHANDLE An IHANDLE is returned if the next Position is
+ not the end of the list. A NULL_HANDLE is
+ returned if it's the end of the list.
+
+**/
STATIC
IHANDLE *
CoreGetNextLocateAllHandles (
IN OUT LOCATE_POSITION *Position,
OUT VOID **Interface
)
-/*++
-
-Routine Description:
-
- Routine to get the next Handle, when you are searching for all handles.
-
-Arguments:
-
- Position - Information about which Handle to seach for.
-
- Interface - Return the interface structure for the matching protocol.
-
-Returns:
- IHANDLE - An IHANDLE is returned if the next Position is not the end of the
- list. A NULL_HANDLE is returned if it's the end of the list.
-
---*/
{
IHANDLE *Handle;
@@ -287,30 +303,26 @@ Returns: }
+
+/**
+ Routine to get the next Handle, when you are searching for register protocol
+ notifies.
+
+ @param Position Information about which Handle to seach for.
+ @param Interface Return the interface structure for the matching
+ protocol.
+
+ @retval IHANDLE An IHANDLE is returned if the next Position is
+ not the end of the list. A NULL_HANDLE is
+ returned if it's the end of the list.
+
+**/
STATIC
IHANDLE *
CoreGetNextLocateByRegisterNotify (
IN OUT LOCATE_POSITION *Position,
OUT VOID **Interface
)
-/*++
-
-Routine Description:
-
- Routine to get the next Handle, when you are searching for register protocol
- notifies.
-
-Arguments:
-
- Position - Information about which Handle to seach for.
-
- Interface - Return the interface structure for the matching protocol.
-
-Returns:
- IHANDLE - An IHANDLE is returned if the next Position is not the end of the
- list. A NULL_HANDLE is returned if it's the end of the list.
-
---*/
{
IHANDLE *Handle;
PROTOCOL_NOTIFY *ProtNotify;
@@ -343,29 +355,25 @@ Returns: }
+
+/**
+ Routine to get the next Handle, when you are searching for a given protocol.
+
+ @param Position Information about which Handle to seach for.
+ @param Interface Return the interface structure for the matching
+ protocol.
+
+ @retval IHANDLE An IHANDLE is returned if the next Position is
+ not the end of the list. A NULL_HANDLE is
+ returned if it's the end of the list.
+
+**/
STATIC
IHANDLE *
CoreGetNextLocateByProtocol (
IN OUT LOCATE_POSITION *Position,
OUT VOID **Interface
)
-/*++
-
-Routine Description:
-
- Routine to get the next Handle, when you are searching for a given protocol.
-
-Arguments:
-
- Position - Information about which Handle to seach for.
-
- Interface - Return the interface structure for the matching protocol.
-
-Returns:
- IHANDLE - An IHANDLE is returned if the next Position is not the end of the
- list. A NULL_HANDLE is returned if it's the end of the list.
-
---*/
{
IHANDLE *Handle;
LIST_ENTRY *Link;
@@ -410,6 +418,22 @@ Returns: +
+/**
+ Locates the handle to a device on the device path that best matches the specified protocol.
+
+ @param Protocol The protocol to search for.
+ @param DevicePath On input, a pointer to a pointer to the device
+ path. On output, the device path pointer is
+ modified to point to the remaining part of the
+ devicepath.
+ @param Device A pointer to the returned device handle.
+
+ @retval EFI_SUCCESS The resulting handle was returned.
+ @retval EFI_NOT_FOUND No handles matched the search.
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
+
+**/
EFI_STATUS
EFIAPI
CoreLocateDevicePath (
@@ -417,26 +441,6 @@ CoreLocateDevicePath ( IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
OUT EFI_HANDLE *Device
)
-/*++
-
-Routine Description:
-
- Locates the handle to a device on the device path that best matches the specified protocol.
-
-Arguments:
-
- Protocol - The protocol to search for.
- DevicePath - On input, a pointer to a pointer to the device path. On output, the device
- path pointer is modified to point to the remaining part of the devicepath.
- Device - A pointer to the returned device handle.
-
-Returns:
-
- EFI_SUCCESS - The resulting handle was returned.
- EFI_NOT_FOUND - No handles matched the search.
- EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
-
---*/
{
INTN SourceSize;
INTN Size;
@@ -469,7 +473,7 @@ Returns: // The source path can only have 1 instance
//
if (CoreIsDevicePathMultiInstance (SourcePath)) {
- DEBUG((EFI_D_ERROR, "LocateDevicePath: Device path has too many instances\n"));
+ DEBUG((DEBUG_ERROR, "LocateDevicePath: Device path has too many instances\n"));
return EFI_INVALID_PARAMETER;
}
@@ -533,39 +537,30 @@ Returns: -EFI_STATUS
-EFIAPI
-CoreLocateProtocol (
- IN EFI_GUID *Protocol,
- IN VOID *Registration OPTIONAL,
- OUT VOID **Interface
- )
-/*++
-
-Routine Description:
+/**
Return the first Protocol Interface that matches the Protocol GUID. If
Registration is pasased in return a Protocol Instance that was just add
to the system. If Retistration is NULL return the first Protocol Interface
you find.
-Arguments:
-
- Protocol - The protocol to search for
-
- Registration - Optional Registration Key returned from RegisterProtocolNotify()
-
- Interface - Return the Protocol interface (instance).
-
-Returns:
+ @param Protocol The protocol to search for
+ @param Registration Optional Registration Key returned from
+ RegisterProtocolNotify()
+ @param Interface Return the Protocol interface (instance).
- EFI_SUCCESS - If a valid Interface is returned
-
- EFI_INVALID_PARAMETER - Invalid parameter
-
- EFI_NOT_FOUND - Protocol interface not found
+ @retval EFI_SUCCESS If a valid Interface is returned
+ @retval EFI_INVALID_PARAMETER Invalid parameter
+ @retval EFI_NOT_FOUND Protocol interface not found
---*/
+**/
+EFI_STATUS
+EFIAPI
+CoreLocateProtocol (
+ IN EFI_GUID *Protocol,
+ IN VOID *Registration OPTIONAL,
+ OUT VOID **Interface
+ )
{
EFI_STATUS Status;
LOCATE_POSITION Position;
@@ -631,6 +626,29 @@ Done: +
+/**
+ Function returns an array of handles that support the requested protocol
+ in a buffer allocated from pool. This is a version of CoreLocateHandle()
+ that allocates a buffer for the caller.
+
+ @param SearchType Specifies which handle(s) are to be returned.
+ @param Protocol Provides the protocol to search by. This
+ parameter is only valid for SearchType
+ ByProtocol.
+ @param SearchKey Supplies the search key depending on the
+ SearchType.
+ @param NumberHandles The number of handles returned in Buffer.
+ @param Buffer A pointer to the buffer to return the requested
+ array of handles that support Protocol.
+
+ @retval EFI_SUCCESS The result array of handles was returned.
+ @retval EFI_NOT_FOUND No handles match the search.
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the
+ matching results.
+ @retval EFI_INVALID_PARAMETER Invalid parameter
+
+**/
EFI_STATUS
EFIAPI
CoreLocateHandleBuffer (
@@ -640,32 +658,6 @@ CoreLocateHandleBuffer ( IN OUT UINTN *NumberHandles,
OUT EFI_HANDLE **Buffer
)
-/*++
-
-Routine Description:
-
- Function returns an array of handles that support the requested protocol
- in a buffer allocated from pool. This is a version of CoreLocateHandle()
- that allocates a buffer for the caller.
-
-Arguments:
-
- SearchType - Specifies which handle(s) are to be returned.
- Protocol - Provides the protocol to search by.
- This parameter is only valid for SearchType ByProtocol.
- SearchKey - Supplies the search key depending on the SearchType.
- NumberHandles - The number of handles returned in Buffer.
- Buffer - A pointer to the buffer to return the requested array of
- handles that support Protocol.
-
-Returns:
-
- EFI_SUCCESS - The result array of handles was returned.
- EFI_NOT_FOUND - No handles match the search.
- EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the matching results.
- EFI_INVALID_PARAMETER - Invalid parameter
-
---*/
{
EFI_STATUS Status;
UINTN BufferSize;
@@ -723,3 +715,4 @@ Returns: }
+
|