mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2025-01-18 03:16:09 +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
|
xor ebx, ebx
|
||||||
|
|
||||||
.init_queues:
|
.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
|
invoke KernelAlloc, QUEUE_ALLOC_SIZE
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .exit_fail
|
jz .exit_fail
|
||||||
mov dword [edi + ebx + NVM_QUEUE_ENTRY.cq_ptr], eax
|
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
|
mov edx, eax
|
||||||
add eax, CQ_ALLOC_SIZE
|
add eax, CQ_ALLOC_SIZE
|
||||||
mov dword [edi + ebx + NVM_QUEUE_ENTRY.sq_ptr], eax
|
mov dword [edi + ebx + NVM_QUEUE_ENTRY.sq_ptr], eax
|
||||||
|
@ -17,15 +17,15 @@ VS130 = 0x00010300 ; (v1.3.0)
|
|||||||
VS140 = 0x00010400 ; (v1.4.0)
|
VS140 = 0x00010400 ; (v1.4.0)
|
||||||
|
|
||||||
NVM_MPS = 0 ; Memory Page Size (2 ^ (12 + MPS))
|
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
|
NVM_ACQS = NVM_ASQS ; Admin Completion Queue Size
|
||||||
LAST_QUEUE_ID = 1 ; Index of the last queue
|
LAST_QUEUE_ID = 1 ; Index of the last queue
|
||||||
SQ_ENTRIES = NVM_ASQS ; I/O and Admin Submission Queue Size
|
SQ_ENTRIES = NVM_ASQS ; I/O and Admin Submission Queue Size
|
||||||
CQ_ENTRIES = NVM_ACQS ; I/O and Admin Completion Queue Size
|
CQ_ENTRIES = NVM_ACQS ; I/O and Admin Completion Queue Size
|
||||||
PAGE_SIZE = 4096 shl NVM_MPS ; Use 4KiB pages
|
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
|
SUPPORTED_LBADS = 9 ; KolibriOS only supports LBADS of 512, later on we may remove this restriction
|
||||||
SQ_ALLOC_SIZE = NVM_ASQS * sizeof.SQ_ENTRY
|
SQ_ALLOC_SIZE = 0x1000
|
||||||
CQ_ALLOC_SIZE = NVM_ACQS * sizeof.CQ_ENTRY
|
CQ_ALLOC_SIZE = 0x1000
|
||||||
QUEUE_ALLOC_SIZE = SQ_ALLOC_SIZE + CQ_ALLOC_SIZE
|
QUEUE_ALLOC_SIZE = SQ_ALLOC_SIZE + CQ_ALLOC_SIZE
|
||||||
SIZEOF_SQ_ENTRY = 6 ; log2(sizeof.SQ_ENTRY)
|
SIZEOF_SQ_ENTRY = 6 ; log2(sizeof.SQ_ENTRY)
|
||||||
SIZEOF_CQ_ENTRY = 4 ; log2(sizeof.CQ_ENTRY)
|
SIZEOF_CQ_ENTRY = 4 ; log2(sizeof.CQ_ENTRY)
|
||||||
@ -574,8 +574,6 @@ assert sizeof.NSGRANLS = 288
|
|||||||
assert sizeof.NVMQCMD = 16
|
assert sizeof.NVMQCMD = 16
|
||||||
assert SIZEOF_SQ_ENTRY = 6
|
assert SIZEOF_SQ_ENTRY = 6
|
||||||
assert SIZEOF_CQ_ENTRY = 4
|
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!
|
; NOTE: DO NOT CHANGE THIS ASSERTION!
|
||||||
; If you do decide to change it, you'll have
|
; If you do decide to change it, you'll have
|
||||||
|
Loading…
Reference in New Issue
Block a user