@@ -105,7 +105,7 @@ virtio_blk_init_cap_end:
105105 ; Device Initialization (section 3.1)
106106
107107 ; 3.1.1 - Step 1 - Reset the device (section 2.4)
108- mov al , 0x00
108+ mov al , 0x00
109109 mov [ rsi + VIRTIO_DEVICE_STATUS ], al
110110virtio_blk_init_reset_wait:
111111 mov al , [ rsi + VIRTIO_DEVICE_STATUS ]
@@ -202,9 +202,9 @@ virtio_blk_init_pop:
202202virtio_blk_init_done:
203203 bts word [ os_nvsVar ], 3 ; Set the bit flag that Virtio Block has been initialized
204204 mov rdi , os_nvs_io ; Write over the storage function addresses
205- mov rax , virtio_blk_io
205+ mov eax , virtio_blk_io
206206 stosq
207- mov rax , virtio_blk_id
207+ mov eax , virtio_blk_id
208208 stosq
209209 pop rax
210210 pop rbx
@@ -248,7 +248,7 @@ virtio_blk_io:
248248 ; FIXME: Add desc_index offset
249249
250250 ; Add header to Descriptor Entry 0
251- mov rax , header ; Address of the header
251+ mov eax , header ; Address of the header
252252 stosq ; 64-bit address
253253 mov eax , 16
254254 stosd ; 32-bit length
@@ -267,7 +267,7 @@ virtio_blk_io:
267267 add rdi , 2 ; Skip Next as it is pre-populated
268268
269269 ; Add footer to Descriptor Entry 3
270- mov rax , footer ; Address of the footer
270+ mov eax , footer ; Address of the footer
271271 stosq ; 64-bit address
272272 mov eax , 1
273273 stosd ; 32-bit length
@@ -276,7 +276,7 @@ virtio_blk_io:
276276 add rdi , 2 ; Skip Next as it is pre-populated
277277
278278 ; Build the header
279- mov rdi , header
279+ mov edi , header
280280 ; BareMetal I/O opcode for Read is 2, Write is 1
281281 ; Virtio-blk I/O opcode for Read is 0, Write is 1
282282 ; FIXME: Currently we just clear bit 1.
@@ -290,7 +290,7 @@ virtio_blk_io:
290290 stosq ; starting sector
291291
292292 ; Build the footer
293- mov rdi , footer
293+ mov edi , footer
294294 xor eax , eax
295295 stosb
296296
@@ -331,7 +331,7 @@ virtio_blk_io_wait:
331331
332332
333333; -----------------------------------------------------------------------------
334- ; virtio_blk_id --
334+ ; virtio_blk_id --
335335; IN: EAX = CDW0
336336; EBX = CDW1
337337; ECX = CDW10
@@ -380,15 +380,15 @@ VIRTIO_BLK_MIN_IO_SIZE equ 0x2E ; 16-bit SUGGESTED MINIMUM I/O SIZE IN BLOCKS
380380VIRTIO_BLK_OPT_IO_SIZE equ 0x30 ; 32-bit OPTIMAL (SUGGESTED MAXIMUM) I/O SIZE IN BLOCKS
381381VIRTIO_BLK_WRITEBACK equ 0x34 ; 8-bit
382382VIRTIO_BLK_NUM_QUEUES equ 0x36 ; 16-bit
383- VIRTIO_BLK_MAX_DISCARD_SECTORS equ 0x38 ; 32-bit
384- VIRTIO_BLK_MAX_DISCARD_SEG equ 0x3C ; 32-bit
385- VIRTIO_BLK_DISCARD_SECTOR_ALIGNMENT equ 0x40 ; 32-bit
386- VIRTIO_BLK_MAX_WRITE_ZEROES_SECTORS equ 0x44 ; 32-bit
387- VIRTIO_BLK_MAX_WRITE_ZEROES_SEG equ 0x48 ; 32-bit
383+ VIRTIO_BLK_MAX_DISCARD_SECTORS equ 0x38 ; 32-bit
384+ VIRTIO_BLK_MAX_DISCARD_SEG equ 0x3C ; 32-bit
385+ VIRTIO_BLK_DISCARD_SECTOR_ALIGNMENT equ 0x40 ; 32-bit
386+ VIRTIO_BLK_MAX_WRITE_ZEROES_SECTORS equ 0x44 ; 32-bit
387+ VIRTIO_BLK_MAX_WRITE_ZEROES_SEG equ 0x48 ; 32-bit
388388VIRTIO_BLK_WRITE_ZEROES_MAY_UNMAP equ 0x4C ; 8-bit
389- VIRTIO_BLK_MAX_SECURE_ERASE_SECTORS equ 0x50 ; 32-bit
390- VIRTIO_BLK_MAX_SECURE_ERASE_SEG equ 0x54 ; 32-bit
391- VIRTIO_BLK_SECURE_ERASE_SECTOR_ALIGNMENT equ 0x58 ; 32-bit
389+ VIRTIO_BLK_MAX_SECURE_ERASE_SECTORS equ 0x50 ; 32-bit
390+ VIRTIO_BLK_MAX_SECURE_ERASE_SEG equ 0x54 ; 32-bit
391+ VIRTIO_BLK_SECURE_ERASE_SECTOR_ALIGNMENT equ 0x58 ; 32-bit
392392
393393; VIRTIO_DEVICEFEATURES bits
394394VIRTIO_BLK_F_BARRIER equ 0 ; Legacy - Device supports request barriers
0 commit comments