diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-08 07:08:54 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-08 07:08:54 +0000 |
commit | d850121ecda615d7f5817c6cc429336ac2168360 (patch) | |
tree | 80c333d8294101d810d16eacd6bfa5947ddb3b73 /EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib | |
parent | 03284334ae825d6a7610e5fb3b907f1900a3883e (diff) | |
download | edk2-platforms-d850121ecda615d7f5817c6cc429336ac2168360.tar.xz |
Some adjustment in ECP to make it compatible with EDK1.01(EDK1117) foundation in UEFI2.0+Framework0.9x build mode for silicon modules
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5418 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib')
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c | 5 | ||||
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c | 177 |
2 files changed, 171 insertions, 11 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c index f1af8cc74d..9add9e7a56 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c +++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c @@ -138,6 +138,11 @@ NextSupportedLanguage ( #ifdef LANGUAGE_RFC_3066 // LANGUAGE_RFC_3066
for (; (*Languages != 0) && (*Languages != ';'); Languages++)
;
+
+ if (*Languages == ';') {
+ Languages++;
+ }
+
return Languages;
#else // LANGUAGE_ISO_639_2
return (Languages + 3);
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c index 5c2b47b66e..eef61548b3 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c +++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2004 - 2007, Intel Corporation
+Copyright (c) 2004 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -73,18 +73,17 @@ Returns: }
EFI_STATUS
-EfiLibInstallAllDriverProtocols (
+InstallAllDriverProtocolsWorker (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE * SystemTable,
IN EFI_DRIVER_BINDING_PROTOCOL * DriverBinding,
IN EFI_HANDLE DriverBindingHandle,
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- IN EFI_COMPONENT_NAME2_PROTOCOL * ComponentName, OPTIONAL
-#else
IN EFI_COMPONENT_NAME_PROTOCOL * ComponentName, OPTIONAL
-#endif
+ IN EFI_COMPONENT_NAME2_PROTOCOL * ComponentName2, OPTIONAL
IN EFI_DRIVER_CONFIGURATION_PROTOCOL * DriverConfiguration, OPTIONAL
- IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL * DriverDiagnostics OPTIONAL
+ IN EFI_DRIVER_CONFIGURATION2_PROTOCOL * DriverConfiguration2, OPTIONAL
+ IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL * DriverDiagnostics, OPTIONAL
+ IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL * DriverDiagnostics2 OPTIONAL
)
/*++
@@ -109,10 +108,16 @@ Arguments: ComponentName - A Component Name Protocol instance that this driver is producing
+ ComponentName2 - A Component Name2 Protocol instance that this driver is producing
+
DriverConfiguration - A Driver Configuration Protocol instance that this driver is producing
+
+ DriverConfiguration2- A Driver Configuration2 Protocol instance that this driver is producing
DriverDiagnostics - A Driver Diagnostics Protocol instance that this driver is producing
+ DriverDiagnostics2 - A Driver Diagnostics2 Protocol instance that this driver is producing
+
Returns:
EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
@@ -131,11 +136,7 @@ Returns: if (ComponentName != NULL) {
Status = gBS->InstallProtocolInterface (
&DriverBinding->DriverBindingHandle,
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- &gEfiComponentName2ProtocolGuid,
-#else
&gEfiComponentNameProtocolGuid,
-#endif
EFI_NATIVE_INTERFACE,
ComponentName
);
@@ -144,6 +145,18 @@ Returns: }
}
+ if (ComponentName2 != NULL) {
+ Status = gBS->InstallProtocolInterface (
+ &DriverBinding->DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ ComponentName2
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ }
+
if (DriverConfiguration != NULL) {
Status = gBS->InstallProtocolInterface (
&DriverBinding->DriverBindingHandle,
@@ -156,6 +169,18 @@ Returns: }
}
+ if (DriverConfiguration2 != NULL) {
+ Status = gBS->InstallProtocolInterface (
+ &DriverBinding->DriverBindingHandle,
+ &gEfiDriverConfiguration2ProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ DriverConfiguration2
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ }
+
if (DriverDiagnostics != NULL) {
Status = gBS->InstallProtocolInterface (
&DriverBinding->DriverBindingHandle,
@@ -168,10 +193,140 @@ Returns: }
}
+ if (DriverDiagnostics2 != NULL) {
+ Status = gBS->InstallProtocolInterface (
+ &DriverBinding->DriverBindingHandle,
+ &gEfiDriverDiagnostics2ProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ DriverDiagnostics2
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ }
+
return EFI_SUCCESS;
}
EFI_STATUS
+EfiLibInstallAllDriverProtocols (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE * SystemTable,
+ IN EFI_DRIVER_BINDING_PROTOCOL * DriverBinding,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN EFI_COMPONENT_NAME_PROTOCOL * ComponentName, OPTIONAL
+ IN EFI_DRIVER_CONFIGURATION_PROTOCOL * DriverConfiguration, OPTIONAL
+ IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL * DriverDiagnostics OPTIONAL
+ )
+/*++
+
+Routine Description:
+
+ Intialize a driver by installing the Driver Binding Protocol onto the
+ driver's DriverBindingHandle. This is typically the same as the driver's
+ ImageHandle, but it can be different if the driver produces multiple
+ DriverBinding Protocols. This function also initializes the EFI Driver
+ Library that initializes the global variables gST, gBS, gRT.
+
+Arguments:
+
+ ImageHandle - The image handle of the driver
+
+ SystemTable - The EFI System Table that was passed to the driver's entry point
+
+ DriverBinding - A Driver Binding Protocol instance that this driver is producing
+
+ DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
+ parameter is NULL, then a new handle is created.
+
+ ComponentName - A Component Name Protocol instance that this driver is producing
+
+ DriverConfiguration - A Driver Configuration Protocol instance that this driver is producing
+
+ DriverDiagnostics - A Driver Diagnostics Protocol instance that this driver is producing
+
+Returns:
+
+ EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
+
+ Otherwise, then return status from gBS->InstallProtocolInterface()
+
+--*/
+{
+ return InstallAllDriverProtocolsWorker (
+ ImageHandle,
+ SystemTable,
+ DriverBinding,
+ DriverBindingHandle,
+ ComponentName,
+ NULL,
+ DriverConfiguration,
+ NULL,
+ DriverDiagnostics,
+ NULL
+ );
+}
+
+EFI_STATUS
+EfiLibInstallAllDriverProtocols2 (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE * SystemTable,
+ IN EFI_DRIVER_BINDING_PROTOCOL * DriverBinding,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN EFI_COMPONENT_NAME2_PROTOCOL * ComponentName2, OPTIONAL
+ IN EFI_DRIVER_CONFIGURATION2_PROTOCOL * DriverConfiguration2, OPTIONAL
+ IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL * DriverDiagnostics2 OPTIONAL
+ )
+/*++
+
+Routine Description:
+
+ Intialize a driver by installing the Driver Binding Protocol onto the
+ driver's DriverBindingHandle. This is typically the same as the driver's
+ ImageHandle, but it can be different if the driver produces multiple
+ DriverBinding Protocols. This function also initializes the EFI Driver
+ Library that initializes the global variables gST, gBS, gRT.
+
+Arguments:
+
+ ImageHandle - The image handle of the driver
+
+ SystemTable - The EFI System Table that was passed to the driver's entry point
+
+ DriverBinding - A Driver Binding Protocol instance that this driver is producing
+
+ DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
+ parameter is NULL, then a new handle is created.
+
+ ComponentName2 - A Component Name2 Protocol instance that this driver is producing
+
+ DriverConfiguration2- A Driver Configuration2 Protocol instance that this driver is producing
+
+ DriverDiagnostics2 - A Driver Diagnostics2 Protocol instance that this driver is producing
+
+Returns:
+
+ EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
+
+ Otherwise, then return status from gBS->InstallProtocolInterface()
+
+--*/
+{
+ return InstallAllDriverProtocolsWorker (
+ ImageHandle,
+ SystemTable,
+ DriverBinding,
+ DriverBindingHandle,
+ NULL,
+ ComponentName2,
+ NULL,
+ DriverConfiguration2,
+ NULL,
+ DriverDiagnostics2
+ );
+}
+
+EFI_STATUS
EfiLibTestManagedDevice (
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE DriverBindingHandle,
|