From owner-freebsd-current Fri Dec 8 13:29:24 2000 From owner-freebsd-current@FreeBSD.ORG Fri Dec 8 13:29:23 2000 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from earth.backplane.com (placeholder-dcat-1076843399.broadbandoffice.net [64.47.83.135]) by hub.freebsd.org (Postfix) with ESMTP id 4350937B400; Fri, 8 Dec 2000 13:29:23 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id eB8LTMM22955; Fri, 8 Dec 2000 13:29:22 -0800 (PST) (envelope-from dillon) Date: Fri, 8 Dec 2000 13:29:22 -0800 (PST) From: Matt Dillon Message-Id: <200012082129.eB8LTMM22955@earth.backplane.com> To: John Baldwin Cc: Julian Elischer , current@FreeBSD.ORG Subject: Re: RE: __asm help.. References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :As long as gcc uses %ebp to address local variables and functoin parameters :rather than %esp you should be fine. %esp will be preserved, but if %esp is :for some odd reason used to address a variable during the C code, you are hosed. I strongly recommend against making assumptions about GCC's use of %ebp vs %esp... not if you want the __asm code to survive the GCC optimizer! :Just use foo = save_intr(); disable_intr(); .. restore_intr() for now. If you :want to save the 2 instructions so badly, then you should probably be writing :the whole chunk in assembly. Getting it correct first and optimizing later is :more sane than getting correctness and optimization at the same time and not :knowing which one your bugs are coming from. : :John Baldwin -- http://www.FreeBSD.org/~jhb/ Yah, gotta agree there. The only thing that matters, Julian, are memory accesses. The number of instructions you use is irrelevant. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message