]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Change the library global variable to add library name prefix to avoid potential...
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 15 Jan 2014 07:46:38 +0000 (07:46 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 15 Jan 2014 07:46:38 +0000 (07:46 +0000)
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15117 6f19259b-4bc3-4df7-8a09-765794883524

SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c

index 54aaa71d750b55028572b687c8f4db13744410b4..b3dbc9367889e9715bf3970f81011617a07c47ab 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Debug Port Library implementation based on usb debug port.\r
 \r
-  Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
   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
@@ -58,7 +58,7 @@ typedef struct _USB_DEBUG_PORT_DESCRIPTOR {
   UINT8          DebugOutEndpoint;\r
 }USB_DEBUG_PORT_DESCRIPTOR;\r
 \r
-USB_DEVICE_REQUEST mGetDebugDescriptor = {\r
+USB_DEVICE_REQUEST mDebugCommunicationLibUsbGetDebugDescriptor = {\r
   0x80,\r
   USB_REQ_GET_DESCRIPTOR,\r
   (UINT16)(0x0A << 8),\r
@@ -66,7 +66,7 @@ USB_DEVICE_REQUEST mGetDebugDescriptor = {
   sizeof(USB_DEBUG_PORT_DESCRIPTOR)\r
   };\r
 \r
-USB_DEVICE_REQUEST mSetDebugFeature = {\r
+USB_DEVICE_REQUEST mDebugCommunicationLibUsbSetDebugFeature = {\r
   0x0,\r
   USB_REQ_SET_FEATURE,\r
   (UINT16)(0x06),\r
@@ -74,7 +74,7 @@ USB_DEVICE_REQUEST mSetDebugFeature = {
   0x0\r
   };\r
 \r
-USB_DEVICE_REQUEST mSetDebugAddress = {\r
+USB_DEVICE_REQUEST mDebugCommunicationLibUsbSetDebugAddress = {\r
   0x0,\r
   USB_REQ_SET_ADDRESS,\r
   (UINT16)(0x7F),\r
@@ -159,7 +159,7 @@ typedef struct _USB_DEBUG_PORT_HANDLE{
 //\r
 // The global variable which can be used after memory is ready.\r
 //\r
-USB_DEBUG_PORT_HANDLE     mUsbDebugPortHandle;\r
+USB_DEBUG_PORT_HANDLE     mDebugCommunicationLibUsbDebugPortHandle;\r
 \r
 /**\r
   Check if the timer is timeout.\r
@@ -751,7 +751,7 @@ InitializeUsbDebugHardware (
     //\r
     // set usb debug device address as 0x7F.\r
     //\r
-    Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mSetDebugAddress, 0x0, 0x0, NULL, NULL);\r
+    Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mDebugCommunicationLibUsbSetDebugAddress, 0x0, 0x0, NULL, NULL);\r
     if (RETURN_ERROR(Status)) {\r
       //\r
       // The device can not work well.\r
@@ -768,7 +768,7 @@ InitializeUsbDebugHardware (
     //\r
     // Get debug descriptor.\r
     //\r
-    Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mGetDebugDescriptor, 0x7F, 0x0, (UINT8*)&UsbDebugPortDescriptor, &Length);\r
+    Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mDebugCommunicationLibUsbGetDebugDescriptor, 0x7F, 0x0, (UINT8*)&UsbDebugPortDescriptor, &Length);\r
     if (RETURN_ERROR(Status)) {\r
       //\r
       // The device is not a usb debug device.\r
@@ -785,7 +785,7 @@ InitializeUsbDebugHardware (
     //\r
     // enable the usb debug feature.\r
     //\r
-    Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mSetDebugFeature, 0x7F, 0x0, NULL, NULL);\r
+    Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mDebugCommunicationLibUsbSetDebugFeature, 0x7F, 0x0, NULL, NULL);\r
     if (RETURN_ERROR(Status)) {\r
       //\r
       // The device can not work well.\r
@@ -856,7 +856,7 @@ DebugPortReadBuffer (
   // Use global variable to store handle value.\r
   //\r
   if (Handle == NULL) {\r
-    UsbDebugPortHandle = &mUsbDebugPortHandle;\r
+    UsbDebugPortHandle = &mDebugCommunicationLibUsbDebugPortHandle;\r
   } else {\r
     UsbDebugPortHandle = (USB_DEBUG_PORT_HANDLE *)Handle;\r
   }\r
@@ -1028,7 +1028,7 @@ DebugPortWriteBuffer (
   // Use global variable to store handle value.\r
   //\r
   if (Handle == NULL) {\r
-    UsbDebugPortHandle = &mUsbDebugPortHandle;\r
+    UsbDebugPortHandle = &mDebugCommunicationLibUsbDebugPortHandle;\r
   } else {\r
     UsbDebugPortHandle = (USB_DEBUG_PORT_HANDLE *)Handle;\r
   }\r
@@ -1100,7 +1100,7 @@ DebugPortPollBuffer (
   // Use global variable to store handle value.\r
   //\r
   if (Handle == NULL) {\r
-    UsbDebugPortHandle = &mUsbDebugPortHandle;\r
+    UsbDebugPortHandle = &mDebugCommunicationLibUsbDebugPortHandle;\r
   } else {\r
     UsbDebugPortHandle = (USB_DEBUG_PORT_HANDLE *)Handle;\r
   }\r
@@ -1210,7 +1210,8 @@ DebugPortInitialize (
   USB_DEBUG_PORT_HANDLE     *UsbDebugPortHandle;\r
   UINT64                    TimerStartValue;\r
   UINT64                    TimerEndValue;\r
-\r  //\r
+\r
+  //\r
   // Validate the PCD PcdDebugPortHandleBufferSize value \r
   //\r
   ASSERT (PcdGet16 (PcdDebugPortHandleBufferSize) == sizeof (USB_DEBUG_PORT_HANDLE));\r
@@ -1284,9 +1285,9 @@ Exit:
   if (Function != NULL) {\r
     Function (Context, &Handle);\r
   } else {\r
-    CopyMem(&mUsbDebugPortHandle, &Handle, sizeof (USB_DEBUG_PORT_HANDLE));\r
+    CopyMem(&mDebugCommunicationLibUsbDebugPortHandle, &Handle, sizeof (USB_DEBUG_PORT_HANDLE));\r
   }\r
 \r
-  return (DEBUG_PORT_HANDLE)(UINTN)&mUsbDebugPortHandle;\r
+  return (DEBUG_PORT_HANDLE)(UINTN)&mDebugCommunicationLibUsbDebugPortHandle;\r
 }\r
 \r