Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Nov 2010 13:14:41 +0000
From:      Paul B Mahol <onemda@gmail.com>
To:        net@freebsd.org
Subject:   ndis: fix panic on i386
Message-ID:  <AANLkTinExs4dtWqC8ktmoxm6a2Nqh6qfv-FecP3o1VY7@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

Following patch fix panic on i386 for drivers using such functions.

Those two functions take 64-bit variable(s) for their arguments.
On i386 that takes additional 32-bit variable per argument.
This is required so that windrv_wrap() can correctly wrap function that
miniport driver calls with stdcall convention.
Similar explanation is provided in subr_ndis.c for other functions.
On amd64 we do not use these numbers.

diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c
index f169de5..0335561 100644
--- a/sys/compat/ndis/subr_ntoskrnl.c
+++ b/sys/compat/ndis/subr_ntoskrnl.c
@@ -4212,8 +4212,8 @@ image_patch_table ntoskrnl_functbl[] = {
 	IMPORT_FFUNC(ExInterlockedAddLargeStatistic, 2),
 	IMPORT_SFUNC(IoAllocateMdl, 5),
 	IMPORT_SFUNC(IoFreeMdl, 1),
-	IMPORT_SFUNC(MmAllocateContiguousMemory, 2),
-	IMPORT_SFUNC(MmAllocateContiguousMemorySpecifyCache, 5),
+	IMPORT_SFUNC(MmAllocateContiguousMemory, 2 + 1),
+	IMPORT_SFUNC(MmAllocateContiguousMemorySpecifyCache, 5 + 3),
 	IMPORT_SFUNC(MmFreeContiguousMemory, 1),
 	IMPORT_SFUNC(MmFreeContiguousMemorySpecifyCache, 3),
 	IMPORT_SFUNC_MAP(MmGetPhysicalAddress, pmap_kextract, 1),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinExs4dtWqC8ktmoxm6a2Nqh6qfv-FecP3o1VY7>