mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2025-01-03 03:15:56 +01:00
remove useless exact alignment alloc
This commit is contained in:
parent
867a675261
commit
caf8e43513
@ -718,22 +718,10 @@ proc nvme_init stdcall, pci:dword
|
||||
xor ebx, ebx
|
||||
|
||||
.init_queues:
|
||||
invoke AllocPages, QUEUE_ALLOC_SIZE / PAGE_SIZE
|
||||
test eax, eax
|
||||
jz .exit_fail
|
||||
or eax, PG_SW+PG_NOCACHE
|
||||
mov esi, eax
|
||||
invoke KernelAlloc, QUEUE_ALLOC_SIZE
|
||||
test eax, eax
|
||||
jz .exit_fail
|
||||
mov dword [edi + ebx + NVM_QUEUE_ENTRY.cq_ptr], eax
|
||||
push ebx
|
||||
mov ebx, eax
|
||||
mov eax, esi
|
||||
mov ecx, QUEUE_ALLOC_SIZE / PAGE_SIZE
|
||||
invoke CommitPages
|
||||
pop ebx
|
||||
mov eax, dword [edi + ebx + NVM_QUEUE_ENTRY.cq_ptr]
|
||||
mov edx, eax
|
||||
add eax, CQ_ALLOC_SIZE
|
||||
mov dword [edi + ebx + NVM_QUEUE_ENTRY.sq_ptr], eax
|
||||
|
@ -17,15 +17,15 @@ VS130 = 0x00010300 ; (v1.3.0)
|
||||
VS140 = 0x00010400 ; (v1.4.0)
|
||||
|
||||
NVM_MPS = 0 ; Memory Page Size (2 ^ (12 + MPS))
|
||||
NVM_ASQS = 256 ; Admin Submission Queue Size
|
||||
NVM_ASQS = 64 ; Admin Submission Queue Size
|
||||
NVM_ACQS = NVM_ASQS ; Admin Completion Queue Size
|
||||
LAST_QUEUE_ID = 1 ; Index of the last queue
|
||||
SQ_ENTRIES = NVM_ASQS ; I/O and Admin Submission Queue Size
|
||||
CQ_ENTRIES = NVM_ACQS ; I/O and Admin Completion Queue Size
|
||||
PAGE_SIZE = 4096 shl NVM_MPS ; Use 4KiB pages
|
||||
SUPPORTED_LBADS = 9 ; KolibriOS only supports LBADS of 512, later on we may remove this restriction
|
||||
SQ_ALLOC_SIZE = NVM_ASQS * sizeof.SQ_ENTRY
|
||||
CQ_ALLOC_SIZE = NVM_ACQS * sizeof.CQ_ENTRY
|
||||
SQ_ALLOC_SIZE = 0x1000
|
||||
CQ_ALLOC_SIZE = 0x1000
|
||||
QUEUE_ALLOC_SIZE = SQ_ALLOC_SIZE + CQ_ALLOC_SIZE
|
||||
SIZEOF_SQ_ENTRY = 6 ; log2(sizeof.SQ_ENTRY)
|
||||
SIZEOF_CQ_ENTRY = 4 ; log2(sizeof.CQ_ENTRY)
|
||||
@ -574,8 +574,6 @@ assert sizeof.NSGRANLS = 288
|
||||
assert sizeof.NVMQCMD = 16
|
||||
assert SIZEOF_SQ_ENTRY = 6
|
||||
assert SIZEOF_CQ_ENTRY = 4
|
||||
assert (SQ_ENTRIES * sizeof.SQ_ENTRY) mod PAGE_SIZE = 0
|
||||
assert (CQ_ENTRIES * sizeof.CQ_ENTRY) mod PAGE_SIZE = 0
|
||||
|
||||
; NOTE: DO NOT CHANGE THIS ASSERTION!
|
||||
; If you do decide to change it, you'll have
|
||||
|
Loading…
Reference in New Issue
Block a user