]>
git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/EfiLdr/Debug.c
3 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
4 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
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.
22 #include <Library/SerialPortLib.h>
25 UINT8 mHeaderIndex
= 10;
32 *(UINT8
*)(UINTN
)(0x000b8000 + mHeaderIndex
) = Char
;
43 mCursor
= (UINT8
*)(UINTN
)(0x000b8000 + 160);
44 for (Index
= 0; Index
< 80 * 49; Index
++) {
48 mCursor
= (UINT8
*)(UINTN
)(0x000b8000 + 160);
64 for (Index
= 0, StringPos
= 0; Index
< 10; Index
++) {
65 Char
= (UINT8
) (((Value
/ B10Div
) % 10) + '0');
66 if ((StringPos
> 0) || (Char
!= '0')) {
67 String
[StringPos
] = Char
;
78 String
[StringPos
] = '\0';
93 for (Index
= 0; Index
< 8; Index
++) {
94 Char
= (UINT8
)(((Value
>> ((7 - Index
) * 4)) & 0x0f) + '0');
96 Char
= (UINT8
) (Char
- '0' - 10 + 'A');
101 String
[sizeof (String
) - 1] = '\0';
103 PrintString (String
);
111 PrintValue ((UINT32
) RShiftU64 (Value
, 32));
112 PrintValue ((UINT32
) Value
);
122 for (Index
= 0; String
[Index
] != 0; Index
++) {
123 if (String
[Index
] == '\n') {
124 mCursor
= (UINT8
*)(UINTN
)(0xb8000 + (((((UINTN
)mCursor
- 0xb8000) + 160) / 160) * 160));
126 *mCursor
= String
[Index
];
132 // All information also output to serial port.
134 SerialPortWrite ((UINT8
*) String
, Index
);