summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-08 07:08:54 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-08 07:08:54 +0000
commitd850121ecda615d7f5817c6cc429336ac2168360 (patch)
tree80c333d8294101d810d16eacd6bfa5947ddb3b73
parent03284334ae825d6a7610e5fb3b907f1900a3883e (diff)
downloadedk2-d850121ecda615d7f5817c6cc429336ac2168360.zip
edk2-d850121ecda615d7f5817c6cc429336ac2168360.tar.gz
edk2-d850121ecda615d7f5817c6cc429336ac2168360.tar.bz2
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
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c5
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c177
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h61
3 files changed, 224 insertions, 19 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c
index f1af8cc..9add9e7 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 5c2b47b..eef6154 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,
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
index 03e660b..67110ff 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
@@ -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
@@ -28,6 +28,7 @@ Abstract:
#include "LinkedList.h"
#include "GetImage.h"
#include "EfiImageFormat.h"
+#include "EfiCompNameSupport.h"
#include EFI_GUID_DEFINITION (DxeServices)
#include EFI_GUID_DEFINITION (EventGroup)
@@ -40,7 +41,9 @@ Abstract:
#include EFI_PROTOCOL_DEFINITION (ComponentName)
#include EFI_PROTOCOL_DEFINITION (ComponentName2)
#include EFI_PROTOCOL_DEFINITION (DriverConfiguration)
+#include EFI_PROTOCOL_DEFINITION (DriverConfiguration2)
#include EFI_PROTOCOL_DEFINITION (DriverDiagnostics)
+#include EFI_PROTOCOL_DEFINITION (DriverDiagnostics2)
#include EFI_PROTOCOL_DEFINITION (DebugMask)
@@ -166,13 +169,9 @@ EfiLibInstallAllDriverProtocols (
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,
-#else
- IN EFI_COMPONENT_NAME_PROTOCOL *ComponentName,
-#endif
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration,
- IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics
+ IN EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
+ IN EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL
+ IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL
)
/*++
@@ -211,6 +210,52 @@ Returns:
;
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()
+
+--*/
+;
+
+EFI_STATUS
EfiLibGetSystemConfigurationTable (
IN EFI_GUID *TableGuid,
OUT VOID **Table