Skip to contentSkip to conversation

implement sysrq for the pl011

PATCH New Jason Wessel 1 participant 1 message Mar 12, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 implement sysrq for the pl011

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

---
 hw/pl011.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
hw/pl011.c +18 -1
@@ -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[] = {