]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkNt32Pkg/Dxe/WinNtThunk/Bus/Uga/WinNtUgaScreen.c
Add some definitions for efi event in Uefi/UefiSpec.h to follow spec.
[mirror_edk2.git] / EdkNt32Pkg / Dxe / WinNtThunk / Bus / Uga / WinNtUgaScreen.c
index ed35a01c32be6af723d73fda5978f1aa79b7d887..ebaf0b3a8008915b205b983ce3303602eef6a509 100644 (file)
@@ -1,22 +1,22 @@
 /*++\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
-                                                                                          \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
+Copyright (c) 2006 - 2007, 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
 Module Name:\r
-  \r
+\r
     WinNtUgaScreen.c\r
 \r
 Abstract:\r
 \r
-  This file produces the graphics abstration of UGA. It is called by \r
-  WinNtUgaDriver.c file which deals with the EFI 1.1 driver model. \r
+  This file produces the graphics abstration of UGA. It is called by\r
+  WinNtUgaDriver.c file which deals with the EFI 1.1 driver model.\r
   This file just does graphics.\r
 \r
 --*/\r
@@ -72,7 +72,7 @@ WinNtUgaGetMode (
 \r
   Returns:\r
     EFI_SUCCESS     - Mode information returned.\r
-    EFI_NOT_STARTED - Video display is not initialized. Call SetMode () \r
+    EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()\r
     EFI_INVALID_PARAMETER - One of the input args was NULL.\r
 \r
 --*/\r
@@ -123,7 +123,7 @@ WinNtUgaSetMode (
 \r
   Returns:\r
     EFI_SUCCESS     - Mode information returned.\r
-    EFI_NOT_STARTED - Video display is not initialized. Call SetMode () \r
+    EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()\r
     EFI_INVALID_PARAMETER - One of the input args was NULL.\r
 \r
 --*/\r
@@ -224,17 +224,13 @@ WinNtUgaSetMode (
 \r
   }\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (EFI_UGA_PIXEL) * HorizontalResolution,\r
-                  &NewFillLine\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  NewFillLine = AllocatePool (sizeof (EFI_UGA_PIXEL) * HorizontalResolution);\r
+  if (NewFillLine == NULL) {\r
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
   if (Private->FillLine != NULL) {\r
-    gBS->FreePool (Private->FillLine);\r
+    FreePool (Private->FillLine);\r
   }\r
 \r
   Private->FillLine             = NewFillLine;\r
@@ -281,19 +277,19 @@ WinNtUgaBlt (
   Routine Description:\r
     Blt pixels from the rectangle (Width X Height) formed by the BltBuffer\r
     onto the graphics screen starting a location (X, Y). (0, 0) is defined as\r
-    the upper left hand side of the screen. (X, Y) can be outside of the \r
-    current screen geometry and the BltBuffer will be cliped when it is \r
-    displayed. X and Y can be negative or positive. If Width or Height is \r
+    the upper left hand side of the screen. (X, Y) can be outside of the\r
+    current screen geometry and the BltBuffer will be cliped when it is\r
+    displayed. X and Y can be negative or positive. If Width or Height is\r
     bigger than the current video screen the image will be clipped.\r
 \r
   Arguments:\r
     This          - Protocol instance pointer.\r
-    X             - X location on graphics screen. \r
+    X             - X location on graphics screen.\r
     Y             - Y location on the graphics screen.\r
     Width         - Width of BltBuffer.\r
     Height        - Hight of BltBuffer\r
     BltOperation  - Operation to perform on BltBuffer and video memory\r
-    BltBuffer     - Buffer containing data to blt into video buffer. This \r
+    BltBuffer     - Buffer containing data to blt into video buffer. This\r
                     buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r
     SourceX       - If the BltOperation is a EfiCopyBlt this is the source\r
                     of the copy. For other BLT operations this argument is not\r
@@ -301,11 +297,11 @@ WinNtUgaBlt (
     SourceX       - If the BltOperation is a EfiCopyBlt this is the source\r
                     of the copy. For other BLT operations this argument is not\r
                     used.\r
-      \r
+\r
   Returns:\r
     EFI_SUCCESS           - The palette is updated with PaletteArray.\r
     EFI_INVALID_PARAMETER - BltOperation is not valid.\r
-    EFI_DEVICE_ERROR      - A hardware error occured writting to the video \r
+    EFI_DEVICE_ERROR      - A hardware error occured writting to the video\r
                              buffer.\r
 \r
 --*/\r
@@ -366,7 +362,7 @@ WinNtUgaBlt (
     // We would not want a timer based event (Cursor, ...) to come in while we are\r
     // doing this operation.\r
     //\r
-    OriginalTPL = gBS->RaiseTPL (EFI_TPL_NOTIFY);\r
+    OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);\r
 \r
     for (SrcY = SourceY, DstY = DestinationY; DstY < (Height + DestinationY); SrcY++, DstY++) {\r
       Blt = (EFI_UGA_PIXEL *) ((UINT8 *) BltBuffer + (DstY * Delta) + DestinationX * sizeof (EFI_UGA_PIXEL));\r
@@ -390,7 +386,7 @@ WinNtUgaBlt (
     // We would not want a timer based event (Cursor, ...) to come in while we are\r
     // doing this operation.\r
     //\r
-    OriginalTPL = gBS->RaiseTPL (EFI_TPL_NOTIFY);\r
+    OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);\r
 \r
     if (BltOperation == EfiUgaVideoFill) {\r
       FillPixel = BltBuffer;\r
@@ -445,7 +441,7 @@ WinNtUgaBlt (
     // we may miss some data for a short period of time this is no different than\r
     // a write combining on writes to a frame buffer.\r
     //\r
-  \r
+\r
     Private->WinNtThunk->UpdateWindow (Private->WindowHandle);\r
   }\r
 \r
@@ -501,7 +497,7 @@ WinNtUgaThreadWindowProc (
 /*++\r
 \r
 Routine Description:\r
-  Win32 Windows event handler. \r
+  Win32 Windows event handler.\r
 \r
 Arguments:\r
   See Win32 Book\r
@@ -630,6 +626,8 @@ Returns:
     case VK_F7:   Key.ScanCode = SCAN_F7;   break;\r
     case VK_F8:   Key.ScanCode = SCAN_F8;   break;\r
     case VK_F9:   Key.ScanCode = SCAN_F9;   break;\r
+    case VK_F11:  Key.ScanCode = SCAN_F11;  break;\r
+    case VK_F12:  Key.ScanCode = SCAN_F12;  break;\r
     }\r
 \r
     if (Key.ScanCode != 0) {\r
@@ -691,7 +689,7 @@ WinNtUgaThreadWinMain (
 Routine Description:\r
 \r
   This thread simulates the end of WinMain () aplication. Each Winow nededs\r
-  to process it's events. The messages are dispatched to \r
+  to process it's events. The messages are dispatched to\r
   WinNtUgaThreadWindowProc ().\r
 \r
   Be very careful sine WinNtUgaThreadWinMain () and WinNtUgaThreadWindowProc ()\r
@@ -853,8 +851,8 @@ Returns:
   // Register to be notified on exit boot services so we can destroy the window.\r
   //\r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,\r
-                  EFI_TPL_CALLBACK,\r
+                  EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+                  TPL_CALLBACK,\r
                   KillNtUgaThread,\r
                   Private,\r
                   &mUgaScreenExitBootServicesEvent\r
@@ -972,8 +970,8 @@ KillNtUgaThread (
 /*++\r
 \r
 Routine Description:\r
-  \r
-  This is the UGA screen's callback notification function for exit-boot-services. \r
+\r
+  This is the UGA screen's callback notification function for exit-boot-services.\r
   All we do here is call WinNtUgaDestructor().\r
 \r
 Arguments:\r