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