From owner-cvs-all@FreeBSD.ORG Fri Dec 12 23:41:15 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F0F116A4CE; Fri, 12 Dec 2003 23:41:15 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A19A43D1D; Fri, 12 Dec 2003 23:41:13 -0800 (PST) (envelope-from wpaul@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hBD7fDXJ002935; Fri, 12 Dec 2003 23:41:13 -0800 (PST) (envelope-from wpaul@repoman.freebsd.org) Received: (from wpaul@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hBD7fCDk002934; Fri, 12 Dec 2003 23:41:12 -0800 (PST) (envelope-from wpaul) Message-Id: <200312130741.hBD7fCDk002934@repoman.freebsd.org> From: Bill Paul Date: Fri, 12 Dec 2003 23:41:12 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/compat/ndis ntoskrnl_var.h subr_ndis.c subr_ntoskrnl.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2003 07:41:15 -0000 wpaul 2003/12/12 23:41:12 PST FreeBSD src repository Modified files: sys/compat/ndis ntoskrnl_var.h subr_ndis.c subr_ntoskrnl.c Log: subr_ndis.c: - fix ndis_time() so that it returns a time based on the proper epoch (wacky though it may be) - implement NdisInitializeString() and NdisFreeString(), and add stub for NdisMRemoveMiniport() ntoskrnl_var.h: - add missing member to the general_lookaside struct (gl_listentry) subr_ntoskrnl.c: - Fix arguments to the interlocked push/pop routines: 'head' is an slist_header *, not an slist_entry * - Kludge up _fastcall support for the push/pop routines. The _fastcall convention is similar to _stdcall, except the first two available DWORD-sized arguments are passed in %ecx and %edx, respectively. One kludge for this __attribute__ ((regparm(3))), however this isn't entirely right, as it assumes %eax, %ecx and %edx will be used (regparm(2) assumes %eax and %edx). Another kludge is to declare the two fastcall-ed args as local register variables and explicitly assign them to %ecx and %edx, but experimentation showed that gcc would not guard %ecx and %edx against being clobbered. Thus, I came up with a 3rd kludge, which is to use some inline assembly of the form: void *arg1; void *arg2; __asm__("movl %%ecx, %%ecx" : "=c" (arg1)); __asm__("movl %%edx, %%edx" : "=d" (arg2)); This lets gcc know that we're going to reference %ecx and %edx and that it should make an effort not to let it get trampled. This wastes an instruction (movl %reg, %reg is a no-op) but insures proper behavior. It's possible there's a better way to do this though: this is the first time I've used inline assembler in this fashion. The above fixes to ntoskrnl_var.h an subr_ntoskrnl.c make lookaside lists work for the two drivers I have that use them, one of which is an NDIS 5.0 miniport and another which is 5.1. Revision Changes Path 1.2 +8 -0 src/sys/compat/ndis/ntoskrnl_var.h 1.4 +46 -1 src/sys/compat/ndis/subr_ndis.c 1.3 +49 -32 src/sys/compat/ndis/subr_ntoskrnl.c