X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=OvmfPkg%2FResetVector%2FSerialDebug.asm;h=8c2ffc66d34a97e12ea60e377852303253544d46;hb=7a55c43b072ec2192d35df5e44cf37eb8be06555;hp=2959fa5450ee17e16101102c8fbab760662d9f47;hpb=49ba9447c92d6fca214476381107a180d08e59d1;p=mirror_edk2.git diff --git a/OvmfPkg/ResetVector/SerialDebug.asm b/OvmfPkg/ResetVector/SerialDebug.asm index 2959fa5450..8c2ffc66d3 100644 --- a/OvmfPkg/ResetVector/SerialDebug.asm +++ b/OvmfPkg/ResetVector/SerialDebug.asm @@ -1,6 +1,8 @@ ;------------------------------------------------------------------------------ +; @file +; Serial port debug support macros ; -; Copyright (c) 2008, Intel Corporation +; Copyright (c) 2008 - 2009, Intel Corporation ; All rights reserved. This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at @@ -9,18 +11,8 @@ ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ; -; Module Name: -; -; SerialDebug.asm -; -; Abstract: -; -; Serial port support macros -; ;------------------------------------------------------------------------------ -BITS 16 - ;//--------------------------------------------- ;// UART Register Offsets ;//--------------------------------------------- @@ -88,12 +80,38 @@ BITS 16 out dx, al %endmacro -%macro writeToSerialPort 1 +%macro debugShowCharacter 1 waitForSerialTxReady outToSerialPort 0, %1 %endmacro -real16InitSerialPort: +%macro debugShowHexDigit 1 + %if (%1 < 0xa) + debugShowCharacter BYTE ('0' + (%1)) + %else + debugShowCharacter BYTE ('a' + ((%1) - 0xa)) + %endif +%endmacro + +%macro debugNewline 0 + debugShowCharacter `\r` + debugShowCharacter `\n` +%endmacro + +%macro debugShowPostCode 1 + debugShowHexDigit (((%1) >> 4) & 0xf) + debugShowHexDigit ((%1) & 0xf) + debugNewline +%endmacro + +BITS 16 + +%macro debugInitialize 0 + jmp real16InitDebug +real16InitDebugReturn: +%endmacro + +real16InitDebug: ; ; Set communications format ; @@ -110,5 +128,5 @@ real16InitSerialPort: ; outToSerialPort LCR_OFFSET, SERIAL_DEFAULT_LCR - jmp real16SerialPortInitReturn + jmp real16InitDebugReturn