mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2025-01-03 03:15:56 +01:00
fix: set bus master, memory space access, and I/O space access bit in PCI command register
This commit is contained in:
parent
ef7f1d3459
commit
d9e04ec7cd
@ -605,10 +605,16 @@ proc nvme_init stdcall, pci:dword
|
|||||||
push ebx esi edi
|
push ebx esi edi
|
||||||
mov esi, dword [pci]
|
mov esi, dword [pci]
|
||||||
|
|
||||||
|
|
||||||
; Check the PCI header to see if interrupts are disabled, if so
|
; Check the PCI header to see if interrupts are disabled, if so
|
||||||
; we have to re-enable them
|
; we have to re-enable them
|
||||||
invoke PciRead16, dword [esi + pcidev.bus], dword [esi + pcidev.devfn], PCI_header00.command
|
invoke PciRead16, dword [esi + pcidev.bus], dword [esi + pcidev.devfn], PCI_header00.command
|
||||||
and eax, not (1 shl 10)
|
and eax, not (1 shl 10)
|
||||||
|
; Enable Bus Master bit, memory space access, and I/O space access. QEMU automatically sets the
|
||||||
|
; bus master bit, but Virtualbox does not. Not sure about the other bits though, but let's set them
|
||||||
|
; to 1 to anyway just to be extra cautious.
|
||||||
|
; See: https://git.kolibrios.org/GSoC/kolibrios-nvme-driver/issues/1#issuecomment-467
|
||||||
|
or eax, (1 shl 2) or (1 shl 1) or 1
|
||||||
invoke PciWrite16, dword [esi + pcidev.bus], dword [esi + pcidev.devfn], PCI_header00.command, eax
|
invoke PciWrite16, dword [esi + pcidev.bus], dword [esi + pcidev.devfn], PCI_header00.command, eax
|
||||||
|
|
||||||
; Check if the device has a pointer to the capabilities list (status register bit 4 set to 1)
|
; Check if the device has a pointer to the capabilities list (status register bit 4 set to 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user