]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Fixed one bug in ConPlatform.c, add NULL judgment.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 29 Sep 2007 02:57:38 +0000 (02:57 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 29 Sep 2007 02:57:38 +0000 (02:57 +0000)
2. Fixed one type in UgaDraw.h.

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

MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
MdePkg/Include/Protocol/UgaDraw.h

index 61ed14b4e7d2e8fe07ed3bd6540e023f5f8113ad..e4f7e18e99cdb2398619065ba7845e4e6bbedee5 100644 (file)
@@ -41,9 +41,9 @@ EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextOutDriverBinding = {
 /**\r
   The user Entry Point for module ConPlatform. The user code starts with this function.\r
 \r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
+  @param[in] ImageHandle    The firmware allocated handle for the EFI image.\r
   @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
+\r
   @retval EFI_SUCCESS       The entry point is executed successfully.\r
   @retval other             Some error occurs when executing this entry point.\r
 \r
@@ -739,8 +739,7 @@ Returns:
 --*/\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath1;\r
-  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath2;\r
+  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePathInst;\r
   UINTN                     Size;\r
 \r
@@ -753,7 +752,7 @@ Returns:
   //\r
   // if performing Delete operation, the NewDevicePath must not be NULL.\r
   //\r
-  TempDevicePath1 = NULL;\r
+  TempDevicePath  = NULL;\r
 \r
   DevicePath      = Multi;\r
   DevicePathInst  = GetNextDevicePathInstance (&DevicePath, &Size);\r
@@ -769,14 +768,10 @@ Returns:
       }\r
     } else {\r
       if (Delete) {\r
-        TempDevicePath2 = AppendDevicePathInstance (\r
-                            TempDevicePath1,\r
+        TempDevicePath = AppendDevicePathInstance (\r
+                            NULL,\r
                             DevicePathInst\r
                             );\r
-        if (TempDevicePath1 != NULL) {\r
-          FreePool (TempDevicePath1);\r
-        }\r
-        TempDevicePath1 = TempDevicePath2;\r
       }\r
     }\r
 \r
@@ -785,7 +780,7 @@ Returns:
   }\r
 \r
   if (Delete) {\r
-    *NewDevicePath = TempDevicePath1;\r
+    *NewDevicePath = TempDevicePath;\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -878,15 +873,17 @@ Returns:
     return Status;\r
   }\r
 \r
-  Status = gRT->SetVariable (\r
-                  VariableName,\r
-                  &gEfiGlobalVariableGuid,\r
-                  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-                  GetDevicePathSize (NewVariableDevicePath),\r
-                  NewVariableDevicePath\r
-                  );\r
+  if (NewVariableDevicePath != NULL) {\r
+    Status = gRT->SetVariable (\r
+                    VariableName,\r
+                    &gEfiGlobalVariableGuid,\r
+                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+                    GetDevicePathSize (NewVariableDevicePath),\r
+                    NewVariableDevicePath\r
+                    );\r
 \r
-  FreePool (NewVariableDevicePath);\r
+    FreePool (NewVariableDevicePath);\r
+  }\r
 \r
   return Status;\r
 }\r
index b450cdc285e19c2bfc03c2280a1dac5db77a7225..3532f8e2884b7f9e1d4aced2d03a494424b1c135 100644 (file)
@@ -3,14 +3,14 @@
 \r
   Abstraction of a very simple graphics device.\r
 \r
-  Copyright (c) 2006, 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
+  Copyright (c) 2006, 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
+  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
@@ -50,7 +50,7 @@ EFI_STATUS
 ;\r
 \r
 /**\r
-  Return the current video mode information.\r
+  Set the current video mode information.\r
 \r
   @param  This                 Protocol instance pointer.\r
   @param  HorizontalResolution Current video horizontal resolution in pixels\r
@@ -98,33 +98,33 @@ typedef enum {
 \r
     The following table defines actions for BltOperations:\r
 \r
-    <B>EfiUgaVideoFill</B> - Write data from the  BltBuffer pixel (SourceX, SourceY) \r
-      directly to every pixel of the video display rectangle \r
-      (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
+    <B>EfiUgaVideoFill</B> - Write data from the  BltBuffer pixel (SourceX, SourceY)\r
+      directly to every pixel of the video display rectangle\r
+      (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r
       Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
 \r
-    <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle \r
-      (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in \r
-      the BltBuffer rectangle (DestinationX, DestinationY ) \r
-      (DestinationX + Width, DestinationY + Height). If DestinationX or \r
-      DestinationY is not zero then Delta must be set to the length in bytes \r
+    <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle\r
+      (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in\r
+      the BltBuffer rectangle (DestinationX, DestinationY )\r
+      (DestinationX + Width, DestinationY + Height). If DestinationX or\r
+      DestinationY is not zero then Delta must be set to the length in bytes\r
       of a row in the BltBuffer.\r
 \r
-    <B>EfiUgaBltBufferToVideo</B> - Write data from the  BltBuffer rectangle \r
-      (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the \r
-      video display rectangle (DestinationX, DestinationY) \r
-      (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is \r
-      not zero then Delta must be set to the length in bytes of a row in the \r
+    <B>EfiUgaBltBufferToVideo</B> - Write data from the  BltBuffer rectangle\r
+      (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the\r
+      video display rectangle (DestinationX, DestinationY)\r
+      (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is\r
+      not zero then Delta must be set to the length in bytes of a row in the\r
       BltBuffer.\r
 \r
     <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)\r
-     (SourceX + Width, SourceY + Height) .to the video display rectangle \r
-     (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
+     (SourceX + Width, SourceY + Height) .to the video display rectangle\r
+     (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r
      The BltBuffer and Delta  are not used in this mode.\r
 \r
 \r
     @param[in] This          - Protocol instance pointer.\r
-    @param[in] BltBuffer     - Buffer containing data to blit into video buffer. This \r
+    @param[in] BltBuffer     - Buffer containing data to blit into video buffer. This\r
                                buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r
     @param[in] BltOperation  - Operation to perform on BlitBuffer and video memory\r
     @param[in] SourceX       - X coordinate of source for the BltBuffer.\r
@@ -134,7 +134,7 @@ typedef enum {
     @param[in] Width         - Width of rectangle in BltBuffer in pixels.\r
     @param[in] Height        - Hight of rectangle in BltBuffer in pixels.\r
     @param[in] Delta         - OPTIONAL\r
-  \r
+\r
     @retval EFI_SUCCESS           - The Blt operation completed.\r
     @retval EFI_INVALID_PARAMETER - BltOperation is not valid.\r
     @retval EFI_DEVICE_ERROR      - A hardware error occured writting to the video buffer.\r