Skip to content

Commit a3d029e

Browse files
committed
Handle a keypress
1 parent 5d8415c commit a3d029e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

virtio.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,12 @@ int virtio_console_get_write_len(VIRTIODevice *s)
13281328

13291329
int virtio_console_write_data(VIRTIODevice *s, const uint8_t *buf, int buf_len)
13301330
{
1331+
//// To handle a keypress, we trigger the UART3 Interrupt.
1332+
//// TODO: Pass the keypress to VM Guest
1333+
printf("[%c]\n", buf[0]); ////
1334+
// s->int_status |= 1;
1335+
// set_irq(s->irq, 1);
1336+
#ifdef NOTUSED
13311337
int queue_idx = 0;
13321338
QueueState *qs = &s->queue[queue_idx];
13331339
int desc_idx;
@@ -1347,6 +1353,7 @@ int virtio_console_write_data(VIRTIODevice *s, const uint8_t *buf, int buf_len)
13471353
qs->last_avail_idx++;
13481354
printf("virtio_console_write_data: buf[0]=%c, buf_len=%d\n", buf[0], buf_len);////
13491355
return buf_len;
1356+
#endif // NOTUSED
13501357
}
13511358

13521359
/* send a resize event */

0 commit comments

Comments
 (0)