Commit cc9c9ffc689076ff9a0275d295d5174cc03bb20b

Authored by aurel32
1 parent d73bd7eb

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
Showing 1 changed file with 9 additions and 3 deletions
hw/pl011.c
@@ -195,7 +195,7 @@ static int pl011_can_receive(void *opaque) @@ -195,7 +195,7 @@ static int pl011_can_receive(void *opaque)
195 return s->read_count < 1; 195 return s->read_count < 1;
196 } 196 }
197 197
198 -static void pl011_receive(void *opaque, const uint8_t *buf, int size) 198 +static void pl011_put_fifo(void *opaque, uint32_t value)
199 { 199 {
200 pl011_state *s = (pl011_state *)opaque; 200 pl011_state *s = (pl011_state *)opaque;
201 int slot; 201 int slot;
@@ -203,7 +203,7 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size) @@ -203,7 +203,7 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size)
203 slot = s->read_pos + s->read_count; 203 slot = s->read_pos + s->read_count;
204 if (slot >= 16) 204 if (slot >= 16)
205 slot -= 16; 205 slot -= 16;
206 - s->read_fifo[slot] = *buf; 206 + s->read_fifo[slot] = value;
207 s->read_count++; 207 s->read_count++;
208 s->flags &= ~PL011_FLAG_RXFE; 208 s->flags &= ~PL011_FLAG_RXFE;
209 if (s->cr & 0x10 || s->read_count == 16) { 209 if (s->cr & 0x10 || s->read_count == 16) {
@@ -215,9 +215,15 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size) @@ -215,9 +215,15 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size)
215 } 215 }
216 } 216 }
217 217
  218 +static void pl011_receive(void *opaque, const uint8_t *buf, int size)
  219 +{
  220 + pl011_put_fifo(opaque, *buf);
  221 +}
  222 +
218 static void pl011_event(void *opaque, int event) 223 static void pl011_event(void *opaque, int event)
219 { 224 {
220 - /* ??? Should probably implement break. */ 225 + if (event == CHR_EVENT_BREAK)
  226 + pl011_put_fifo(opaque, 0x400);
221 } 227 }
222 228
223 static CPUReadMemoryFunc *pl011_readfn[] = { 229 static CPUReadMemoryFunc *pl011_readfn[] = {