Skip to content

Commit 6d53a9a

Browse files
authored
Merge pull request #206 from PorterLu/virtio_idx
idx should always increase
2 parents 6adbe3f + f0cfe84 commit 6d53a9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/chapter9/2device-driver-2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ virtio驱动程序
478478
479479
avail.ring[(avail.idx + added++) % qsz] = head;
480480
481-
idx总是递增,并在到达 ``qsz`` 后又回到0:
481+
``idx`` 总是递增。由于上一行的取模操作,我们不必担心 ``idx > qsz`` 时会产生溢出。
482482

483483
.. code-block:: Rust
484484
@@ -535,4 +535,4 @@ idx总是递增,并在到达 ``qsz`` 后又回到0:
535535
}
536536
...
537537
538-
这里给出了virtio设备驱动通过中断来接收设备I/O响应的共性操作过程。如果结合具体的操作系统,还需与操作系统的总体中断处理、同步互斥、进程/线程调度进行结合。
538+
这里给出了virtio设备驱动通过中断来接收设备I/O响应的共性操作过程。如果结合具体的操作系统,还需与操作系统的总体中断处理、同步互斥、进程/线程调度进行结合。

0 commit comments

Comments
 (0)