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