From cec15b9114d2f46f076d779c6c06fd36919b6b92 Mon Sep 17 00:00:00 2001 From: Abdur-Rahman Mansoor Date: Sat, 8 Jun 2024 12:25:29 -0400 Subject: [PATCH] add get_log_page (incomplete) --- drivers/nvme/nvme.asm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/nvme/nvme.asm b/drivers/nvme/nvme.asm index dd7ec41..084c273 100644 --- a/drivers/nvme/nvme.asm +++ b/drivers/nvme/nvme.asm @@ -337,6 +337,24 @@ proc delete_io_submission_queue stdcall, pci:dword, qid:word endp +; See page 117-118 of the NVMe 1.4 specification for reference +; INCOMPLETE +proc get_log_page stdcall, pci:dword, dptr:dword, lid:byte + + push esi + mov esi, [pci] + mov esi, [esi + pcidev.sq_ptr] + stdcall memset, esi, 0, sizeof.SQ_ENTRY + stdcall set_cdw0, ADM_CMD_GET_LOG_PAGE, 0 ; [TODO: Set CID to valid value] + mov dword [esi + SQ_ENTRY.cdw0], eax + mov eax, [dptr] + mov dword [esi + SQ_ENTRY.dptr], eax + pop esi + ret + +endp + + proc detect_nvme invoke GetPCIList