diff --git a/kernel/arch/aarch64/virtio.c b/kernel/arch/aarch64/virtio.c index c551b1b8..5d3f9b14 100644 --- a/kernel/arch/aarch64/virtio.c +++ b/kernel/arch/aarch64/virtio.c @@ -228,7 +228,7 @@ static void virtio_tablet_thread(void * data) { uint16_t them = queue->used.index; - for (; index < them; index++) { + for (; index != them; index++) { asm volatile ("dc ivac, %0\ndsb sy" :: "r"(&buffers[index%queue_size]) : "memory"); struct virtio_input_event evt = buffers[index%queue_size]; while (evt.type == 0xFF) { @@ -376,7 +376,7 @@ static void virtio_keyboard_thread(void * data) { uint16_t them = queue->used.index; - for (; index < them; index++) { + for (; index != them; index++) { asm volatile ("dc ivac, %0\ndsb sy" :: "r"(&buffers[index%queue_size]) : "memory"); struct virtio_input_event evt = buffers[index%queue_size]; while (evt.type == 0xFF) {