]> git.proxmox.com Git - mirror_edk2.git/blame - DuetPkg/DxeIpl/Debug.c
Update the copyright notice format
[mirror_edk2.git] / DuetPkg / DxeIpl / Debug.c
CommitLineData
18b84857 1/** @file\r
ca162103 2\r
b1f700a8
HT
3Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
ca162103 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13 Debug.c\r
14\r
15Abstract:\r
16\r
17Revision History:\r
18\r
18b84857 19**/\r
ca162103 20\r
21#include "DxeIpl.h"\r
40b499c6 22#include "SerialStatusCode.h"\r
ca162103 23\r
24UINT8 *mCursor;\r
25UINT8 mHeaderIndex = 10;\r
26\r
27\r
28VOID\r
29PrintHeader (\r
30 CHAR8 Char\r
31 )\r
32{\r
33 *(UINT8 *)(UINTN)(0x000b8000 + mHeaderIndex) = Char;\r
34 mHeaderIndex += 2;\r
35}\r
36\r
37VOID\r
38ClearScreen (\r
39 VOID\r
40 )\r
41{\r
42 UINT32 Index;\r
43\r
44 mCursor = (UINT8 *)(UINTN)(0x000b8000 + 160);\r
45 for (Index = 0; Index < 80 * 49; Index++) {\r
46 *mCursor = ' ';\r
47 mCursor += 2;\r
48 }\r
49 mCursor = (UINT8 *)(UINTN)(0x000b8000 + 160);\r
50}\r
51\r
52VOID\r
53PrintValue (\r
54 UINT32 Value\r
55 )\r
56{\r
57 UINT32 Index;\r
58 UINT8 Char;\r
59\r
60 for (Index = 0; Index < 8; Index++) {\r
e188a609 61 Char = (UINT8)(((Value >> ((7 - Index) * 4)) & 0x0f) + '0');\r
ca162103 62 if (Char > '9') {\r
e188a609 63 Char = (UINT8) (Char - '0' - 10 + 'A');\r
ca162103 64 }\r
65 *mCursor = Char;\r
66 mCursor += 2;\r
67 }\r
68}\r
69\r
70VOID\r
71PrintValue64 (\r
72 UINT64 Value\r
73 )\r
74{\r
75 PrintValue ((UINT32) RShiftU64 (Value, 32));\r
76 PrintValue ((UINT32) Value);\r
77}\r
78\r
79\r
80\r
81VOID\r
82PrintString (\r
83 UINT8 *String\r
84 )\r
85{\r
86 UINT32 Index;\r
87\r
88 for (Index = 0; String[Index] != 0; Index++) {\r
89 if (String[Index] == '\n') {\r
90 mCursor = (UINT8 *)(UINTN)(0xb8000 + (((((UINTN)mCursor - 0xb8000) + 160) / 160) * 160));\r
91 } else {\r
92 *mCursor = String[Index];\r
93 mCursor += 2;\r
94 }\r
95 }\r
d26b17e3 96 \r
97 //\r
98 // All information also output to serial port.\r
99 //\r
8941b53e 100 DebugSerialPrint ((CHAR8*)String);\r
ca162103 101}\r
102\r