https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eb283043d5967c71445d0…
commit eb283043d5967c71445d03224391f6c022e2bdbc
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun Nov 7 12:17:53 2021 +0100
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Sun Nov 7 14:07:55 2021 +0100
[HALX86] Partly implement HalCalculateScatterGatherListSize
---
hal/halx86/generic/dma.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/hal/halx86/generic/dma.c b/hal/halx86/generic/dma.c
index 76a2e21f76c..f14bbf59fb6 100644
--- a/hal/halx86/generic/dma.c
+++ b/hal/halx86/generic/dma.c
@@ -1173,8 +1173,18 @@ HalCalculateScatterGatherListSize(
OUT PULONG ScatterGatherListSize,
OUT PULONG pNumberOfMapRegisters)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ ULONG NumberOfMapRegisters;
+ ULONG SgSize;
+
+ UNIMPLEMENTED_ONCE;
+
+ NumberOfMapRegisters = PAGE_ROUND_UP(Length) >> PAGE_SHIFT;
+ SgSize = sizeof(SCATTER_GATHER_CONTEXT);
+
+ *ScatterGatherListSize = SgSize;
+ if (pNumberOfMapRegisters) *pNumberOfMapRegisters = NumberOfMapRegisters;
+
+ return STATUS_SUCCESS;
}
NTSTATUS