Skip to contentSkip to conversation

ps2-keyboard: Add val to trace_ps2_read_data

PATCH New Wink Saville 1 participant 2 messages May 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ps2-keyboard: Add val to trace_ps2_read_data

While investigating why I can't get the ps2 keyboard working I wanted to see the value returned by ps2_read_data while tracing. So I've created this simple patch to add printing the value.

Wink Saville (1):
ps2-keyboard: Add val to trace_ps2_read_data

 hw/input/ps2.c | 2 +-
 trace-events   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.8.2
#1 lore raw

PATCH 1/1 ps2-keyboard: Add val to trace_ps2_read_data

To make the trace output more useful print the value returned by ps2_read_data.

---
 hw/input/ps2.c | 2 +-
 trace-events   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/input/ps2.c +1 -1
index a8aa36f..e27d8e4 100644
@@ -199,7 +199,6 @@ uint32_t ps2_read_data(void *opaque)
     PS2Queue *q;
     int val, index;
 
-    trace_ps2_read_data(opaque);
     q = &s->queue;
     if (q->count == 0) {
         /* NOTE: if no data left, we return the last keyboard one
@@ -219,6 +218,7 @@ uint32_t ps2_read_data(void *opaque)
         /* reassert IRQs if data left */
         s->update_irq(s->update_arg, q->count != 0);
     }
+    trace_ps2_read_data(opaque, val);
     return val;
 }
 
trace-events +1 -1
index 8350743..4a5d056 100644
@@ -229,7 +229,7 @@ slavio_set_timer_irq_cpu(int cpu, int level) "Set cpu %d local timer level %d"
 
 # hw/input/ps2.c
 ps2_put_keycode(void *opaque, int keycode) "%p keycode %d"
-ps2_read_data(void *opaque) "%p"
+ps2_read_data(void *opaque, int val) "%p val %d"
 ps2_set_ledstate(void *s, int ledstate) "%p ledstate %d"
 ps2_reset_keyboard(void *s) "%p"
 ps2_write_keyboard(void *opaque, int val) "%p val %d"
Signature · 1 line
2.8.2