From owner-freebsd-net@FreeBSD.ORG Mon Nov 15 13:14:42 2010 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D06D41065694 for ; Mon, 15 Nov 2010 13:14:42 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6AC288FC24 for ; Mon, 15 Nov 2010 13:14:42 +0000 (UTC) Received: by wyb36 with SMTP id 36so2538519wyb.13 for ; Mon, 15 Nov 2010 05:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=Id/7Efwjd5lnlEYG5+isb6LAPnwA8gipycPd/ubKSyM=; b=f/g9DCTXfTAqMEg+z4qmo3DzbiEGT6YKCyRRcvdRn8GWr119eS9t8DD0aNK9XiD1j3 4fgLj8t59dRxAUL75IYHMgAw9GyHYdYp6lblhj6VyGoAd9ewtMKFtHXfY6AfaDcId+p8 7ZxlAXlYXgD441/OXuSTp5ItQWB1/G49n1En0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=qEAqro5ui5VkMFxL2IiI87d74sIDzwqrbRXHtlk8mmXzo0s9mU+TStUnQagQPqaUMb DHxNNwHFDAutO3yexyji+b2Fc0k7uf5TzZpcp+dDDawD1647bHyPeOEs4Cj+vlSa6ROY jPtMM8LClDsj1/NKCHmFWVUh1w0frfqlPARxc= MIME-Version: 1.0 Received: by 10.216.155.68 with SMTP id i46mr4936670wek.92.1289826881489; Mon, 15 Nov 2010 05:14:41 -0800 (PST) Received: by 10.216.234.82 with HTTP; Mon, 15 Nov 2010 05:14:41 -0800 (PST) Date: Mon, 15 Nov 2010 13:14:41 +0000 Message-ID: From: Paul B Mahol To: net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: ndis: fix panic on i386 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 13:14:42 -0000 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),