2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2025-01-03 19:35:56 +01:00

fix: indentation

This commit is contained in:
Abdur-Rahman Mansoor 2024-05-26 13:24:34 -04:00
parent d172666be2
commit 46076ba2f0
2 changed files with 25 additions and 23 deletions

View File

@ -30,14 +30,14 @@ include "macros.inc"
proc START c, reason:dword proc START c, reason:dword
cmp [reason], DRV_ENTRY cmp [reason], DRV_ENTRY
jne .err jne .err
.entry: .entry:
DEBUGF DBG_INFO, "Detecting NVMe hardware...\n" DEBUGF DBG_INFO, "Detecting NVMe hardware...\n"
call detect_nvme call detect_nvme
test eax, eax test eax, eax
jz .err jz .err
mov eax, dword [p_nvme_devices] mov eax, dword [p_nvme_devices]
test eax, eax test eax, eax
jz .err jz .err
@ -54,29 +54,30 @@ proc START c, reason:dword
inc ecx inc ecx
cmp ecx, dword [pcidevs_len] cmp ecx, dword [pcidevs_len]
jne .loop jne .loop
invoke RegService, my_service, service_proc invoke RegService, my_service, service_proc
ret ret
.err: .err:
call nvme_cleanup call nvme_cleanup
xor eax, eax xor eax, eax
ret ret
endp endp
proc service_proc stdcall, ioctl:dword proc service_proc stdcall, ioctl:dword
mov ebx, [ioctl] mov ebx, [ioctl]
mov eax, [ebx+IOCTL.io_code] mov eax, [ebx+IOCTL.io_code]
cmp eax, SRV_GETVERSION cmp eax, SRV_GETVERSION
jne @F jne @F
mov eax, [ebx+IOCTL.output]
cmp [ebx+IOCTL.out_size], 4
jne @F
mov dword [eax], API_VERSION
xor eax, eax
ret
mov eax, [ebx+IOCTL.output]
cmp [ebx+IOCTL.out_size], 4
jne @F
mov dword [eax], API_VERSION
xor eax, eax
ret
@@: @@:
or eax, -1 or eax, -1
ret ret
@ -89,6 +90,7 @@ proc memset stdcall, p_data:dword, val:byte, sz:dword
mov edx, [sz] mov edx, [sz]
mov bl, [val] mov bl, [val]
xor ecx, ecx xor ecx, ecx
@@: @@:
mov byte [p_data + ecx], bl mov byte [p_data + ecx], bl
inc ecx inc ecx
@ -129,7 +131,7 @@ endp
proc detect_nvme proc detect_nvme
invoke GetPCIList invoke GetPCIList
mov edx, eax mov edx, eax
.check_dev: .check_dev:
@ -268,10 +270,10 @@ proc nvme_init stdcall, pci:dword
; Configure Admin Submission/Completion Queue Base Address ; Configure Admin Submission/Completion Queue Base Address
xor eax, eax xor eax, eax
inc eax inc eax
pop ebx pop ebx
ret ret
.exit_fail: .exit_fail:
PDEBUGF DBG_INFO, "PCI(%u.%u.%u): failed to initialize NVMe controller\n", byte [pci + pcidev.bus], byte [pci + pcidev.devfn] PDEBUGF DBG_INFO, "PCI(%u.%u.%u): failed to initialize NVMe controller\n", byte [pci + pcidev.bus], byte [pci + pcidev.devfn]

View File

@ -210,7 +210,7 @@ struct pcidev
bus db ? bus db ?
devfn db ? devfn db ?
rw 1 rw 1
mmio_ptr dd ? mmio_ptr dd ?
ends ends
TOTAL_PCIDEVS = 4 TOTAL_PCIDEVS = 4
TOTAL_PCIDEVS_MALLOC_SZ = TOTAL_PCIDEVS * sizeof.pcidev TOTAL_PCIDEVS_MALLOC_SZ = TOTAL_PCIDEVS * sizeof.pcidev