]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Global variables have been moved backward ahead of functions.
authorjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Dec 2008 08:52:39 +0000 (08:52 +0000)
committerjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Dec 2008 08:52:39 +0000 (08:52 +0000)
Only a few cases were left due to its module structure.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6816 6f19259b-4bc3-4df7-8a09-765794883524

34 files changed:
MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.c
MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.h [new file with mode: 0644]
MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h
MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.c
MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.h [new file with mode: 0644]
MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h
MdeModulePkg/Bus/Pci/UhciDxe/UhciDebug.c
MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Init.c
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c
MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.h
MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.h
MdeModulePkg/Core/Pei/Image/Image.c
MdeModulePkg/Core/Pei/PeiMain.h
MdeModulePkg/Core/Pei/Security/Security.c
MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h [new file with mode: 0644]
MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c
MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrForm.c
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c
MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c

index 84532ef1bd4004352fef7c8c653ba14d6ba71a07..6d37b0a847d82bc93cff16977fbd866cd92f7b03 100644 (file)
@@ -16,135 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Ehci.h"\r
 \r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 3066 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EhciComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 3066 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EhciComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
 \r
 //\r
 // EFI Component Name Protocol\r
@@ -170,6 +41,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mEhciDriverNameTable[] =
   { NULL , NULL }\r
 };\r
 \r
+\r
 /**\r
   Retrieves a Unicode string that is the user readable name of the driver.\r
 \r
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.h b/MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.h
new file mode 100644 (file)
index 0000000..96a2831
--- /dev/null
@@ -0,0 +1,147 @@
+/** @file\r
+\r
+  This file contains the delarations for componet name routines.\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _COMPONENT_NAME_H_\r
+#define _COMPONENT_NAME_H_\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the driver.\r
+\r
+  This function retrieves the user readable name of a driver in the form of a\r
+  Unicode string. If the driver specified by This has a user readable name in\r
+  the language specified by Language, then a pointer to the driver name is\r
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+  by This does not support the language specified by Language,\r
+  then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language. This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified\r
+                                in RFC 3066 or ISO 639-2 language code format.\r
+\r
+  @param  DriverName[out]       A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                driver specified by This in the language\r
+                                specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
+                                This and the language specified by Language was\r
+                                returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhciComponentNameGetDriverName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
+  );\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by a driver.\r
+\r
+  This function retrieves the user readable name of the controller specified by\r
+  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
+  driver specified by This has a user readable name in the language specified by\r
+  Language, then a pointer to the controller name is returned in ControllerName,\r
+  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
+  managing the controller specified by ControllerHandle and ChildHandle,\r
+  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
+  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  ControllerHandle[in]  The handle of a controller that the driver\r
+                                specified by This is managing.  This handle\r
+                                specifies the controller whose name is to be\r
+                                returned.\r
+\r
+  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
+                                the name of.  This is an optional parameter that\r
+                                may be NULL.  It will be NULL for device\r
+                                drivers.  It will also be NULL for a bus drivers\r
+                                that wish to retrieve the name of the bus\r
+                                controller.  It will not be NULL for a bus\r
+                                driver that wishes to retrieve the name of a\r
+                                child controller.\r
+\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language.  This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified in\r
+                                RFC 3066 or ISO 639-2 language code format.\r
+\r
+  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                controller specified by ControllerHandle and\r
+                                ChildHandle in the language specified by\r
+                                Language from the point of view of the driver\r
+                                specified by This.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
+                                the language specified by Language for the\r
+                                driver specified by This was returned in\r
+                                DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+                                EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhciComponentNameGetControllerName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
+  IN  EFI_HANDLE                                      ControllerHandle,\r
+  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                           *Language,\r
+  OUT CHAR16                                          **ControllerName\r
+  );\r
+\r
+#endif\r
+\r
index 44405b73ce4b4562cc58b6624db5a20f9355df00..53d11bf9cd4754ec7ae422ab8ee92606d113df82 100644 (file)
@@ -36,6 +36,15 @@ USB_PORT_STATE_MAP  mUsbPortChangeMap[] = {
   {PORTSC_OVERCUR_CHANGE, USB_PORT_STAT_C_OVERCURRENT}\r
 };\r
 \r
+EFI_DRIVER_BINDING_PROTOCOL\r
+gEhciDriverBinding = {\r
+  EhcDriverBindingSupported,\r
+  EhcDriverBindingStart,\r
+  EhcDriverBindingStop,\r
+  0x10,\r
+  NULL,\r
+  NULL\r
+};\r
 \r
 /**\r
   Retrieves the capablility of root hub ports.\r
@@ -1731,12 +1740,3 @@ EhcDriverBindingStop (
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_DRIVER_BINDING_PROTOCOL\r
-gEhciDriverBinding = {\r
-  EhcDriverBindingSupported,\r
-  EhcDriverBindingStart,\r
-  EhcDriverBindingStop,\r
-  0x10,\r
-  NULL,\r
-  NULL\r
-};\r
index 9d61067483f3c8b702109f5e5ba12e97f044887f..a3dd1f178a0562b4a32524540f6a14ccfd942f79 100644 (file)
@@ -40,6 +40,7 @@ typedef struct _USB2_HC_DEV  USB2_HC_DEV;
 #include "EhciUrb.h"\r
 #include "EhciSched.h"\r
 #include "EhciDebug.h"\r
+#include "ComponentName.h"\r
 \r
 typedef enum {\r
   EHC_1_MICROSECOND            = 1,\r
@@ -156,4 +157,69 @@ extern EFI_DRIVER_BINDING_PROTOCOL      gEhciDriverBinding;
 extern EFI_COMPONENT_NAME_PROTOCOL      gEhciComponentName;\r
 extern EFI_COMPONENT_NAME2_PROTOCOL     gEhciComponentName2;\r
 \r
+/**\r
+  Test to see if this driver supports ControllerHandle. Any\r
+  ControllerHandle that has Usb2HcProtocol installed will\r
+  be supported.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  Controller           Handle of device to test.\r
+  @param  RemainingDevicePath  Not used.\r
+\r
+  @return EFI_SUCCESS          This driver supports this device.\r
+  @return EFI_UNSUPPORTED      This driver does not support this device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhcDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+  IN EFI_HANDLE                  Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL    *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Starting the Usb EHCI Driver.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  Controller           Handle of device to test.\r
+  @param  RemainingDevicePath  Not used.\r
+\r
+  @return EFI_SUCCESS          supports this device.\r
+  @return EFI_UNSUPPORTED      do not support this device.\r
+  @return EFI_DEVICE_ERROR     cannot be started due to device Error.\r
+  @return EFI_OUT_OF_RESOURCES cannot allocate resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhcDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+  IN EFI_HANDLE                  Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL    *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  created by this driver.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  Controller           Handle of device to stop driver on.\r
+  @param  NumberOfChildren     Number of Children in the ChildHandleBuffer.\r
+  @param  ChildHandleBuffer    List of handles for the children we need to stop.\r
+\r
+  @return EFI_SUCCESS          Success.\r
+  @return EFI_DEVICE_ERROR     Fail.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhcDriverBindingStop (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+  IN EFI_HANDLE                  Controller,\r
+  IN UINTN                       NumberOfChildren,\r
+  IN EFI_HANDLE                  *ChildHandleBuffer\r
+  );\r
+\r
 #endif\r
+\r
index 9e8b90185a10ae23440bc6683890824f3078f7f4..74131aa7d0a711b509fadad9335960ff66caa432 100644 (file)
@@ -42,6 +42,7 @@
   EhciReg.c\r
   EhciDebug.h\r
   ComponentName.c\r
+  ComponentName.h\r
   EhciUrb.h\r
   Ehci.h\r
   EhciSched.h\r
index 06e050a4f6bc4ab05be56386b219c2ccf793661a..5b2aa697d7ee69797068c5afe4d1b38125ca924f 100644 (file)
@@ -14,139 +14,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Uhci.h"\r
 \r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 3066 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UhciComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 3066 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UhciComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
 \r
 //\r
 // EFI Component Name Protocol\r
 //\r
+\r
 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gUhciComponentName = {\r
   UhciComponentNameGetDriverName,\r
   UhciComponentNameGetControllerName,\r
@@ -168,6 +40,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUhciDriverNameTable[] =
   { NULL, NULL }\r
 };\r
 \r
+\r
+//\r
+// EFI Component Name Functions\r
+//\r
+\r
 /**\r
   Retrieves a Unicode string that is the user readable name of the driver.\r
 \r
diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.h b/MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.h
new file mode 100644 (file)
index 0000000..30cf8b5
--- /dev/null
@@ -0,0 +1,145 @@
+/** @file\r
+\r
+  This file contains the delarations for componet name routines.\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _COMPONENT_NAME_H_\r
+#define _COMPONENT_NAME_H_\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the driver.\r
+\r
+  This function retrieves the user readable name of a driver in the form of a\r
+  Unicode string. If the driver specified by This has a user readable name in\r
+  the language specified by Language, then a pointer to the driver name is\r
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+  by This does not support the language specified by Language,\r
+  then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language. This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified\r
+                                in RFC 3066 or ISO 639-2 language code format.\r
+\r
+  @param  DriverName[out]       A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                driver specified by This in the language\r
+                                specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
+                                This and the language specified by Language was\r
+                                returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciComponentNameGetDriverName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
+  );\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by a driver.\r
+\r
+  This function retrieves the user readable name of the controller specified by\r
+  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
+  driver specified by This has a user readable name in the language specified by\r
+  Language, then a pointer to the controller name is returned in ControllerName,\r
+  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
+  managing the controller specified by ControllerHandle and ChildHandle,\r
+  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
+  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  ControllerHandle[in]  The handle of a controller that the driver\r
+                                specified by This is managing.  This handle\r
+                                specifies the controller whose name is to be\r
+                                returned.\r
+\r
+  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
+                                the name of.  This is an optional parameter that\r
+                                may be NULL.  It will be NULL for device\r
+                                drivers.  It will also be NULL for a bus drivers\r
+                                that wish to retrieve the name of the bus\r
+                                controller.  It will not be NULL for a bus\r
+                                driver that wishes to retrieve the name of a\r
+                                child controller.\r
+\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language.  This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified in\r
+                                RFC 3066 or ISO 639-2 language code format.\r
+\r
+  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                controller specified by ControllerHandle and\r
+                                ChildHandle in the language specified by\r
+                                Language from the point of view of the driver\r
+                                specified by This.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
+                                the language specified by Language for the\r
+                                driver specified by This was returned in\r
+                                DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+                                EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciComponentNameGetControllerName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
+  IN  EFI_HANDLE                                      ControllerHandle,\r
+  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                           *Language,\r
+  OUT CHAR16                                          **ControllerName\r
+  );\r
+\r
+#endif\r
index d2178cd1d7c7b35a64627376f7e6a5c9f0c0563e..c20e94419671b9cf57aa4e4a8be09bfbe5b03abf 100644 (file)
@@ -15,6 +15,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Uhci.h"\r
 \r
+\r
+EFI_DRIVER_BINDING_PROTOCOL gUhciDriverBinding = {\r
+  UhciDriverBindingSupported,\r
+  UhciDriverBindingStart,\r
+  UhciDriverBindingStop,\r
+  0x20,\r
+  NULL,\r
+  NULL\r
+};\r
+\r
 /**\r
   Provides software reset for the USB host controller according to UEFI 2.0 spec.\r
 \r
@@ -1800,11 +1810,3 @@ UhciDriverBindingStop (
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_DRIVER_BINDING_PROTOCOL gUhciDriverBinding = {\r
-  UhciDriverBindingSupported,\r
-  UhciDriverBindingStart,\r
-  UhciDriverBindingStop,\r
-  0x20,\r
-  NULL,\r
-  NULL\r
-};\r
index 7a8f88096aeb6c18b867fb6e339ca0faa7c61877..c32b5b7ec8f6044067240dc3195bf57038304d41 100644 (file)
@@ -41,6 +41,7 @@ typedef struct _USB_HC_DEV  USB_HC_DEV;
 #include "UhciReg.h"\r
 #include "UhciSched.h"\r
 #include "UhciDebug.h"\r
+#include "ComponentName.h"\r
 \r
 typedef enum {\r
   UHC_1_MICROSECOND             = 1,\r
@@ -142,4 +143,67 @@ extern EFI_DRIVER_BINDING_PROTOCOL   gUhciDriverBinding;
 extern EFI_COMPONENT_NAME_PROTOCOL   gUhciComponentName;\r
 extern EFI_COMPONENT_NAME2_PROTOCOL  gUhciComponentName2;\r
 \r
+/**\r
+  Test to see if this driver supports ControllerHandle. Any\r
+  ControllerHandle that has UsbHcProtocol installed will be supported.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  Controller           Handle of device to test.\r
+  @param  RemainingDevicePath  Not used.\r
+\r
+  @return EFI_SUCCESS          This driver supports this device.\r
+  @return EFI_UNSUPPORTED      This driver does not support this device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL     *This,\r
+  IN EFI_HANDLE                      Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Starting the Usb UHCI Driver.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  Controller           Handle of device to test.\r
+  @param  RemainingDevicePath  Not used.\r
+\r
+  @retval EFI_SUCCESS          This driver supports this device.\r
+  @retval EFI_UNSUPPORTED      This driver does not support this device.\r
+  @retval EFI_DEVICE_ERROR     This driver cannot be started due to device Error.\r
+                               EFI_OUT_OF_RESOURCES- Failed due to resource shortage.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL     *This,\r
+  IN EFI_HANDLE                      Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  created by this driver.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  Controller           Handle of device to stop driver on.\r
+  @param  NumberOfChildren     Number of Children in the ChildHandleBuffer.\r
+  @param  ChildHandleBuffer    List of handles for the children we need to stop.\r
+\r
+  @return EFI_SUCCESS\r
+  @return others\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingStop (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL     *This,\r
+  IN EFI_HANDLE                      Controller,\r
+  IN UINTN                           NumberOfChildren,\r
+  IN EFI_HANDLE                      *ChildHandleBuffer\r
+  );\r
+\r
 #endif\r
index 744976cd02011b118ce791784f0992d325c5fb63..7c3bfe91ae108ec872b86345860cb47ba6478679 100644 (file)
@@ -14,8 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 #include "Uhci.h"\r
-#include "UhciDebug.h"\r
-\r
 \r
 /**\r
   Dump the content of QH structure.\r
index 247b7d460aae329645432dcb7f46bd56ae835f84..dba781367198d2ed8b8223f632fb9710fdda8b50 100644 (file)
@@ -45,6 +45,7 @@
   UhciReg.h\r
   UhciSched.h\r
   ComponentName.c\r
+  ComponentName.h\r
 \r
 \r
 [Packages]\r
index 78b141409e33aeaf48150ec73443853289cc2f12..2ebd50c29fd705967a5297a6e6d4e4b3ce27b4a0 100644 (file)
@@ -21,6 +21,18 @@ PXE_SW_UNDI             *pxe_31 = NULL;  // 3.1 entry
 UNDI32_DEV              *UNDI32DeviceList[MAX_NIC_INTERFACES];\r
 NII_TABLE               *UndiDataPointer = NULL;\r
 \r
+//\r
+// UNDI Class Driver Global Variables\r
+//\r
+EFI_DRIVER_BINDING_PROTOCOL  gUndiDriverBinding = {\r
+  UndiDriverSupported,\r
+  UndiDriverStart,\r
+  UndiDriverStop,\r
+  0xa,\r
+  NULL,\r
+  NULL\r
+};\r
+\r
 \r
 /**\r
   When address mapping changes to virtual this should make the appropriate\r
@@ -31,7 +43,6 @@ NII_TABLE               *UndiDataPointer = NULL;
   @return None\r
 \r
 **/\r
