Skip to content

Commit

Permalink
Implement break for the pl011, based on a patch from Jason Wessel.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4182 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
aurel32 committed Apr 8, 2008
1 parent d73bd7e commit cc9c9ff
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions hw/pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ 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;

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) {
Expand All @@ -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[] = {
Expand Down

0 comments on commit cc9c9ff

Please sign in to comment.