+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006 - 2011, 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
-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
- Debug.c\r
-\r
-Abstract:\r
-\r
-Revision History:\r
-\r
---*/\r
-#include "EfiLdr.h"\r
-#include "Debug.h"\r
-\r
-UINT8 *mCursor;\r
-UINT8 mHeaderIndex = 10;\r
-\r
-\r
-VOID\r
-PrintHeader (\r
- CHAR8 Char\r
- )\r
-{\r
- *(UINT8 *)(UINTN)(0x000b8000 + mHeaderIndex) = Char;\r
- mHeaderIndex += 2;\r
-}\r
-\r
-VOID\r
-ClearScreen (\r
- VOID\r
- )\r
-{\r
- UINT32 Index;\r
-\r
- mCursor = (UINT8 *)(UINTN)(0x000b8000 + 160);\r
- for (Index = 0; Index < 80 * 49; Index++) {\r
- *mCursor = ' ';\r
- mCursor += 2;\r
- }\r
- mCursor = (UINT8 *)(UINTN)(0x000b8000 + 160);\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-PrintString (\r
- IN CONST CHAR8 *FormatString,\r
- ...\r
- )\r
-{\r
- UINTN Index;\r
- CHAR8 PrintBuffer[256];\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, FormatString);\r
- AsciiVSPrint (PrintBuffer, sizeof (PrintBuffer), FormatString, Marker);\r
- VA_END (Marker);\r
-\r
- for (Index = 0; PrintBuffer[Index] != 0; Index++) {\r
- if (PrintBuffer[Index] == '\n') {\r
- mCursor = (UINT8 *) (UINTN) (0xb8000 + (((((UINTN)mCursor - 0xb8000) + 160) / 160) * 160));\r
- } else {\r
- *mCursor = (UINT8) PrintBuffer[Index];\r
- mCursor += 2;\r
- }\r
- }\r
-\r
- //\r
- // All information also output to serial port.\r
- //\r
- SerialPortWrite ((UINT8 *) PrintBuffer, Index);\r
-}\r
-\r