\r
**/\r
\r
-#include <DxeMain.h>\r
+#include "DxeMain.h"\r
+#include "Handle.h"\r
\r
\r
//\r
// gProtocolDatabaseLock - Lock to protect the mProtocolDatabase\r
// gHandleDatabaseKey - The Key to show that the handle has been created/modified\r
//\r
-STATIC LIST_ENTRY mProtocolDatabase = INITIALIZE_LIST_HEAD_VARIABLE (mProtocolDatabase);\r
+LIST_ENTRY mProtocolDatabase = INITIALIZE_LIST_HEAD_VARIABLE (mProtocolDatabase);\r
LIST_ENTRY gHandleList = INITIALIZE_LIST_HEAD_VARIABLE (gHandleList);\r
EFI_LOCK gProtocolDatabaseLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY);\r
UINT64 gHandleDatabaseKey = 0;\r
/**\r
Check whether a handle is a valid EFI_HANDLE\r
\r
- @param UserHandle The handle to check \r
+ @param UserHandle The handle to check\r
\r
- @retval EFI_INVALID_PARAMETER The handle is NULL or not a valid EFI_HANDLE. \r
+ @retval EFI_INVALID_PARAMETER The handle is NULL or not a valid EFI_HANDLE.\r
@retval EFI_SUCCESS The handle is valid EFI_HANDLE.\r
\r
**/\r
Finds the protocol entry for the requested protocol.\r
The gProtocolDatabaseLock must be owned\r
\r
- @param Protocol The ID of the protocol \r
- @param Create Create a new entry if not found \r
+ @param Protocol The ID of the protocol\r
+ @param Create Create a new entry if not found\r
\r
@return Protocol entry\r
\r
//\r
\r
ProtEntry = NULL;\r
- for (Link = mProtocolDatabase.ForwardLink; \r
- Link != &mProtocolDatabase; \r
+ for (Link = mProtocolDatabase.ForwardLink;\r
+ Link != &mProtocolDatabase;\r
Link = Link->ForwardLink) {\r
\r
Item = CR(Link, PROTOCOL_ENTRY, AllEntries, PROTOCOL_ENTRY_SIGNATURE);\r
}\r
\r
//\r
- // If the protocol entry was not found and Create is TRUE, then \r
+ // If the protocol entry was not found and Create is TRUE, then\r
// allocate a new entry\r
- // \r
+ //\r
if ((ProtEntry == NULL) && Create) {\r
- ProtEntry = CoreAllocateBootServicesPool (sizeof(PROTOCOL_ENTRY));\r
- \r
+ ProtEntry = AllocatePool (sizeof(PROTOCOL_ENTRY));\r
+\r
if (ProtEntry != NULL) {\r
//\r
// Initialize new protocol entry structure\r
//\r
ProtEntry->Signature = PROTOCOL_ENTRY_SIGNATURE;\r
- CopyMem ((VOID *)&ProtEntry->ProtocolID, Protocol, sizeof (EFI_GUID));\r
+ CopyGuid ((VOID *)&ProtEntry->ProtocolID, Protocol);\r
InitializeListHead (&ProtEntry->Protocols);\r
InitializeListHead (&ProtEntry->Notify);\r
\r
Note: This function doesn't do parameters checking, it's caller's responsibility\r
to pass in valid parameters.\r
\r
- @param Handle The handle to search the protocol on \r
- @param Protocol GUID of the protocol \r
- @param Interface The interface for the protocol being searched \r
+ @param Handle The handle to search the protocol on\r
+ @param Protocol GUID of the protocol\r
+ @param Interface The interface for the protocol being searched\r
\r
@return Protocol instance (NULL: Not found)\r
\r
/**\r
Removes an event from a register protocol notify list on a protocol.\r
\r
- @param Event The event to search for in the protocol \r
- database. \r
+ @param Event The event to search for in the protocol\r
+ database.\r
\r
@return EFI_SUCCESS if the event was found and removed.\r
@return EFI_NOT_FOUND if the event was not found in the protocl database.\r
\r
CoreAcquireProtocolLock ();\r
\r
- for ( Link = mProtocolDatabase.ForwardLink; \r
- Link != &mProtocolDatabase; \r
+ for ( Link = mProtocolDatabase.ForwardLink;\r
+ Link != &mProtocolDatabase;\r
Link = Link->ForwardLink) {\r
\r
ProtEntry = CR(Link, PROTOCOL_ENTRY, AllEntries, PROTOCOL_ENTRY_SIGNATURE);\r
\r
- for ( NotifyLink = ProtEntry->Notify.ForwardLink; \r
- NotifyLink != &ProtEntry->Notify; \r
+ for ( NotifyLink = ProtEntry->Notify.ForwardLink;\r
+ NotifyLink != &ProtEntry->Notify;\r
NotifyLink = NotifyLink->ForwardLink) {\r
\r
ProtNotify = CR(NotifyLink, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE);\r
/**\r
Removes all the events in the protocol database that match Event.\r
\r
- @param Event The event to search for in the protocol \r
- database. \r
+ @param Event The event to search for in the protocol\r
+ database.\r
\r
@return EFI_SUCCESS when done searching the entire database.\r
\r
Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which\r
Calls the private one which contains a BOOLEAN parameter for notifications\r
\r
- @param UserHandle The handle to install the protocol handler on, \r
- or NULL if a new handle is to be allocated \r
- @param Protocol The protocol to add to the handle \r
- @param InterfaceType Indicates whether Interface is supplied in \r
- native form. \r
- @param Interface The interface for the protocol being added \r
+ @param UserHandle The handle to install the protocol handler on,\r
+ or NULL if a new handle is to be allocated\r
+ @param Protocol The protocol to add to the handle\r
+ @param InterfaceType Indicates whether Interface is supplied in\r
+ native form.\r
+ @param Interface The interface for the protocol being added\r
\r
@return Status code\r
\r
)\r
{\r
return CoreInstallProtocolInterfaceNotify (\r
- UserHandle, \r
- Protocol, \r
- InterfaceType, \r
- Interface, \r
+ UserHandle,\r
+ Protocol,\r
+ InterfaceType,\r
+ Interface,\r
TRUE\r
);\r
}\r
/**\r
Installs a protocol interface into the boot services environment.\r
\r
- @param UserHandle The handle to install the protocol handler on, \r
- or NULL if a new handle is to be allocated \r
- @param Protocol The protocol to add to the handle \r
- @param InterfaceType Indicates whether Interface is supplied in \r
- native form. \r
- @param Interface The interface for the protocol being added \r
- @param Notify indicates whether notify the notification list \r
- for this protocol \r
-\r
- @retval EFI_INVALID_PARAMETER Invalid parameter \r
- @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate \r
+ @param UserHandle The handle to install the protocol handler on,\r
+ or NULL if a new handle is to be allocated\r
+ @param Protocol The protocol to add to the handle\r
+ @param InterfaceType Indicates whether Interface is supplied in\r
+ native form.\r
+ @param Interface The interface for the protocol being added\r
+ @param Notify indicates whether notify the notification list\r
+ for this protocol\r
+\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
@retval EFI_SUCCESS Protocol interface successfully installed\r
\r
**/\r
//\r
// Print debug message\r
//\r
- DEBUG((DEBUG_ERROR | DEBUG_INFO, "InstallProtocolInterface: %g %p\n", Protocol, Interface));\r
+ DEBUG((DEBUG_LOAD | DEBUG_INFO, "InstallProtocolInterface: %g %p\n", Protocol, Interface));\r
\r
Status = EFI_OUT_OF_RESOURCES;\r
Prot = NULL;\r
Handle = NULL;\r
\r
- ASSERT (NULL != gDxeCoreBS);\r
-\r
- if (*UserHandle != NULL_HANDLE) {\r
+ if (*UserHandle != NULL) {\r
Status = CoreHandleProtocol (*UserHandle, Protocol, (VOID **)&ExistingInterface);\r
if (!EFI_ERROR (Status)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
//\r
- // Lock the protocol database \r
+ // Lock the protocol database\r
//\r
CoreAcquireProtocolLock ();\r
\r
//\r
// Allocate a new protocol interface structure\r
//\r
- Prot = CoreAllocateZeroBootServicesPool (sizeof(PROTOCOL_INTERFACE));\r
+ Prot = AllocateZeroPool (sizeof(PROTOCOL_INTERFACE));\r
if (Prot == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
//\r
Handle = (IHANDLE *)*UserHandle;\r
if (Handle == NULL) {\r
- Handle = CoreAllocateZeroBootServicesPool (sizeof(IHANDLE));\r
+ Handle = AllocateZeroPool (sizeof(IHANDLE));\r
if (Handle == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
// in the system\r
//\r
InsertTailList (&gHandleList, &Handle->AllHandles);\r
- } \r
+ }\r
\r
Status = CoreValidateHandle (Handle);\r
if (EFI_ERROR (Status)) {\r
Prot->OpenListCount = 0;\r
\r
//\r
- // Add this protocol interface to the head of the supported \r
+ // Add this protocol interface to the head of the supported\r
// protocol list for this handle\r
//\r
InsertHeadList (&Handle->Protocols, &Prot->Link);\r
\r
//\r
- // Add this protocol interface to the tail of the \r
+ // Add this protocol interface to the tail of the\r
// protocol entry\r
- // \r
+ //\r
InsertTailList (&ProtEntry->Protocols, &Prot->ByProtocol);\r
\r
//\r
- // Notify the notification list for this protocol \r
+ // Notify the notification list for this protocol\r
//\r
if (Notify) {\r
CoreNotifyProtocolEntry (ProtEntry);\r
occures all the protocols added by this function are removed. This is\r
basically a lib function to save space.\r
\r
- @param Handle The handle to install the protocol handlers on, \r
- or NULL if a new handle is to be allocated \r
- @param ... EFI_GUID followed by protocol instance. A NULL \r
- terminates the list. The pairs are the \r
- arguments to InstallProtocolInterface(). All the \r
- protocols are added to Handle. \r
+ @param Handle The handle to install the protocol handlers on,\r
+ or NULL if a new handle is to be allocated\r
+ @param ... EFI_GUID followed by protocol instance. A NULL\r
+ terminates the list. The pairs are the\r
+ arguments to InstallProtocolInterface(). All the\r
+ protocols are added to Handle.\r
\r
- @retval EFI_INVALID_PARAMETER Handle is NULL. \r
+ @retval EFI_INVALID_PARAMETER Handle is NULL.\r
@retval EFI_SUCCESS Protocol interfaces successfully installed.\r
\r
**/\r
EFI_HANDLE OldHandle;\r
EFI_HANDLE DeviceHandle;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
- \r
+\r
if (Handle == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
+ //\r
+ // Syncronize with notifcations.\r
//\r
- // Syncronize with notifcations. \r
- // \r
OldTpl = CoreRaiseTpl (TPL_NOTIFY);\r
OldHandle = *Handle;\r
\r
DeviceHandle = NULL;\r
DevicePath = Interface;\r
Status = CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, &DeviceHandle);\r
- if (!EFI_ERROR (Status) && (DeviceHandle != NULL_HANDLE) && IsDevicePathEnd(DevicePath)) {\r
+ if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(DevicePath)) {\r
Status = EFI_ALREADY_STARTED;\r
continue;\r
}\r
}\r
- \r
+\r
//\r
// Install it\r
//\r
Status = CoreInstallProtocolInterface (Handle, Protocol, EFI_NATIVE_INTERFACE, Interface);\r
}\r
- \r
+ VA_END (Args);\r
+\r
//\r
// If there was an error, remove all the interfaces that were installed without any errors\r
//\r
Protocol = VA_ARG (Args, EFI_GUID *);\r
Interface = VA_ARG (Args, VOID *);\r
CoreUninstallProtocolInterface (*Handle, Protocol, Interface);\r
- } \r
+ }\r
+ VA_END (Args);\r
+ \r
*Handle = OldHandle;\r
}\r
\r
Note: This function doesn't do parameters checking, it's caller's responsibility\r
to pass in valid parameters.\r
\r
- @param UserHandle The handle on which the protocol is installed \r
- @param Prot The protocol to disconnect drivers from \r
+ @param UserHandle The handle on which the protocol is installed\r
+ @param Prot The protocol to disconnect drivers from\r
\r
- @retval EFI_SUCCESS Drivers using the protocol interface are all \r
- disconnected \r
+ @retval EFI_SUCCESS Drivers using the protocol interface are all\r
+ disconnected\r
@retval EFI_ACCESS_DENIED Failed to disconnect one or all of the drivers\r
\r
**/\r
OPEN_PROTOCOL_DATA *OpenData;\r
\r
Status = EFI_SUCCESS;\r
- \r
+\r
//\r
// Attempt to disconnect all drivers from this protocol interface\r
//\r
(Link != &Prot->OpenList) && !ItemFound;\r
Link = Link->ForwardLink ) {\r
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);\r
- if (OpenData->Attributes & \r
+ if (OpenData->Attributes &\r
(EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL | EFI_OPEN_PROTOCOL_GET_PROTOCOL | EFI_OPEN_PROTOCOL_TEST_PROTOCOL)) {\r
ItemFound = TRUE;\r
- RemoveEntryList (&OpenData->Link); \r
+ RemoveEntryList (&OpenData->Link);\r
Prot->OpenListCount--;\r
CoreFreePool (OpenData);\r
}\r
If the last protocol interface is remove from the handle, the\r
handle is freed.\r
\r
- @param UserHandle The handle to remove the protocol handler from \r
- @param Protocol The protocol, of protocol:interface, to remove \r
- @param Interface The interface, of protocol:interface, to remove \r
+ @param UserHandle The handle to remove the protocol handler from\r
+ @param Protocol The protocol, of protocol:interface, to remove\r
+ @param Interface The interface, of protocol:interface, to remove\r
\r
- @retval EFI_INVALID_PARAMETER Protocol is NULL. \r
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
@retval EFI_SUCCESS Protocol interface successfully uninstalled.\r
\r
**/\r
//\r
gHandleDatabaseKey++;\r
Handle->Key = gHandleDatabaseKey;\r
- \r
+\r
//\r
// Remove the protocol interface from the handle\r
//\r
CoreFreePool (Handle);\r
}\r
\r
-Done: \r
+Done:\r
//\r
// Done, unlock the database and return\r
//\r
This function calls UnisatllProtocolInterface() in a loop. This is\r
basically a lib function to save space.\r
\r
- @param Handle The handle to uninstall the protocol \r
- @param ... EFI_GUID followed by protocol instance. A NULL \r
- terminates the list. The pairs are the \r
- arguments to UninstallProtocolInterface(). All \r
- the protocols are added to Handle. \r
+ @param Handle The handle to uninstall the protocol\r
+ @param ... EFI_GUID followed by protocol instance. A NULL\r
+ terminates the list. The pairs are the\r
+ arguments to UninstallProtocolInterface(). All\r
+ the protocols are added to Handle.\r
\r
@return Status code\r
\r
//\r
Status = CoreUninstallProtocolInterface (Handle, Protocol, Interface);\r
}\r
+ VA_END (Args);\r
\r
//\r
// If there was an error, add all the interfaces that were\r
Protocol = VA_ARG(Args, EFI_GUID *);\r
Interface = VA_ARG(Args, VOID *);\r
CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFACE, Interface);\r
- } \r
+ }\r
+ VA_END (Args);\r
}\r
\r
return Status;\r
-} \r
+}\r
\r
\r
/**\r
Locate a certain GUID protocol interface in a Handle's protocols.\r
\r
- @param UserHandle The handle to obtain the protocol interface on \r
- @param Protocol The GUID of the protocol \r
+ @param UserHandle The handle to obtain the protocol interface on\r
+ @param Protocol The GUID of the protocol\r
\r
@return The requested protocol interface for the handle\r
\r
if (EFI_ERROR (Status)) {\r
return NULL;\r
}\r
- \r
+\r
Handle = (IHANDLE *)UserHandle;\r
\r
//\r
/**\r
Queries a handle to determine if it supports a specified protocol.\r
\r
- @param UserHandle The handle being queried. \r
- @param Protocol The published unique identifier of the protocol. \r
- @param Interface Supplies the address where a pointer to the \r
- corresponding Protocol Interface is returned. \r
+ @param UserHandle The handle being queried.\r
+ @param Protocol The published unique identifier of the protocol.\r
+ @param Interface Supplies the address where a pointer to the\r
+ corresponding Protocol Interface is returned.\r
\r
- @return The requested protocol interface for the handle\r
+ @retval EFI_SUCCESS The interface information for the specified protocol was returned.\r
+ @retval EFI_UNSUPPORTED The device does not support the specified protocol.\r
+ @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE..\r
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
+ @retval EFI_INVALID_PARAMETER Interface is NULL.\r
\r
**/\r
EFI_STATUS\r
)\r
{\r
return CoreOpenProtocol (\r
- UserHandle, \r
- Protocol, \r
- Interface, \r
- gDxeCoreImageHandle, \r
- NULL, \r
+ UserHandle,\r
+ Protocol,\r
+ Interface,\r
+ gDxeCoreImageHandle,\r
+ NULL,\r
EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL\r
);\r
}\r
invokes it to obtain the protocol interface. Usage information\r
is registered in the protocol data base.\r
\r
- @param UserHandle The handle to obtain the protocol interface on \r
- @param Protocol The ID of the protocol \r
- @param Interface The location to return the protocol interface \r
- @param ImageHandle The handle of the Image that is opening the \r
- protocol interface specified by Protocol and \r
- Interface. \r
- @param ControllerHandle The controller handle that is requiring this \r
- interface. \r
- @param Attributes The open mode of the protocol interface \r
- specified by Handle and Protocol. \r
-\r
- @retval EFI_INVALID_PARAMETER Protocol is NULL. \r
+ @param UserHandle The handle to obtain the protocol interface on\r
+ @param Protocol The ID of the protocol\r
+ @param Interface The location to return the protocol interface\r
+ @param ImageHandle The handle of the Image that is opening the\r
+ protocol interface specified by Protocol and\r
+ Interface.\r
+ @param ControllerHandle The controller handle that is requiring this\r
+ interface.\r
+ @param Attributes The open mode of the protocol interface\r
+ specified by Handle and Protocol.\r
+\r
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
@retval EFI_SUCCESS Get the protocol interface.\r
\r
**/\r
*Interface = NULL;\r
}\r
}\r
- \r
+\r
//\r
// Check for invalid UserHandle\r
//\r
\r
//\r
// This is the protocol interface entry for this protocol\r
- // \r
+ //\r
if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {\r
*Interface = Prot->Interface;\r
}\r
Exclusive = FALSE;\r
for ( Link = Prot->OpenList.ForwardLink; Link != &Prot->OpenList; Link = Link->ForwardLink) {\r
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);\r
- ExactMatch = (BOOLEAN)((OpenData->AgentHandle == ImageHandle) && \r
+ ExactMatch = (BOOLEAN)((OpenData->AgentHandle == ImageHandle) &&\r
(OpenData->Attributes == Attributes) &&\r
(OpenData->ControllerHandle == ControllerHandle));\r
if (OpenData->Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) {\r
}\r
}\r
} while (Disconnect);\r
- } \r
+ }\r
break;\r
case EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER :\r
case EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL :\r
//\r
// Create new entry\r
//\r
- OpenData = CoreAllocateBootServicesPool (sizeof(OPEN_PROTOCOL_DATA));\r
+ OpenData = AllocatePool (sizeof(OPEN_PROTOCOL_DATA));\r
if (OpenData == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
} else {\r
/**\r
Closes a protocol on a handle that was opened using OpenProtocol().\r
\r
- @param UserHandle The handle for the protocol interface that was \r
- previously opened with OpenProtocol(), and is \r
- now being closed. \r
- @param Protocol The published unique identifier of the protocol. \r
- It is the caller's responsibility to pass in a \r
- valid GUID. \r
- @param AgentHandle The handle of the agent that is closing the \r
- protocol interface. \r
- @param ControllerHandle If the agent that opened a protocol is a driver \r
- that follows the EFI Driver Model, then this \r
- parameter is the controller handle that required \r
- the protocol interface. If the agent does not \r
- follow the EFI Driver Model, then this parameter \r
- is optional and may be NULL. \r
-\r
- @retval EFI_SUCCESS The protocol instance was closed. \r
- @retval EFI_INVALID_PARAMETER Handle, AgentHandle or ControllerHandle is not a \r
- valid EFI_HANDLE. \r
- @retval EFI_NOT_FOUND Can not find the specified protocol or \r
+ @param UserHandle The handle for the protocol interface that was\r
+ previously opened with OpenProtocol(), and is\r
+ now being closed.\r
+ @param Protocol The published unique identifier of the protocol.\r
+ It is the caller's responsibility to pass in a\r
+ valid GUID.\r
+ @param AgentHandle The handle of the agent that is closing the\r
+ protocol interface.\r
+ @param ControllerHandle If the agent that opened a protocol is a driver\r
+ that follows the EFI Driver Model, then this\r
+ parameter is the controller handle that required\r
+ the protocol interface. If the agent does not\r
+ follow the EFI Driver Model, then this parameter\r
+ is optional and may be NULL.\r
+\r
+ @retval EFI_SUCCESS The protocol instance was closed.\r
+ @retval EFI_INVALID_PARAMETER Handle, AgentHandle or ControllerHandle is not a\r
+ valid EFI_HANDLE.\r
+ @retval EFI_NOT_FOUND Can not find the specified protocol or\r
AgentHandle.\r
\r
**/\r
IN EFI_HANDLE UserHandle,\r
IN EFI_GUID *Protocol,\r
IN EFI_HANDLE AgentHandle,\r
- IN EFI_HANDLE ControllerHandle \r
+ IN EFI_HANDLE ControllerHandle\r
)\r
{\r
EFI_STATUS Status;\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- if (ControllerHandle != NULL_HANDLE) {\r
+ if (ControllerHandle != NULL) {\r
Status = CoreValidateHandle (ControllerHandle);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);\r
Link = Link->ForwardLink;\r
if ((OpenData->AgentHandle == AgentHandle) && (OpenData->ControllerHandle == ControllerHandle)) {\r
- RemoveEntryList (&OpenData->Link); \r
+ RemoveEntryList (&OpenData->Link);\r
ProtocolInterface->OpenListCount--;\r
CoreFreePool (OpenData);\r
Status = EFI_SUCCESS;\r
/**\r
Return information about Opened protocols in the system\r
\r
- @param UserHandle The handle to close the protocol interface on \r
- @param Protocol The ID of the protocol \r
- @param EntryBuffer A pointer to a buffer of open protocol \r
- information in the form of \r
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures. \r
+ @param UserHandle The handle to close the protocol interface on\r
+ @param Protocol The ID of the protocol\r
+ @param EntryBuffer A pointer to a buffer of open protocol information in the\r
+ form of EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r
@param EntryCount Number of EntryBuffer entries\r
\r
+ @retval EFI_SUCCESS The open protocol information was returned in EntryBuffer, \r
+ and the number of entries was returned EntryCount.\r
+ @retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer.\r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
//\r
// Count the number of Open Entries\r
//\r
- for ( Link = ProtocolInterface->OpenList.ForwardLink, Count = 0; \r
+ for ( Link = ProtocolInterface->OpenList.ForwardLink, Count = 0;\r
(Link != &ProtocolInterface->OpenList) ;\r
Link = Link->ForwardLink ) {\r
Count++;\r
- } \r
+ }\r
\r
ASSERT (Count == ProtocolInterface->OpenListCount);\r
\r
Size = Count * sizeof(EFI_OPEN_PROTOCOL_INFORMATION_ENTRY);\r
}\r
\r
- Buffer = CoreAllocateBootServicesPool (Size);\r
+ Buffer = AllocatePool (Size);\r
if (Buffer == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
}\r
\r
Status = EFI_SUCCESS;\r
- for ( Link = ProtocolInterface->OpenList.ForwardLink, Count = 0; \r
+ for ( Link = ProtocolInterface->OpenList.ForwardLink, Count = 0;\r
(Link != &ProtocolInterface->OpenList);\r
Link = Link->ForwardLink, Count++ ) {\r
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);\r
Buffer[Count].ControllerHandle = OpenData->ControllerHandle;\r
Buffer[Count].Attributes = OpenData->Attributes;\r
Buffer[Count].OpenCount = OpenData->OpenCount;\r
- } \r
+ }\r
\r
*EntryBuffer = Buffer;\r
*EntryCount = Count;\r
- \r
+\r
Done:\r
//\r
- // Done. Release the database lock are return\r
+ // Done. Release the database lock.\r
//\r
CoreReleaseProtocolLock ();\r
return Status;\r
Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
from pool.\r
\r
- @param UserHandle The handle from which to retrieve the list of \r
- protocol interface GUIDs. \r
- @param ProtocolBuffer A pointer to the list of protocol interface GUID \r
- pointers that are installed on Handle. \r
- @param ProtocolBufferCount A pointer to the number of GUID pointers present \r
- in ProtocolBuffer. \r
-\r
- @retval EFI_SUCCESS The list of protocol interface GUIDs installed \r
- on Handle was returned in ProtocolBuffer. The \r
- number of protocol interface GUIDs was returned \r
- in ProtocolBufferCount. \r
- @retval EFI_INVALID_PARAMETER Handle is NULL. \r
- @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE. \r
- @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL. \r
- @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL. \r
- @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the \r
+ @param UserHandle The handle from which to retrieve the list of\r
+ protocol interface GUIDs.\r
+ @param ProtocolBuffer A pointer to the list of protocol interface GUID\r
+ pointers that are installed on Handle.\r
+ @param ProtocolBufferCount A pointer to the number of GUID pointers present\r
+ in ProtocolBuffer.\r
+\r
+ @retval EFI_SUCCESS The list of protocol interface GUIDs installed\r
+ on Handle was returned in ProtocolBuffer. The\r
+ number of protocol interface GUIDs was returned\r
+ in ProtocolBufferCount.\r
+ @retval EFI_INVALID_PARAMETER Handle is NULL.\r
+ @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.\r
+ @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.\r
+ @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the\r
results.\r
\r
**/\r
ProtocolCount = 0;\r
\r
CoreAcquireProtocolLock ();\r
- \r
+\r
for (Link = Handle->Protocols.ForwardLink; Link != &Handle->Protocols; Link = Link->ForwardLink) {\r
ProtocolCount++;\r
}\r
goto Done;\r
}\r
\r
- Buffer = CoreAllocateBootServicesPool (sizeof (EFI_GUID *) * ProtocolCount);\r
+ Buffer = AllocatePool (sizeof (EFI_GUID *) * ProtocolCount);\r
if (Buffer == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
*ProtocolBufferCount = ProtocolCount;\r
\r
for ( Link = Handle->Protocols.ForwardLink, ProtocolCount = 0;\r
- Link != &Handle->Protocols; \r
+ Link != &Handle->Protocols;\r
Link = Link->ForwardLink, ProtocolCount++) {\r
Prot = CR(Link, PROTOCOL_INTERFACE, Link, PROTOCOL_INTERFACE_SIGNATURE);\r
Buffer[ProtocolCount] = &(Prot->Protocol->ProtocolID);\r
/**\r
Go connect any handles that were created or modified while a image executed.\r
\r
- @param Key The Key to show that the handle has been \r
+ @param Key The Key to show that the handle has been\r
created/modified\r
\r
**/\r
}\r
}\r
\r
- HandleBuffer = CoreAllocateBootServicesPool (Count * sizeof (EFI_HANDLE));\r
+ HandleBuffer = AllocatePool (Count * sizeof (EFI_HANDLE));\r
if (HandleBuffer == NULL) {\r
CoreReleaseProtocolLock ();\r
return;\r
}\r
- \r
+\r
for (Link = gHandleList.ForwardLink, Count = 0; Link != &gHandleList; Link = Link->ForwardLink) {\r
Handle = CR (Link, IHANDLE, AllHandles, EFI_HANDLE_SIGNATURE);\r
if (Handle->Key > Key) {\r
for (Index = 0; Index < Count; Index++) {\r
CoreConnectController (HandleBuffer[Index], NULL, NULL, TRUE);\r
}\r
- \r
+\r
CoreFreePool(HandleBuffer);\r
}\r