diff --git a/drivers/nvme/command.inc b/drivers/nvme/command.inc index b2c2b00..d13e7aa 100644 --- a/drivers/nvme/command.inc +++ b/drivers/nvme/command.inc @@ -144,6 +144,9 @@ endp ; See page 105 of the NVMe 1.4 specification for reference proc delete_io_completion_queue stdcall, pci:dword, qid:word + push esi + mov esi, [pci] + mov dword [esi + pcidev.spinlock], 1 sub esp, sizeof.SQ_ENTRY stdcall memsetdz, esp, sizeof.SQ_ENTRY / 4 stdcall set_cdw0, [pci], ADMIN_QUEUE, ADM_CMD_DEL_IO_COMPLETION_QUEUE @@ -152,6 +155,8 @@ proc delete_io_completion_queue stdcall, pci:dword, qid:word mov word [esp + SQ_ENTRY.cdw10], ax stdcall sqytdbl_write, [pci], ADMIN_QUEUE, esp add esp, sizeof.SQ_ENTRY + stdcall nvme_poll, esi + pop esi ret endp @@ -180,6 +185,9 @@ endp ; See page 105-106 of the NVMe 1.4 specification for reference proc delete_io_submission_queue stdcall, pci:dword, qid:word + push esi + mov esi, [pci] + mov dword [esi + pcidev.spinlock], 1 sub esp, sizeof.SQ_ENTRY stdcall memsetdz, esp, sizeof.SQ_ENTRY / 4 stdcall set_cdw0, [pci], ADMIN_QUEUE, ADM_CMD_DEL_IO_SUBMISSION_QUEUE @@ -188,6 +196,8 @@ proc delete_io_submission_queue stdcall, pci:dword, qid:word mov word [esp + SQ_ENTRY.cdw10], ax stdcall sqytdbl_write, [pci], ADMIN_QUEUE, esp add esp, sizeof.SQ_ENTRY + stdcall nvme_poll, esi + pop esi ret endp