qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] implement sysrq for the pl011


From: Jason Wessel
Subject: [Qemu-devel] [PATCH] implement sysrq for the pl011
Date: Wed, 12 Mar 2008 13:19:01 -0500
User-agent: Thunderbird 2.0.0.12 (X11/20080227)

Implement sysrq for the pl011.  This was tested on
the ARM Versatile AB + kernel.org 2.6.X kernel.

Signed-off-by: Jason Wessel <address@hidden>

---
 hw/pl011.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

--- a/hw/pl011.c
+++ b/hw/pl011.c
@@ -208,7 +208,24 @@ static void pl011_receive(void *opaque, 
 
 static void pl011_event(void *opaque, int event)
 {
-    /* ??? Should probably implement break.  */
+    if (event == CHR_EVENT_BREAK) {
+        pl011_state *s = (pl011_state *)opaque;
+        int slot;
+
+        slot = s->read_pos + s->read_count;
+        if (slot >= 16)
+            slot -= 16;
+        s->read_fifo[slot] = 0x400;
+        s->read_count++;
+        s->flags &= ~PL011_FLAG_RXFE;
+        if (s->cr & 0x10 || s->read_count == 16) {
+            s->flags |= PL011_FLAG_RXFF;
+        }
+        if (s->read_count == s->read_trigger) {
+            s->int_level |= PL011_INT_RX;
+            pl011_update(s);
+        }
+    }
 }
 
 static CPUReadMemoryFunc *pl011_readfn[] = {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]