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