summaryrefslogtreecommitdiff
path: root/hw/pl011.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-08 19:51:43 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-08 19:51:43 +0000
commitcc9c9ffc689076ff9a0275d295d5174cc03bb20b (patch)
tree5410ce9f7963c682eca7716172149dbb7d524247 /hw/pl011.c
parentd73bd7ebec7ca57e95c868c3ec017598de6ea3ee (diff)
downloadqemu-cc9c9ffc689076ff9a0275d295d5174cc03bb20b.tar.gz
Implement break for the pl011, based on a patch from Jason Wessel.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4182 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pl011.c')
-rw-r--r--hw/pl011.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/hw/pl011.c b/hw/pl011.c
index 9d8c6a3f58..6676644991 100644
--- a/hw/pl011.c
+++ b/hw/pl011.c
@@ -195,7 +195,7 @@ static int pl011_can_receive(void *opaque)
return s->read_count < 1;
}
-static void pl011_receive(void *opaque, const uint8_t *buf, int size)
+static void pl011_put_fifo(void *opaque, uint32_t value)
{
pl011_state *s = (pl011_state *)opaque;
int slot;
@@ -203,7 +203,7 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size)
slot = s->read_pos + s->read_count;
if (slot >= 16)
slot -= 16;
- s->read_fifo[slot] = *buf;
+ s->read_fifo[slot] = value;
s->read_count++;
s->flags &= ~PL011_FLAG_RXFE;
if (s->cr & 0x10 || s->read_count == 16) {
@@ -215,9 +215,15 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size)
}
}
+static void pl011_receive(void *opaque, const uint8_t *buf, int size)
+{
+ pl011_put_fifo(opaque, *buf);
+}
+
static void pl011_event(void *opaque, int event)
{
- /* ??? Should probably implement break. */
+ if (event == CHR_EVENT_BREAK)
+ pl011_put_fifo(opaque, 0x400);
}
static CPUReadMemoryFunc *pl011_readfn[] = {