Commit 250af9d
Migrate virtio-blk from semu
This commit migrates @shengwen-tw's brilliant virtio implementation
from semu, with the following modification:
1. Rename virtio_blk_reg_read/write to virtio_blk_read/write
The original virtio_blk_read verified whether the virtio MMIO was
aligned to 4. Since rv32emu does not enforce alignment checks for UART
and PLIC devices or raise misalignment exceptions, this verification
has been omitted.
2. Implement MMIO_VIRTIOBLK
3. Implement vblk_new() and vblk_delete()
These functions align with the conventions used for UART and PLIC
devices.
4. Introduce new argument '-x vblk:<disk_image>' for virtio-blk disk
image
Co-authored-by: Shengwen Cheng <[email protected]>1 parent 5ec905a commit 250af9d
File tree
9 files changed
+627
-3
lines changed- src
- devices
9 files changed
+627
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
83 | 98 | | |
84 | 99 | | |
85 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
68 | 74 | | |
69 | 75 | | |
0 commit comments