1 | ;------------------------------------------------------------------------------
|
---|
2 | ; @file
|
---|
3 | ; qemu debug console support macros (based on serial port macros)
|
---|
4 | ;
|
---|
5 | ; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
---|
6 | ; Copyright (c) 2024, Red Hat, Inc.<BR>
|
---|
7 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
8 | ;
|
---|
9 | ;------------------------------------------------------------------------------
|
---|
10 |
|
---|
11 | %macro debugShowCharacter 1
|
---|
12 | mov dx, 0x402
|
---|
13 | mov al, %1
|
---|
14 | out dx, al
|
---|
15 | %endmacro
|
---|
16 |
|
---|
17 | %macro debugShowHexDigit 1
|
---|
18 | %if (%1 < 0xa)
|
---|
19 | debugShowCharacter BYTE ('0' + (%1))
|
---|
20 | %else
|
---|
21 | debugShowCharacter BYTE ('a' + ((%1) - 0xa))
|
---|
22 | %endif
|
---|
23 | %endmacro
|
---|
24 |
|
---|
25 | %macro debugShowPostCode 1
|
---|
26 | debugShowHexDigit (((%1) >> 4) & 0xf)
|
---|
27 | debugShowHexDigit ((%1) & 0xf)
|
---|
28 | debugShowCharacter `\r`
|
---|
29 | debugShowCharacter `\n`
|
---|
30 | %endmacro
|
---|
31 |
|
---|
32 | BITS 16
|
---|
33 |
|
---|
34 | %macro debugInitialize 0
|
---|
35 | ; not required
|
---|
36 | %endmacro
|
---|