]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c
EmbeddedPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / EmbeddedPkg / SimpleTextInOutSerial / SimpleTextInOut.c
index 5905a108b1650d0b0dcec8f3ace79791f47bed98..d824e1595346bf93775751578682eadd846c99c9 100644 (file)
@@ -1,19 +1,13 @@
 /** @file\r
-  Simple Console that sits on a SerialLib. \r
+  Simple Console that sits on a SerialLib.\r
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-  \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
-  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
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
-/* \r
+/*\r
   Symbols used in table below\r
 ===========================\r
   ESC = 0x1B\r
@@ -295,17 +289,17 @@ ReadKeyStroke (
   )\r
 {\r
   CHAR8             Char;\r
-  \r
+\r
   if (!SerialPortPoll ()) {\r
     return EFI_NOT_READY;\r
   }\r
-  \r
+\r
   SerialPortRead ((UINT8 *)&Char, 1);\r
-  \r
+\r
   //\r
   // Check for ESC sequence. This code is not techincally correct VT100 code.\r
   // An illegal ESC sequence represents an ESC and the characters that follow.\r
-  // This code will eat one or two chars after an escape. This is done to \r
+  // This code will eat one or two chars after an escape. This is done to\r
   // prevent some complex FIFOing of the data. It is good enough to get\r
   // the arrow and delete keys working\r
   //\r
@@ -332,7 +326,7 @@ ReadKeyStroke (
         Key->ScanCode = SCAN_HOME;\r
         break;\r
       case 'K':\r
-      case 'F': // PC ANSI \r
+      case 'F': // PC ANSI\r
         Key->ScanCode = SCAN_END;\r
         break;\r
       case '@':\r
@@ -340,7 +334,7 @@ ReadKeyStroke (
         Key->ScanCode = SCAN_INSERT;\r
         break;\r
       case 'P':\r
-      case 'X': // PC ANSI \r
+      case 'X': // PC ANSI\r
         Key->ScanCode = SCAN_DELETE;\r
         break;\r
       case 'U':\r
@@ -419,12 +413,12 @@ ReadKeyStroke (
       }\r
     }\r
   } else if (Char < ' ') {\r
-    if ((Char == CHAR_BACKSPACE) || \r
-        (Char == CHAR_TAB)       || \r
-        (Char == CHAR_LINEFEED)  || \r
+    if ((Char == CHAR_BACKSPACE) ||\r
+        (Char == CHAR_TAB)       ||\r
+        (Char == CHAR_LINEFEED)  ||\r
         (Char == CHAR_CARRIAGE_RETURN)) {\r
       // Only let through EFI required control characters\r
-      Key->UnicodeChar = (CHAR16)Char;  \r
+      Key->UnicodeChar = (CHAR16)Char;\r
     }\r
   } else if (Char == 0x7f) {\r
     Key->ScanCode = SCAN_DELETE;\r
@@ -523,13 +517,13 @@ OutputString (
   EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;\r
   UINTN                       MaxColumn;\r
   UINTN                       MaxRow;\r
-  \r
+\r
   Size = StrLen(String) + 1;\r
   OutputString = AllocatePool(Size);\r
 \r
   //If there is any non-ascii characters in String buffer then replace it with '?'\r
   //Eventually, UnicodeStrToAsciiStr API should be fixed.\r
-  SafeUnicodeStrToAsciiStr(String, OutputString);  \r
+  SafeUnicodeStrToAsciiStr(String, OutputString);\r
   SerialPortWrite ((UINT8 *)OutputString, Size - 1);\r
 \r
   //\r
@@ -693,7 +687,7 @@ SetCursorPosition (
                   This,\r
                   Mode->Mode,\r
                   &MaxColumn,\r
-                  &MaxRow \r
+                  &MaxRow\r
                   );\r
   if (EFI_ERROR(Status)) {\r
     return EFI_UNSUPPORTED;\r
@@ -742,7 +736,7 @@ SimpleTextInOutEntryPoint (
                   &mSimpleTextIn.WaitForKey\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
-  \r
+\r
   Status = gBS->InstallMultipleProtocolInterfaces(\r
                   &mInstallHandle,\r
                   &gEfiSimpleTextInProtocolGuid,   &mSimpleTextIn,\r
@@ -754,6 +748,6 @@ SimpleTextInOutEntryPoint (
     gST->ConOut = &mSimpleTextOut;\r
     gST->ConIn = &mSimpleTextIn;\r
   }\r
-  \r
+\r
   return Status;\r
 }\r