summaryrefslogtreecommitdiffstats
path: root/qemu/roms/seabios/src/hw/serialio.c
diff options
context:
space:
mode:
authorRajithaY <rajithax.yerrumsetty@intel.com>2017-04-25 03:31:15 -0700
committerRajitha Yerrumchetty <rajithax.yerrumsetty@intel.com>2017-05-22 06:48:08 +0000
commitbb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch)
treeca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/seabios/src/hw/serialio.c
parenta14b48d18a9ed03ec191cf16b162206998a895ce (diff)
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to kvmfornfv repo and make use of the updated latest qemu for the execution of all testcase Change-Id: I1280af507a857675c7f81d30c95255635667bdd7 Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/seabios/src/hw/serialio.c')
-rw-r--r--qemu/roms/seabios/src/hw/serialio.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/qemu/roms/seabios/src/hw/serialio.c b/qemu/roms/seabios/src/hw/serialio.c
deleted file mode 100644
index 6486fc086..000000000
--- a/qemu/roms/seabios/src/hw/serialio.c
+++ /dev/null
@@ -1,89 +0,0 @@
-// Low-level serial (and serial-like) device access.
-//
-// Copyright (C) 2008-1013 Kevin O'Connor <kevin@koconnor.net>
-//
-// This file may be distributed under the terms of the GNU LGPLv3 license.
-
-#include "config.h" // CONFIG_DEBUG_SERIAL
-#include "fw/paravirt.h" // RunningOnQEMU
-#include "output.h" // dprintf
-#include "serialio.h" // serial_debug_preinit
-#include "x86.h" // outb
-
-
-/****************************************************************
- * Serial port debug output
- ****************************************************************/
-
-#define DEBUG_TIMEOUT 100000
-
-// Setup the debug serial port for output.
-void
-serial_debug_preinit(void)
-{
- if (!CONFIG_DEBUG_SERIAL)
- return;
- // setup for serial logging: 8N1
- u8 oldparam, newparam = 0x03;
- oldparam = inb(CONFIG_DEBUG_SERIAL_PORT+SEROFF_LCR);
- outb(newparam, CONFIG_DEBUG_SERIAL_PORT+SEROFF_LCR);
- // Disable irqs
- u8 oldier, newier = 0;
- oldier = inb(CONFIG_DEBUG_SERIAL_PORT+SEROFF_IER);
- outb(newier, CONFIG_DEBUG_SERIAL_PORT+SEROFF_IER);
-
- if (oldparam != newparam || oldier != newier)
- dprintf(1, "Changing serial settings was %x/%x now %x/%x\n"
- , oldparam, oldier, newparam, newier);
-}
-
-// Write a character to the serial port.
-static void
-serial_debug(char c)
-{
- if (!CONFIG_DEBUG_SERIAL)
- return;
- int timeout = DEBUG_TIMEOUT;
- while ((inb(CONFIG_DEBUG_SERIAL_PORT+SEROFF_LSR) & 0x20) != 0x20)
- if (!timeout--)
- // Ran out of time.
- return;
- outb(c, CONFIG_DEBUG_SERIAL_PORT+SEROFF_DATA);
-}
-
-void
-serial_debug_putc(char c)
-{
- if (c == '\n')
- serial_debug('\r');
- serial_debug(c);
-}
-
-// Make sure all serial port writes have been completely sent.
-void
-serial_debug_flush(void)
-{
- if (!CONFIG_DEBUG_SERIAL)
- return;
- int timeout = DEBUG_TIMEOUT;
- while ((inb(CONFIG_DEBUG_SERIAL_PORT+SEROFF_LSR) & 0x60) != 0x60)
- if (!timeout--)
- // Ran out of time.
- return;
-}
-
-
-/****************************************************************
- * QEMU debug port
- ****************************************************************/
-
-u16 DebugOutputPort VARFSEG = 0x402;
-
-// Write a character to the special debugging port.
-void
-qemu_debug_putc(char c)
-{
- if (CONFIG_DEBUG_IO && runningOnQEMU())
- // Send character to debug port.
- outb(c, GET_GLOBAL(DebugOutputPort));
-}