-// TODO:    Context - add argument and description to function comment\r
 VOID\r
 EFIAPI\r
 UndiNotifyVirtual (\r
@@ -86,7 +97,6 @@ UndiNotifyVirtual (
   @return None\r
 \r
 **/\r
-// TODO:    Context - add argument and description to function comment\r
 VOID\r
 EFIAPI\r
 UndiNotifyExitBs (\r
@@ -96,18 +106,6 @@ UndiNotifyExitBs (
 {\r
   InstallConfigTable ();\r
 }\r
-//\r
-// UNDI Class Driver Global Variables\r
-//\r
-EFI_DRIVER_BINDING_PROTOCOL  gUndiDriverBinding = {\r
-  UndiDriverSupported,\r
-  UndiDriverStart,\r
-  UndiDriverStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
 \r
 \r
 /**\r
index fc9bd5335f38d6be5cd4d34734ecc721f1186fbe..2e5edeb0c3e985b0e162444b866c240473f904d9 100644 (file)
@@ -20,6 +20,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 EFI_GUID  mUsbBusProtocolGuid = EFI_USB_BUS_PROTOCOL_GUID;\r
 \r
+EFI_USB_IO_PROTOCOL mUsbIoProtocol = {\r
+  UsbIoControlTransfer,\r
+  UsbIoBulkTransfer,\r
+  UsbIoAsyncInterruptTransfer,\r
+  UsbIoSyncInterruptTransfer,\r
+  UsbIoIsochronousTransfer,\r
+  UsbIoAsyncIsochronousTransfer,\r
+  UsbIoGetDeviceDescriptor,\r
+  UsbIoGetActiveConfigDescriptor,\r
+  UsbIoGetInterfaceDescriptor,\r
+  UsbIoGetEndpointDescriptor,\r
+  UsbIoGetStringDescriptor,\r
+  UsbIoGetSupportedLanguages,\r
+  UsbIoPortReset\r
+};\r
+\r
+EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding = {\r
+  UsbBusControllerDriverSupported,\r
+  UsbBusControllerDriverStart,\r
+  UsbBusControllerDriverStop,\r
+  0xa,\r
+  NULL,\r
+  NULL\r
+};\r
+\r
 \r
 /**\r
   USB_IO function to execute a control transfer. This\r
@@ -1037,22 +1062,6 @@ CLOSE_HC:
   return Status;\r
 }\r
 \r
-EFI_USB_IO_PROTOCOL mUsbIoProtocol = {\r
-  UsbIoControlTransfer,\r
-  UsbIoBulkTransfer,\r
-  UsbIoAsyncInterruptTransfer,\r
-  UsbIoSyncInterruptTransfer,\r
-  UsbIoIsochronousTransfer,\r
-  UsbIoAsyncIsochronousTransfer,\r
-  UsbIoGetDeviceDescriptor,\r
-  UsbIoGetActiveConfigDescriptor,\r
-  UsbIoGetInterfaceDescriptor,\r
-  UsbIoGetEndpointDescriptor,\r
-  UsbIoGetStringDescriptor,\r
-  UsbIoGetSupportedLanguages,\r
-  UsbIoPortReset\r
-};\r
-\r
 \r
 /**\r
   The USB bus driver entry pointer.\r
@@ -1435,12 +1444,3 @@ UsbBusControllerDriverStop (
 \r
   return Status;\r
 }\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding = {\r
-  UsbBusControllerDriverSupported,\r
-  UsbBusControllerDriverStart,\r
-  UsbBusControllerDriverStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
index 41f2022631feaabc685aff736712210e4e8153ff..29cff5c077925c22085bf085a3be8e3ef5577913 100644 (file)
@@ -350,6 +350,396 @@ UsbBusRecursivelyConnectWantedUsbIo (
   IN EFI_USB_BUS_PROTOCOL         *UsbBusId\r
   );\r
 \r
+/**\r
+  USB_IO function to execute a control transfer. This\r
+  function will execute the USB transfer. If transfer\r
+  successes, it will sync the internal state of USB bus\r
+  with device state.\r
+\r
+  @param  This                   The USB_IO instance\r
+  @param  Request                The control transfer request\r
+  @param  Direction              Direction for data stage\r
+  @param  Timeout                The time to wait before timeout\r
+  @param  Data                   The buffer holding the data\r
+  @param  DataLength             Then length of the data\r
+  @param  UsbStatus              USB result\r
+\r
+  @retval EFI_INVALID_PARAMETER  The parameters are invalid\r
+  @retval EFI_SUCCESS            The control transfer succeded.\r
+  @retval Others                 Failed to execute the transfer\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoControlTransfer (\r
+  IN  EFI_USB_IO_PROTOCOL     *This,\r
+  IN  EFI_USB_DEVICE_REQUEST  *Request,\r
+  IN  EFI_USB_DATA_DIRECTION  Direction,\r
+  IN  UINT32                  Timeout,\r
+  IN  OUT VOID                *Data,      OPTIONAL\r
+  IN  UINTN                   DataLength, OPTIONAL\r
+  OUT UINT32                  *UsbStatus\r
+  );\r
+\r
+/**\r
+  Execute a bulk transfer to the device endpoint.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  Endpoint               The device endpoint.\r
+  @param  Data                   The data to transfer.\r
+  @param  DataLength             The length of the data to transfer.\r
+  @param  Timeout                Time to wait before timeout.\r
+  @param  UsbStatus              The result of USB transfer.\r
+\r
+  @retval EFI_SUCCESS            The bulk transfer is OK.\r
+  @retval EFI_INVALID_PARAMETER  Some parameters are invalid.\r
+  @retval Others                 Failed to execute transfer, reason returned in\r
+                                 UsbStatus.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoBulkTransfer (\r
+  IN  EFI_USB_IO_PROTOCOL *This,\r
+  IN  UINT8               Endpoint,\r
+  IN  OUT VOID            *Data,\r
+  IN  OUT UINTN           *DataLength,\r
+  IN  UINTN               Timeout,\r
+  OUT UINT32              *UsbStatus\r
+  );\r
+\r
+/**\r
+  Execute a synchronous interrupt transfer.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  Endpoint               The device endpoint.\r
+  @param  Data                   The data to transfer.\r
+  @param  DataLength             The length of the data to transfer.\r
+  @param  Timeout                Time to wait before timeout.\r
+  @param  UsbStatus              The result of USB transfer.\r
+\r
+  @retval EFI_SUCCESS            The synchronous interrupt transfer is OK.\r
+  @retval EFI_INVALID_PARAMETER  Some parameters are invalid.\r
+  @retval Others                 Failed to execute transfer, reason returned in\r
+                                 UsbStatus.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoSyncInterruptTransfer (\r
+  IN  EFI_USB_IO_PROTOCOL *This,\r
+  IN  UINT8               Endpoint,\r
+  IN  OUT VOID            *Data,\r
+  IN  OUT UINTN           *DataLength,\r
+  IN  UINTN               Timeout,\r
+  OUT UINT32              *UsbStatus\r
+  );\r
+\r
+/**\r
+  Queue a new asynchronous interrupt transfer, or remove the old\r
+  request if (IsNewTransfer == FALSE).\r
+\r
+  @param  This                   The USB_IO instance.\r
+  @param  Endpoint               The device endpoint.\r
+  @param  IsNewTransfer          Whether this is a new request, if it's old, remove\r
+                                 the request.\r
+  @param  PollInterval           The interval to poll the transfer result, (in ms).\r
+  @param  DataLength             The length of perodic data transfer.\r
+  @param  Callback               The function to call periodicaly when transfer is\r
+                                 ready.\r
+  @param  Context                The context to the callback.\r
+\r
+  @retval EFI_SUCCESS            New transfer is queued or old request is removed.\r
+  @retval EFI_INVALID_PARAMETER  Some parameters are invalid.\r
+  @retval Others                 Failed to queue the new request or remove the old\r
+                                 request.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoAsyncInterruptTransfer (\r
+  IN EFI_USB_IO_PROTOCOL              *This,\r
+  IN UINT8                            Endpoint,\r
+  IN BOOLEAN                          IsNewTransfer,\r
+  IN UINTN                            PollInterval,       OPTIONAL\r
+  IN UINTN                            DataLength,         OPTIONAL\r
+  IN EFI_ASYNC_USB_TRANSFER_CALLBACK  Callback,           OPTIONAL\r
+  IN VOID                             *Context            OPTIONAL\r
+  );\r
+\r
+/**\r
+  Execute a synchronous isochronous transfer.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  DeviceEndpoint         The device endpoint.\r
+  @param  Data                   The data to transfer.\r
+  @param  DataLength             The length of the data to transfer.\r
+  @param  UsbStatus              The result of USB transfer.\r
+\r
+  @retval EFI_UNSUPPORTED        Currently isochronous transfer isn't supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoIsochronousTransfer (\r
+  IN  EFI_USB_IO_PROTOCOL *This,\r
+  IN  UINT8               DeviceEndpoint,\r
+  IN  OUT VOID            *Data,\r
+  IN  UINTN               DataLength,\r
+  OUT UINT32              *Status\r
+  );\r
+\r
+/**\r
+  Queue an asynchronous isochronous transfer.\r
+\r
+  @param  This                   The USB_IO instance.\r
+  @param  DeviceEndpoint         The device endpoint.\r
+  @param  Data                   The data to transfer.\r
+  @param  DataLength             The length of perodic data transfer.\r
+  @param  IsochronousCallBack    The function to call periodicaly when transfer is\r
+                                 ready.\r
+  @param  Context                The context to the callback.\r
+\r
+  @retval EFI_UNSUPPORTED        Currently isochronous transfer isn't supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoAsyncIsochronousTransfer (\r
+  IN EFI_USB_IO_PROTOCOL              *This,\r
+  IN UINT8                            DeviceEndpoint,\r
+  IN OUT VOID                         *Data,\r
+  IN UINTN                            DataLength,\r
+  IN EFI_ASYNC_USB_TRANSFER_CALLBACK  IsochronousCallBack,\r
+  IN VOID                             *Context              OPTIONAL\r
+  );\r
+\r
+/**\r
+  Retrieve the device descriptor of the device.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  Descriptor             The variable to receive the device descriptor.\r
+\r
+  @retval EFI_SUCCESS            The device descriptor is returned.\r
+  @retval EFI_INVALID_PARAMETER  The parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetDeviceDescriptor (\r
+  IN  EFI_USB_IO_PROTOCOL       *This,\r
+  OUT EFI_USB_DEVICE_DESCRIPTOR *Descriptor\r
+  );\r
+\r
+/**\r
+  Return the configuration descriptor of the current active configuration.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  Descriptor             The USB configuration descriptor.\r
+\r
+  @retval EFI_SUCCESS            The active configuration descriptor is returned.\r
+  @retval EFI_INVALID_PARAMETER  Some parameter is invalid.\r
+  @retval EFI_NOT_FOUND          Currently no active configuration is selected.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetActiveConfigDescriptor (\r
+  IN  EFI_USB_IO_PROTOCOL       *This,\r
+  OUT EFI_USB_CONFIG_DESCRIPTOR *Descriptor\r
+  );\r
+\r
+/**\r
+  Retrieve the active interface setting descriptor for this USB IO instance.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  Descriptor             The variable to receive active interface setting.\r
+\r
+  @retval EFI_SUCCESS            The active interface setting is returned.\r
+  @retval EFI_INVALID_PARAMETER  Some parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetInterfaceDescriptor (\r
+  IN  EFI_USB_IO_PROTOCOL           *This,\r
+  OUT EFI_USB_INTERFACE_DESCRIPTOR  *Descriptor\r
+  );\r
+\r
+/**\r
+  Retrieve the endpoint descriptor from this interface setting.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  Index                  The index (start from zero) of the endpoint to\r
+                                 retrieve.\r
+  @param  Descriptor             The variable to receive the descriptor.\r
+\r
+  @retval EFI_SUCCESS            The endpoint descriptor is returned.\r
+  @retval EFI_INVALID_PARAMETER  Some parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetEndpointDescriptor (\r
+  IN  EFI_USB_IO_PROTOCOL         *This,\r
+  IN  UINT8                       Index,\r
+  OUT EFI_USB_ENDPOINT_DESCRIPTOR *Descriptor\r
+  );\r
+\r
+/**\r
+  Retrieve the supported language ID table from the device.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  LangIDTable            The table to return the language IDs.\r
+  @param  TableSize              The number of supported languanges.\r
+\r
+  @retval EFI_SUCCESS            The language ID is return.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetSupportedLanguages (\r
+  IN  EFI_USB_IO_PROTOCOL *This,\r
+  OUT UINT16              **LangIDTable,\r
+  OUT UINT16              *TableSize\r
+  );\r
+\r
+/**\r
+  Retrieve an indexed string in the language of LangID.\r
+\r
+  @param  This                   The USB IO instance.\r
+  @param  LangID                 The language ID of the string to retrieve.\r
+  @param  StringIndex            The index of the string.\r
+  @param  String                 The variable to receive the string.\r
+\r
+  @retval EFI_SUCCESS            The string is returned.\r
+  @retval EFI_NOT_FOUND          No such string existed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetStringDescriptor (\r
+  IN  EFI_USB_IO_PROTOCOL   *This,\r
+  IN  UINT16                LangID,\r
+  IN  UINT8                 StringIndex,\r
+  OUT CHAR16                **String\r
+  );\r
+\r
+/**\r
+  Reset the device, then if that succeeds, reconfigure the\r
+  device with its address and current active configuration.\r
+\r
+  @param  This                   The USB IO instance.\r
+\r
+  @retval EFI_SUCCESS            The device is reset and configured.\r
+  @retval Others                 Failed to reset the device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoPortReset (\r
+  IN EFI_USB_IO_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  Install Usb Bus Protocol on host controller, and start the Usb bus.\r
+\r
+  @param This                    The USB bus driver binding instance.\r
+  @param Controller              The controller to check.\r
+  @param RemainingDevicePath     The remaining device patch.\r
+\r
+  @retval EFI_SUCCESS            The controller is controlled by the usb bus.\r
+  @retval EFI_ALREADY_STARTED    The controller is already controlled by the usb bus.\r
+  @retval EFI_OUT_OF_RESOURCES   Failed to allocate resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusBuildProtocol (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  The USB bus driver entry pointer.\r
+\r
+  @param ImageHandle       The driver image handle.\r
+  @param SystemTable       The system table.\r
+\r
+  @return EFI_SUCCESS      The component name protocol is installed.\r
+  @return Others           Failed to init the usb driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusDriverEntryPoint (\r
+  IN EFI_HANDLE           ImageHandle,\r
+  IN EFI_SYSTEM_TABLE     *SystemTable\r
+  );\r
+\r
+/**\r
+  Check whether USB bus driver support this device.\r
+\r
+  @param  This                   The USB bus driver binding protocol.\r
+  @param  Controller             The controller handle to check.\r
+  @param  RemainingDevicePath    The remaining device path.\r
+\r
+  @retval EFI_SUCCESS            The bus supports this controller.\r
+  @retval EFI_UNSUPPORTED        This device isn't supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusControllerDriverSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Start to process the controller.\r
+\r
+  @param  This                   The USB bus driver binding instance.\r
+  @param  Controller             The controller to check.\r
+  @param  RemainingDevicePath    The remaining device patch.\r
+\r
+  @retval EFI_SUCCESS            The controller is controlled by the usb bus.\r
+  @retval EFI_ALREADY_STARTED    The controller is already controlled by the usb\r
+                                 bus.\r
+  @retval EFI_OUT_OF_RESOURCES   Failed to allocate resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusControllerDriverStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Stop handle the controller by this USB bus driver.\r
+\r
+  @param  This                   The USB bus driver binding protocol.\r
+  @param  Controller             The controller to release.\r
+  @param  NumberOfChildren       The child of USB bus that opened controller\r
+                                 BY_CHILD.\r
+  @param  ChildHandleBuffer      The array of child handle.\r
+\r
+  @retval EFI_SUCCESS            The controller or children are stopped.\r
+  @retval EFI_DEVICE_ERROR       Failed to stop the driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusControllerDriverStop (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   Controller,\r
+  IN UINTN                        NumberOfChildren,\r
+  IN EFI_HANDLE                   *ChildHandleBuffer\r
+  );\r
+\r
 extern EFI_USB_IO_PROTOCOL            mUsbIoProtocol;\r
 extern EFI_DRIVER_BINDING_PROTOCOL    mUsbBusDriverBinding;\r
 extern EFI_COMPONENT_NAME_PROTOCOL    mUsbBusComponentName;\r
index 4a2e382cd7a8b07f76c0ca5bc85443b72eba21ac..fdcde5d90f76231b8203de9c084d506f26016e73 100644 (file)
@@ -15,6 +15,33 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "UsbBus.h"\r
 \r
+//\r
+// Array that maps the change bit to feature value which is\r
+// used to clear these change bit. USB HUB API will clear\r
+// these change bit automatically. For non-root hub, these\r
+// bits determine whether hub will report the port in changed\r
+// bit maps.\r
+//\r
+#define USB_HUB_MAP_SIZE  5\r
+\r
+USB_CHANGE_FEATURE_MAP  mHubFeatureMap[USB_HUB_MAP_SIZE] = {\r
+  {USB_PORT_STAT_C_CONNECTION,  EfiUsbPortConnectChange},\r
+  {USB_PORT_STAT_C_ENABLE,      EfiUsbPortEnableChange},\r
+  {USB_PORT_STAT_C_SUSPEND,     EfiUsbPortSuspendChange},\r
+  {USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},\r
+  {USB_PORT_STAT_C_RESET,       EfiUsbPortResetChange},\r
+};\r
+\r
+#define USB_ROOT_HUB_MAP_SIZE 5\r
+\r
+USB_CHANGE_FEATURE_MAP  mRootHubFeatureMap[USB_ROOT_HUB_MAP_SIZE] = {\r
+  {USB_PORT_STAT_C_CONNECTION,  EfiUsbPortConnectChange},\r
+  {USB_PORT_STAT_C_ENABLE,      EfiUsbPortEnableChange},\r
+  {USB_PORT_STAT_C_SUSPEND,     EfiUsbPortSuspendChange},\r
+  {USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},\r
+  {USB_PORT_STAT_C_RESET,       EfiUsbPortResetChange},\r
+};\r
+\r
 //\r
 // USB hub class specific requests. Although USB hub\r
 // is related to an interface, these requests are sent\r
@@ -576,32 +603,6 @@ UsbOnHubInterrupt (
   return EFI_SUCCESS;\r
 }\r
 \r
-//\r
-// Array that maps the change bit to feature value which is\r
-// used to clear these change bit. USB HUB API will clear\r
-// these change bit automatically. For non-root hub, these\r
-// bits determine whether hub will report the port in changed\r
-// bit maps.\r
-//\r
-#define USB_HUB_MAP_SIZE  5\r
-\r
-USB_CHANGE_FEATURE_MAP  mHubFeatureMap[USB_HUB_MAP_SIZE] = {\r
-  {USB_PORT_STAT_C_CONNECTION,  EfiUsbPortConnectChange},\r
-  {USB_PORT_STAT_C_ENABLE,      EfiUsbPortEnableChange},\r
-  {USB_PORT_STAT_C_SUSPEND,     EfiUsbPortSuspendChange},\r
-  {USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},\r
-  {USB_PORT_STAT_C_RESET,       EfiUsbPortResetChange},\r
-};\r
-\r
-#define USB_ROOT_HUB_MAP_SIZE 5\r
-\r
-USB_CHANGE_FEATURE_MAP  mRootHubFeatureMap[USB_ROOT_HUB_MAP_SIZE] = {\r
-  {USB_PORT_STAT_C_CONNECTION,  EfiUsbPortConnectChange},\r
-  {USB_PORT_STAT_C_ENABLE,      EfiUsbPortEnableChange},\r
-  {USB_PORT_STAT_C_SUSPEND,     EfiUsbPortSuspendChange},\r
-  {USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},\r
-  {USB_PORT_STAT_C_RESET,       EfiUsbPortResetChange},\r
-};\r
 \r
 \r
 \r
index 36c80ce4703bcdb14d0ad165f595f8b3d770a45d..9af221daaddeaf0a98e0e7b7635953603b95baec 100644 (file)
@@ -130,40 +130,6 @@ UINT8 KeyboardLayoutTable[USB_KEYCODE_MAX_MAKE + 8][5] = {
   {EfiKeyA3,         0,        0,     EFI_RIGHT_LOGO_MODIFIER,      0},  // 0xe7\r
 };\r
 \r
-/**\r
-  Initialize KeyConvertionTable by using default keyboard layout.\r
-\r
-  @param  UsbKeyboardDevice    The USB_KB_DEV instance.\r
-  @retval None.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-LoadDefaultKeyboardLayout (\r
-  IN USB_KB_DEV                 *UsbKeyboardDevice\r
-  )\r
-{\r
-  UINTN               Index;\r
-  EFI_KEY_DESCRIPTOR  *KeyDescriptor;\r
-\r
-  //\r
-  // Construct KeyConvertionTable by default keyboard layout\r
-  //\r
-  KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0];\r
-\r
-  for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) {\r
-    KeyDescriptor->Key                 = (EFI_KEY) KeyboardLayoutTable[Index][0];\r
-    KeyDescriptor->Unicode             = KeyboardLayoutTable[Index][1];\r
-    KeyDescriptor->ShiftedUnicode      = KeyboardLayoutTable[Index][2];\r
-    KeyDescriptor->AltGrUnicode        = 0;\r
-    KeyDescriptor->ShiftedAltGrUnicode = 0;\r
-    KeyDescriptor->Modifier            = KeyboardLayoutTable[Index][3];\r
-    KeyDescriptor->AffectedAttribute   = KeyboardLayoutTable[Index][4];\r
-\r
-    KeyDescriptor++;\r
-  }\r
-}\r
-\r
 //\r
 // EFI_KEY to USB Scan Code convertion table\r
 //\r
@@ -330,6 +296,40 @@ KB_MODIFIER  KB_Mod[8] = {
 };\r
 \r
 \r
+/**\r
+  Initialize KeyConvertionTable by using default keyboard layout.\r
+\r
+  @param  UsbKeyboardDevice    The USB_KB_DEV instance.\r
+  @retval None.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+LoadDefaultKeyboardLayout (\r
+  IN USB_KB_DEV                 *UsbKeyboardDevice\r
+  )\r
+{\r
+  UINTN               Index;\r
+  EFI_KEY_DESCRIPTOR  *KeyDescriptor;\r
+\r
+  //\r
+  // Construct KeyConvertionTable by default keyboard layout\r
+  //\r
+  KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0];\r
+\r
+  for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) {\r
+    KeyDescriptor->Key                 = (EFI_KEY) KeyboardLayoutTable[Index][0];\r
+    KeyDescriptor->Unicode             = KeyboardLayoutTable[Index][1];\r
+    KeyDescriptor->ShiftedUnicode      = KeyboardLayoutTable[Index][2];\r
+    KeyDescriptor->AltGrUnicode        = 0;\r
+    KeyDescriptor->ShiftedAltGrUnicode = 0;\r
+    KeyDescriptor->Modifier            = KeyboardLayoutTable[Index][3];\r
+    KeyDescriptor->AffectedAttribute   = KeyboardLayoutTable[Index][4];\r
+\r
+    KeyDescriptor++;\r
+  }\r
+}\r
+\r
 \r
 /**\r
   Uses USB I/O to check whether the device is a USB Keyboard device.\r
index f7186af0fcbe2819e057d774a401a5bb08c6c0b4..00e4ca049cbb79b37bd1c1e305897388b31d8cee 100644 (file)
@@ -25,41 +25,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "mousehid.h"\r
 \r
-//\r
-// Prototypes\r
-// Driver model protocol interface\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseAbsolutePointerDriverBindingEntryPoint (\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseAbsolutePointerDriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN EFI_HANDLE                     Controller,\r
-  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseAbsolutePointerDriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN EFI_HANDLE                     Controller,\r
-  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseAbsolutePointerDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Controller,\r
-  IN  UINTN                         NumberOfChildren,\r
-  IN  EFI_HANDLE                    *ChildHandleBuffer\r
-  );\r
 \r
 EFI_GUID  gEfiUsbMouseAbsolutePointerDriverGuid = {\r
   0xa579f729, 0xa71d, 0x4b45, { 0xbe, 0xd7, 0xd, 0xb0, 0xa8, 0x7c, 0x3e, 0x8d }\r
index 48a6321d20924ca1034644d31fd2223f869aa0e8..540841533e4d8cc4cf41a54fe52d8a85c886205e 100644 (file)
@@ -103,4 +103,41 @@ MouseAbsolutePointerReportStatusCode (
   IN EFI_STATUS_CODE_VALUE     Value\r
   );\r
 \r
+//\r
+// Prototypes\r
+// Driver model protocol interface\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseAbsolutePointerDriverBindingEntryPoint (\r
+  IN EFI_HANDLE           ImageHandle,\r
+  IN EFI_SYSTEM_TABLE     *SystemTable\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseAbsolutePointerDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
+  IN EFI_HANDLE                     Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseAbsolutePointerDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
+  IN EFI_HANDLE                     Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseAbsolutePointerDriverBindingStop (\r
+  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
+  IN  EFI_HANDLE                    Controller,\r
+  IN  UINTN                         NumberOfChildren,\r
+  IN  EFI_HANDLE                    *ChildHandleBuffer\r
+  );\r
+\r
+\r
 #endif\r
index 1e359d75437182ad3e2326ef945739e4f6c2a352..15b8405da2188a9ce17d95a721ce8f35825b466e 100644 (file)
@@ -22,86 +22,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "UsbMouse.h"\r
 #include "MouseHid.h"\r
 \r
-/**\r
-  The USB Mouse driver entry pointer.\r
-\r
-  @param  ImageHandle      The driver image handle.\r
-  @param  SystemTable      The system table.\r
-\r
-  @return EFI_SUCCESS      The component name protocol is installed.\r
-  @return Others           Failed to init the usb driver.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseDriverBindingEntryPoint (\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  );\r
-\r
-/**\r
-  Test to see if this driver supports ControllerHandle. Any ControllerHandle\r
-  that has UsbIoProtocol installed will be supported.\r
-\r
-  @param  This                  Protocol instance pointer.\r
-  @param  Controller            Handle of device to test.\r
-  @param  RemainingDevicePath   Not used.\r
-\r
-  @retval EFI_SUCCESS           This driver supports this device.\r
-  @retval EFI_UNSUPPORTED       This driver does not support this device.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseDriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN EFI_HANDLE                     Controller,\r
-  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
-  );\r
-\r
-/**\r
-  Starting the Usb Mouse Driver.\r
-\r
-  @param  This                  Protocol instance pointer.\r
-  @param  Controller            Handle of device to test\r
-  @param  RemainingDevicePath   Not used\r
-\r
-  @retval EFI_SUCCESS           This driver supports this device.\r
-  @retval EFI_UNSUPPORTED       This driver does not support this device.\r
-  @retval EFI_DEVICE_ERROR      This driver cannot be started due to device Error.\r
-  @retval EFI_OUT_OF_RESOURCES  Can't allocate memory resources.\r
-  @retval EFI_ALREADY_STARTED   Thios driver has been started.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseDriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN EFI_HANDLE                     Controller,\r
-  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
-  );\r
-\r
-/**\r
-  Stop this driver on ControllerHandle. Support stoping any child handles\r
-  created by this driver.\r
-\r
-  @param  This                  Protocol instance pointer.\r
-  @param  Controller            Handle of device to stop driver on.\r
-  @param  NumberOfChildren      Number of Children in the ChildHandleBuffer.\r
-  @param  ChildHandleBuffer     List of handles for the children we need to stop.\r
-\r
-  @retval EFI_SUCCESS           The controller or children are stopped.\r
-  @retval Other                 Failed to stop the driver.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Controller,\r
-  IN  UINTN                         NumberOfChildren,\r
-  IN  EFI_HANDLE                    *ChildHandleBuffer\r
-  );\r
 \r
 EFI_GUID  gEfiUsbMouseDriverGuid = {\r
   0x290156b5, 0x6a05, 0x4ac0, {0xb8, 0x0, 0x51, 0x27, 0x55, 0xad, 0x14, 0x29}\r
index e1068a03a10ac647ba0bf2fc66cf5317de7602ef..b8b3ed4b38fc33ab015a2a8d12cd11379b153ff4 100644 (file)
@@ -115,4 +115,85 @@ MouseReportStatusCode (
   IN EFI_STATUS_CODE_VALUE     Value\r
   );\r
 \r
+/**\r
+  The USB Mouse driver entry pointer.\r
+\r
+  @param  ImageHandle      The driver image handle.\r
+  @param  SystemTable      The system table.\r
+\r
+  @return EFI_SUCCESS      The component name protocol is installed.\r
+  @return Others           Failed to init the usb driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseDriverBindingEntryPoint (\r
+  IN EFI_HANDLE           ImageHandle,\r
+  IN EFI_SYSTEM_TABLE     *SystemTable\r
+  );\r
+\r
+/**\r
+  Test to see if this driver supports ControllerHandle. Any ControllerHandle\r
+  that has UsbIoProtocol installed will be supported.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Controller            Handle of device to test.\r
+  @param  RemainingDevicePath   Not used.\r
+\r
+  @retval EFI_SUCCESS           This driver supports this device.\r
+  @retval EFI_UNSUPPORTED       This driver does not support this device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
+  IN EFI_HANDLE                     Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Starting the Usb Mouse Driver.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Controller            Handle of device to test\r
+  @param  RemainingDevicePath   Not used\r
+\r
+  @retval EFI_SUCCESS           This driver supports this device.\r
+  @retval EFI_UNSUPPORTED       This driver does not support this device.\r
+  @retval EFI_DEVICE_ERROR      This driver cannot be started due to device Error.\r
+  @retval EFI_OUT_OF_RESOURCES  Can't allocate memory resources.\r
+  @retval EFI_ALREADY_STARTED   Thios driver has been started.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
+  IN EFI_HANDLE                     Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  created by this driver.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Controller            Handle of device to stop driver on.\r
+  @param  NumberOfChildren      Number of Children in the ChildHandleBuffer.\r
+  @param  ChildHandleBuffer     List of handles for the children we need to stop.\r
+\r
+  @retval EFI_SUCCESS           The controller or children are stopped.\r
+  @retval Other                 Failed to stop the driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseDriverBindingStop (\r
+  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
+  IN  EFI_HANDLE                    Controller,\r
+  IN  UINTN                         NumberOfChildren,\r
+  IN  EFI_HANDLE                    *ChildHandleBuffer\r
+  );\r
+\r
 #endif\r
index 23e9ee58d6d3b5a18c6d9f34fa547c20ccdf9128..e02f7f13670a88f1b96ec7e2c8d93d1e38430e19 100644 (file)
@@ -14,29 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "PeiMain.h"\r
 \r
-/**\r
-  The wrapper function of PeiLoadImageLoadImage().\r
-\r
-  @param This            - Pointer to EFI_PEI_LOAD_FILE_PPI.\r
-  @param FileHandle      - Pointer to the FFS file header of the image.\r
-  @param ImageAddressArg - Pointer to PE/TE image.\r
-  @param ImageSizeArg    - Size of PE/TE image.\r
-  @param EntryPoint      - Pointer to entry point of specified image file for output.\r
-  @param AuthenticationState - Pointer to attestation authentication state of image.\r
-\r
-  @return Status of PeiLoadImageLoadImage().\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiLoadImageLoadImageWrapper (\r
-  IN     CONST EFI_PEI_LOAD_FILE_PPI  *This,\r
-  IN     EFI_PEI_FILE_HANDLE          FileHandle,\r
-  OUT    EFI_PHYSICAL_ADDRESS         *ImageAddressArg,  OPTIONAL\r
-  OUT    UINT64                       *ImageSizeArg,     OPTIONAL\r
-  OUT    EFI_PHYSICAL_ADDRESS         *EntryPoint,\r
-  OUT    UINT32                       *AuthenticationState\r
-  );\r
 \r
 EFI_PEI_LOAD_FILE_PPI   mPeiLoadImagePpi = {\r
   PeiLoadImageLoadImageWrapper\r
index 983c102ec0c89b15d88f0b7a4af332a115a1f80a..1a5201c1d1624609b1ed092d098b14775cd23664 100644 (file)
@@ -284,8 +284,8 @@ PeiDispatcher (
   @param PrivateData     PeiCore's private data structure\r
   @param OldCoreData     Old data from SecCore\r
                          NULL if being run in non-permament memory mode.\r
-  @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size \r
-                                                                                        and location of temporary RAM, the stack location and the BFV location.\r
+  @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size\r
+                         and location of temporary RAM, the stack location and the BFV location.\r
 \r
 **/\r
 VOID\r
@@ -1023,4 +1023,47 @@ ProcessFvFile (
   OUT UINT32                 *AuthenticationState\r
   );\r
 \r
+/**\r
+  The wrapper function of PeiLoadImageLoadImage().\r
+\r
+  @param This            - Pointer to EFI_PEI_LOAD_FILE_PPI.\r
+  @param FileHandle      - Pointer to the FFS file header of the image.\r
+  @param ImageAddressArg - Pointer to PE/TE image.\r
+  @param ImageSizeArg    - Size of PE/TE image.\r
+  @param EntryPoint      - Pointer to entry point of specified image file for output.\r
+  @param AuthenticationState - Pointer to attestation authentication state of image.\r
+\r
+  @return Status of PeiLoadImageLoadImage().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiLoadImageLoadImageWrapper (\r
+  IN     CONST EFI_PEI_LOAD_FILE_PPI  *This,\r
+  IN     EFI_PEI_FILE_HANDLE          FileHandle,\r
+  OUT    EFI_PHYSICAL_ADDRESS         *ImageAddressArg,  OPTIONAL\r
+  OUT    UINT64                       *ImageSizeArg,     OPTIONAL\r
+  OUT    EFI_PHYSICAL_ADDRESS         *EntryPoint,\r
+  OUT    UINT32                       *AuthenticationState\r
+  );\r
+\r
+/**\r
+\r
+  Provide a callback for when the security PPI is installed.\r
+\r
+  @param PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param NotifyDescriptor   The descriptor for the notification event.\r
+  @param Ppi                Pointer to the PPI in question.\r
+\r
+  @return Always success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SecurityPpiNotifyCallback (\r
+  IN EFI_PEI_SERVICES           **PeiServices,\r
+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,\r
+  IN VOID                       *Ppi\r
+  );\r
+\r
 #endif\r
index 27c4f52f1b153b7be20532fa03314a300c517a6c..12924bf720e37bd7ceef20a65fa0cbf26d46fb5e 100644 (file)
@@ -14,24 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "PeiMain.h"\r
 \r
-/**\r
-\r
-  Provide a callback for when the security PPI is installed.\r
-\r
-  @param PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
-  @param NotifyDescriptor   The descriptor for the notification event.\r
-  @param Ppi                Pointer to the PPI in question.\r
-\r
-  @return Always success\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SecurityPpiNotifyCallback (\r
-  IN EFI_PEI_SERVICES           **PeiServices,\r
-  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,\r
-  IN VOID                       *Ppi\r
-  );\r
 \r
 EFI_PEI_NOTIFY_DESCRIPTOR mNotifyList = {\r
    EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
index 020b94982db0e5b8fb0208e2bbf1ba666a8f4c06..0b925b3c7d6c1e583ebd82dc86249d751d058a4d 100644 (file)
@@ -13,113 +13,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 \r
-#include <PiDxe.h>\r
+#include "DxeCorePerformanceLibInternal.h"\r
 \r
-#include <Protocol/Performance.h>\r
-#include <Guid/PeiPerformanceHob.h>\r
-\r
-#include <Library/PerformanceLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/TimerLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-//\r
-// Interface declarations for Performance Protocol.\r
-//\r
-/**\r
-  Adds a record at the end of the performance measurement log\r
-  that records the start time of a performance measurement.\r
-\r
-  Adds a record to the end of the performance measurement log\r
-  that contains the Handle, Token, and Module.\r
-  The end time of the new record must be set to zero.\r
-  If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r
-  If TimeStamp is zero, the start time in the record is filled in with the value\r
-  read from the current time stamp.\r
-\r
-  @param  Handle                  Pointer to environment specific context used\r
-                                  to identify the component being measured.\r
-  @param  Token                   Pointer to a Null-terminated ASCII string\r
-                                  that identifies the component being measured.\r
-  @param  Module                  Pointer to a Null-terminated ASCII string\r
-                                  that identifies the module being measured.\r
-  @param  TimeStamp               64-bit time stamp.\r
-\r
-  @retval EFI_SUCCESS             The data was read correctly from the device.\r
-  @retval EFI_OUT_OF_RESOURCES    There are not enough resources to record the measurement.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-StartGauge (\r
-  IN CONST VOID   *Handle,  OPTIONAL\r
-  IN CONST CHAR8  *Token,   OPTIONAL\r
-  IN CONST CHAR8  *Module,  OPTIONAL\r
-  IN UINT64       TimeStamp\r
-  );\r
-\r
-/**\r
-  Searches the performance measurement log from the beginning of the log\r
-  for the first matching record that contains a zero end time and fills in a valid end time.\r
-\r
-  Searches the performance measurement log from the beginning of the log\r
-  for the first record that matches Handle, Token, and Module and has an end time value of zero.\r
-  If the record can not be found then return EFI_NOT_FOUND.\r
-  If the record is found and TimeStamp is not zero,\r
-  then the end time in the record is filled in with the value specified by TimeStamp.\r
-  If the record is found and TimeStamp is zero, then the end time in the matching record\r
-  is filled in with the current time stamp value.\r
-\r
-  @param  Handle                  Pointer to environment specific context used\r
-                                  to identify the component being measured.\r
-  @param  Token                   Pointer to a Null-terminated ASCII string\r
-                                  that identifies the component being measured.\r
-  @param  Module                  Pointer to a Null-terminated ASCII string\r
-                                  that identifies the module being measured.\r
-  @param  TimeStamp               64-bit time stamp.\r
-\r
-  @retval EFI_SUCCESS             The end of  the measurement was recorded.\r
-  @retval EFI_NOT_FOUND           The specified measurement record could not be found.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EndGauge (\r
-  IN CONST VOID   *Handle,  OPTIONAL\r
-  IN CONST CHAR8  *Token,   OPTIONAL\r
-  IN CONST CHAR8  *Module,  OPTIONAL\r
-  IN UINT64       TimeStamp\r
-  );\r
-\r
-/**\r
-  Retrieves a previously logged performance measurement.\r
-\r
-  Retrieves the performance log entry from the performance log specified by LogEntryKey.\r
-  If it stands for a valid entry, then EFI_SUCCESS is returned and\r
-  GaugeDataEntry stores the pointer to that entry.\r
-\r
-  @param  LogEntryKey             The key for the previous performance measurement log entry.\r
-                                  If 0, then the first performance measurement log entry is retrieved.\r
-  @param  GaugeDataEntry          The indirect pointer to the gauge data entry specified by LogEntryKey\r
-                                  if the retrieval is successful.\r
-\r
-  @retval EFI_SUCCESS             The GuageDataEntry is successfuly found based on LogEntryKey.\r
-  @retval EFI_NOT_FOUND           The LogEntryKey is the last entry (equals to the total entry number).\r
-  @retval EFI_INVALIDE_PARAMETER  The LogEntryKey is not a valid entry (greater than the total entry number).\r
-  @retval EFI_INVALIDE_PARAMETER  GaugeDataEntry is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-GetGauge (\r
-  IN  UINTN               LogEntryKey,\r
-  OUT GAUGE_DATA_ENTRY    **GaugeDataEntry\r
-  );\r
 \r
 //\r
 // Definition for global variables.\r
@@ -134,7 +29,6 @@ PERFORMANCE_PROTOCOL mPerformanceInterface = {
   GetGauge\r
   };\r
 \r
-\r
 /**\r
   Searches in the gauge array with keyword Handle, Token and Module.\r
 \r
index bbd9f31bd0dc9b1d336edb2833705749795dde8b..61fefaafcaa56739488abb43bb196470c3304796 100644 (file)
@@ -35,6 +35,7 @@
 \r
 [Sources.common]\r
   DxeCorePerformanceLib.c\r
+  DxeCorePerformanceLibInternal.h\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h
new file mode 100644 (file)
index 0000000..1c02959
--- /dev/null
@@ -0,0 +1,128 @@
+/** @file\r
+  Module functions' declarations are included here.\r
+\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+  \r
+#ifndef _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_\r
+#define _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_\r
+\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Protocol/Performance.h>\r
+#include <Guid/PeiPerformanceHob.h>\r
+\r
+#include <Library/PerformanceLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/HobLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/TimerLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
+//\r
+// Interface declarations for Performance Protocol.\r
+//\r
+/**\r
+  Adds a record at the end of the performance measurement log\r
+  that records the start time of a performance measurement.\r
+\r
+  Adds a record to the end of the performance measurement log\r
+  that contains the Handle, Token, and Module.\r
+  The end time of the new record must be set to zero.\r
+  If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r
+  If TimeStamp is zero, the start time in the record is filled in with the value\r
+  read from the current time stamp.\r
+\r
+  @param  Handle                  Pointer to environment specific context used\r
+                                  to identify the component being measured.\r
+  @param  Token                   Pointer to a Null-terminated ASCII string\r
+                                  that identifies the component being measured.\r
+  @param  Module                  Pointer to a Null-terminated ASCII string\r
+                                  that identifies the module being measured.\r
+  @param  TimeStamp               64-bit time stamp.\r
+\r
+  @retval EFI_SUCCESS             The data was read correctly from the device.\r
+  @retval EFI_OUT_OF_RESOURCES    There are not enough resources to record the measurement.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+StartGauge (\r
+  IN CONST VOID   *Handle,  OPTIONAL\r
+  IN CONST CHAR8  *Token,   OPTIONAL\r
+  IN CONST CHAR8  *Module,  OPTIONAL\r
+  IN UINT64       TimeStamp\r
+  );\r
+\r
+/**\r
+  Searches the performance measurement log from the beginning of the log\r
+  for the first matching record that contains a zero end time and fills in a valid end time.\r
+\r
+  Searches the performance measurement log from the beginning of the log\r
+  for the first record that matches Handle, Token, and Module and has an end time value of zero.\r
+  If the record can not be found then return EFI_NOT_FOUND.\r
+  If the record is found and TimeStamp is not zero,\r
+  then the end time in the record is filled in with the value specified by TimeStamp.\r
+  If the record is found and TimeStamp is zero, then the end time in the matching record\r
+  is filled in with the current time stamp value.\r
+\r
+  @param  Handle                  Pointer to environment specific context used\r
+                                  to identify the component being measured.\r
+  @param  Token                   Pointer to a Null-terminated ASCII string\r
+                                  that identifies the component being measured.\r
+  @param  Module                  Pointer to a Null-terminated ASCII string\r
+                                  that identifies the module being measured.\r
+  @param  TimeStamp               64-bit time stamp.\r
+\r
+  @retval EFI_SUCCESS             The end of  the measurement was recorded.\r
+  @retval EFI_NOT_FOUND           The specified measurement record could not be found.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EndGauge (\r
+  IN CONST VOID   *Handle,  OPTIONAL\r
+  IN CONST CHAR8  *Token,   OPTIONAL\r
+  IN CONST CHAR8  *Module,  OPTIONAL\r
+  IN UINT64       TimeStamp\r
+  );\r
+\r
+/**\r
+  Retrieves a previously logged performance measurement.\r
+\r
+  Retrieves the performance log entry from the performance log specified by LogEntryKey.\r
+  If it stands for a valid entry, then EFI_SUCCESS is returned and\r
+  GaugeDataEntry stores the pointer to that entry.\r
+\r
+  @param  LogEntryKey             The key for the previous performance measurement log entry.\r
+                                  If 0, then the first performance measurement log entry is retrieved.\r
+  @param  GaugeDataEntry          The indirect pointer to the gauge data entry specified by LogEntryKey\r
+                                  if the retrieval is successful.\r
+\r
+  @retval EFI_SUCCESS             The GuageDataEntry is successfuly found based on LogEntryKey.\r
+  @retval EFI_NOT_FOUND           The LogEntryKey is the last entry (equals to the total entry number).\r
+  @retval EFI_INVALIDE_PARAMETER  The LogEntryKey is not a valid entry (greater than the total entry number).\r
+  @retval EFI_INVALIDE_PARAMETER  GaugeDataEntry is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetGauge (\r
+  IN  UINTN               LogEntryKey,\r
+  OUT GAUGE_DATA_ENTRY    **GaugeDataEntry\r
+  );\r
+\r
+\r
+#endif\r
index e5d11b5c337bb323c24851814db930d695b47b57..a5c3f1567b8e4dbb06198d87f39693d12c9f63d5 100644 (file)
@@ -21,6 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;\r
 EFI_HII_STRING_PROTOCOL   *gIfrLibHiiString;\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mIfrVendorGuid = EFI_IFR_TIANO_GUID;\r
 \r
 /**\r
   ExtendedIfrSupportLib's constructor. It locates the required protocol:\r
@@ -52,9 +53,6 @@ ExtendedIfrSupportLibConstructor (
 }\r
 \r
 \r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mIfrVendorGuid = EFI_IFR_TIANO_GUID;\r
-\r
 /**\r
   Extract formset class for given HII handle.\r
 \r
index 15bd2a1950969dd88e3aeb370189c5a30f51c886..7c6f0faa37d0192d279fd37379675e83e2849f7d 100644 (file)
@@ -19,6 +19,11 @@ CONST EFI_FORM_BROWSER2_PROTOCOL      *mFormBrowser2     = NULL;
 CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *mIfrSupportLibHiiConfigRouting = NULL;\r
 GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mIfrSupportLibHexStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\r
 \r
+//\r
+// Fake <ConfigHdr>\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0";\r
+\r
 /**\r
   This function locate FormBrowser2 protocols for later usage.\r
 \r
@@ -50,11 +55,6 @@ LocateFormBrowser2Protocols (
   return EFI_SUCCESS;\r
 }\r
 \r
-//\r
-// Fake <ConfigHdr>\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0";\r
-\r
 /**\r
   Draw a dialog and return the selected key.\r
 \r
index ada795b99c1fd1007610d1ccf1ebba06062c41b4..f925daa975bd935c7b4e2c622f15f9620663a3d6 100644 (file)
@@ -14,82 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "GraphicsConsole.h"\r
 \r
-/**\r
-  Gets Graphics Console devcie's foreground color and background color.\r
-\r
-  @param  This                  Protocol instance pointer.\r
-  @param  Foreground            Returned text foreground color.\r
-  @param  Background            Returned text background color.\r
-\r
-  @retval EFI_SUCCESS           It returned always.\r
-\r
-**/\r
-EFI_STATUS\r
-GetTextColors (\r
-  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
-  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Foreground,\r
-  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Background\r
-  );\r
-\r
-/**\r
-  Draw Unicode string on the Graphice Console device's screen.\r
-\r
-  @param  This                  Protocol instance pointer.\r
-  @param  UnicodeWeight         One Unicode string to be displayed.\r
-  @param  Count                 The count of Unicode string.\r
-\r
-  @retval EFI_OUT_OF_RESOURCES  If no memory resource to use.\r
-  @retval EFI_UNSUPPORTED       If no Graphics Output protocol and UGA Draw\r
-                                protocol exist.\r
-  @retval EFI_SUCCESS           Drawing Unicode string implemented successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-DrawUnicodeWeightAtCursorN (\r
-  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
-  IN  CHAR16                           *UnicodeWeight,\r
-  IN  UINTN                            Count\r
-  );\r
-\r
-/**\r
-  Erase the cursor on the screen.\r
-\r
-  @param  This                  Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           The cursor is erased successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EraseCursor (\r
-  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This\r
-  );\r
-\r
-/**\r
-  Check if the current specific mode supported the user defined resolution\r
-  for the Graphice Console devcie based on Graphics Output Protocol.\r
-\r
-  If yes, set the graphic devcice's current mode to this specific mode.\r
-  \r
-  @param  GraphicsOutput        Graphics Output Protocol instance pointer.\r
-  @param  HorizontalResolution  User defined horizontal resolution\r
-  @param  VerticalResolution    User defined vertical resolution.\r
-  @param  CurrentModeNumber     Current specific mode to be check.\r
-\r
-  @retval EFI_SUCCESS       The mode is supported.\r
-  @retval EFI_UNSUPPORTED   The specific mode is out of range of graphics \r
-                            devcie supported.\r
-  @retval other             The specific mode does not support user defined \r
-                            resolution or failed to set the current mode to the \r
-                            specific mode on graphics device.\r
-\r
-**/\r
-EFI_STATUS\r
-CheckModeSupported (\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL  *GraphicsOutput,\r
-  IN  UINT32  HorizontalResolution,\r
-  IN  UINT32  VerticalResolution,\r
-  OUT UINT32  *CurrentModeNumber\r
-  );\r
 \r
 //\r
 // Graphics Console Devcie Private Data template\r
@@ -175,6 +99,83 @@ EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding = {
   NULL\r
 };\r
 \r
+/**\r
+  Gets Graphics Console devcie's foreground color and background color.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Foreground            Returned text foreground color.\r
+  @param  Background            Returned text background color.\r
+\r
+  @retval EFI_SUCCESS           It returned always.\r
+\r
+**/\r
+EFI_STATUS\r
+GetTextColors (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Foreground,\r
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Background\r
+  );\r
+\r
+/**\r
+  Draw Unicode string on the Graphice Console device's screen.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  UnicodeWeight         One Unicode string to be displayed.\r
+  @param  Count                 The count of Unicode string.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES  If no memory resource to use.\r
+  @retval EFI_UNSUPPORTED       If no Graphics Output protocol and UGA Draw\r
+                                protocol exist.\r
+  @retval EFI_SUCCESS           Drawing Unicode string implemented successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+DrawUnicodeWeightAtCursorN (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
+  IN  CHAR16                           *UnicodeWeight,\r
+  IN  UINTN                            Count\r
+  );\r
+\r
+/**\r
+  Erase the cursor on the screen.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS           The cursor is erased successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EraseCursor (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  Check if the current specific mode supported the user defined resolution\r
+  for the Graphice Console devcie based on Graphics Output Protocol.\r
+\r
+  If yes, set the graphic devcice's current mode to this specific mode.\r
+  \r
+  @param  GraphicsOutput        Graphics Output Protocol instance pointer.\r
+  @param  HorizontalResolution  User defined horizontal resolution\r
+  @param  VerticalResolution    User defined vertical resolution.\r
+  @param  CurrentModeNumber     Current specific mode to be check.\r
+\r
+  @retval EFI_SUCCESS       The mode is supported.\r
+  @retval EFI_UNSUPPORTED   The specific mode is out of range of graphics \r
+                            devcie supported.\r
+  @retval other             The specific mode does not support user defined \r
+                            resolution or failed to set the current mode to the \r
+                            specific mode on graphics device.\r
+\r
+**/\r
+EFI_STATUS\r
+CheckModeSupported (\r
+  EFI_GRAPHICS_OUTPUT_PROTOCOL  *GraphicsOutput,\r
+  IN  UINT32  HorizontalResolution,\r
+  IN  UINT32  VerticalResolution,\r
+  OUT UINT32  *CurrentModeNumber\r
+  );\r
+\r
 \r
 /**\r
   Test to see if Graphics Console could be supported on the Controller.\r
index 8c6b1bd5f65a4117ec8e9e3b5a87fe25dd2e3163..a8e4a1a0b21ea6ee271ef1fefd44072526d0b065 100644 (file)
@@ -16,20 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Terminal.h"\r
 \r
-/**\r
-  Free notify functions list.\r
-\r
-  @param  ListHead               The list head\r
-\r
-  @retval EFI_SUCCESS            Free the notify list successfully.\r
-  @retval EFI_INVALID_PARAMETER  ListHead is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-TerminalFreeNotifyList (\r
-  IN OUT LIST_ENTRY           *ListHead\r
-  );\r
-\r
 //\r
 // Globals\r
 //\r
@@ -118,6 +104,20 @@ TERMINAL_DEV  mTerminalDevTemplate = {
 };\r
 \r
 \r
+/**\r
+  Free notify functions list.\r
+\r
+  @param  ListHead               The list head\r
+\r
+  @retval EFI_SUCCESS            Free the notify list successfully.\r
+  @retval EFI_INVALID_PARAMETER  ListHead is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+TerminalFreeNotifyList (\r
+  IN OUT LIST_ENTRY           *ListHead\r
+  );\r
+\r
 /**\r
   Test to see if this driver supports Controller. \r
 \r
index b4b078cb5787838f52ffb16693ef15669e9c1cdb..7b91ae4b6349788da511e6090fa317dba0de1b84 100644 (file)
@@ -35,6 +35,21 @@ typedef struct {
   VOID (*RegisteredCallback) ();\r
 } IVT_ENTRY;\r
 \r
+IVT_ENTRY IvtEntryTable[NUM_IVT_ENTRIES];\r
+\r
+//\r
+// IPF context record is overallocated by 512 bytes to guarantee a 512 byte alignment exists\r
+// within the buffer and still have a large enough buffer to hold a whole IPF context record.\r
+//\r
+UINT8     IpfContextBuf[sizeof (EFI_SYSTEM_CONTEXT_IPF) + 512];\r
+\r
+//\r
+// The PatchSaveBuffer is used to store the original bundles from the IVT where it is patched\r
+// with the common handler.\r
+//\r
+UINT8     PatchSaveBuffer[0x400];\r
+UINTN     ExternalInterruptCount;\r
+\r
 /**\r
   This is the worker function that uninstalls and removes all handlers.\r
 \r
@@ -117,20 +132,6 @@ GetHandlerEntryPoint (
   VOID                      **EntryPoint\r
   );\r
 \r
-IVT_ENTRY IvtEntryTable[NUM_IVT_ENTRIES];\r
-\r
-//\r
-// IPF context record is overallocated by 512 bytes to guarantee a 512 byte alignment exists\r
-// within the buffer and still have a large enough buffer to hold a whole IPF context record.\r
-//\r
-UINT8     IpfContextBuf[sizeof (EFI_SYSTEM_CONTEXT_IPF) + 512];\r
-\r
-//\r
-// The PatchSaveBuffer is used to store the original bundles from the IVT where it is patched\r
-// with the common handler.\r
-//\r
-UINT8     PatchSaveBuffer[0x400];\r
-UINTN     ExternalInterruptCount;\r
 \r
 /**\r
   IPF specific DebugSupport driver initialization. \r
index 722c800378c99936fc11a6e08050264e883bdf0b..0d899c9260571988c51e51a183e587ea38249603 100644 (file)
 \r
 #include <IndustryStandard/Pci.h>\r
 \r
-/**\r
-   Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.\r
-\r
-   @param Address   PCI address with\r
-                    EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.\r
-\r
-   @return The PCI address with PCI_LIB_ADDRESS format.\r
-\r
-**/\r
-UINTN\r
-PciCfgAddressConvert (\r
-  EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *Address\r
-  )\r
-{\r
-  if (Address->ExtendedRegister == 0) {\r
-    return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->Register);\r
-  }\r
-\r
-  return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);\r
-}\r
-\r
 /**\r
   Reads from a given location in the PCI configuration space.\r
 \r
@@ -184,6 +163,29 @@ EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {
   &gPciCfg2Ppi\r
 };\r
 \r
+\r
+/**\r
+   Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.\r
+\r
+   @param Address   PCI address with\r
+                    EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.\r
+\r
+   @return The PCI address with PCI_LIB_ADDRESS format.\r
+\r
+**/\r
+UINTN\r
+PciCfgAddressConvert (\r
+  EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *Address\r
+  )\r
+{\r
+  if (Address->ExtendedRegister == 0) {\r
+    return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->Register);\r
+  }\r
+\r
+  return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);\r
+}\r
+\r
+\r
 /**\r
   Reads from a given location in the PCI configuration space.\r
 \r
index fad0f7f4893475bcfc146f6c2c047579daf85554..cc9652ee1767cb18c8216822bb11e19e4e5e3c08 100644 (file)
@@ -117,6 +117,7 @@ SCREEN_OPERATION_T0_CONTROL_FLAG  gScreenOperationToControlFlag[] = {
 };\r
 \r
 BOOLEAN  mInputError;\r
+BOOLEAN GetLineByWidthFinished = FALSE;\r
 \r
 \r
 /**\r
@@ -1075,9 +1076,6 @@ GetWidth (
   return Width;\r
 }\r
 \r
-\r
-BOOLEAN GetLineByWidthFinished = FALSE;\r
-\r
 /**\r
   Will copy LineWidth amount of a string in the OutputString buffer and return the\r
   number of CHAR16 characters that were copied into the OutputString buffer.\r
index bc4e6eb38d0d29a94cc365391bd0ede4e5ef3c5f..694de8da599d5a035dc4650c540e308f90112339 100644 (file)
@@ -21,6 +21,25 @@ VARIABLE_MODULE_GLOBAL  *mVariableModuleGlobal;
 EFI_EVENT   mVirtualAddressChangeEvent = NULL;\r
 EFI_HANDLE  mHandle = NULL;\r
 \r
+//\r
+// The current Hii implementation accesses this variable a larg # of times on every boot.\r
+// Other common variables are only accessed a single time. This is why this cache algorithm\r
+// only targets a single variable. Probably to get an performance improvement out of\r
+// a Cache you would need a cache that improves the search performance for a variable.\r
+//\r
+VARIABLE_CACHE_ENTRY mVariableCache[] = {\r
+  {\r
+    &gEfiGlobalVariableGuid,\r
+    L"Lang",\r
+    0x00000000,\r
+    0x00,\r
+    NULL\r
+  }\r
+};\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED VARIABLE_INFO_ENTRY *gVariableInfo = NULL;\r
+\r
+\r
 \r
 //\r
 // This is a temperary function which will be removed\r
@@ -53,9 +72,6 @@ ReleaseLockOnlyAtBootTime (
 }\r
 \r
 \r
-GLOBAL_REMOVE_IF_UNREFERENCED VARIABLE_INFO_ENTRY *gVariableInfo = NULL;\r
-\r
-\r
 /**\r
   Routine used to track statistical information about variable usage. \r
   The data is stored in the EFI system table so it can be accessed later.\r
@@ -774,23 +790,6 @@ Returns:
 }\r
 \r
 \r
-//\r
-// The current Hii implementation accesses this variable a larg # of times on every boot.\r
-// Other common variables are only accessed a single time. This is why this cache algorithm\r
-// only targets a single variable. Probably to get an performance improvement out of\r
-// a Cache you would need a cache that improves the search performance for a variable.\r
-//\r
-VARIABLE_CACHE_ENTRY mVariableCache[] = {\r
-  {\r
-    &gEfiGlobalVariableGuid,\r
-    L"Lang",\r
-    0x00000000,\r
-    0x00,\r
-    NULL\r
-  }\r
-};\r
-\r
-\r
 /**\r
   Update the Cache with Variable information. These are the same \r
   arguments as the EFI Variable services.\r