Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Dec 2000 13:29:22 -0800 (PST)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Julian Elischer <julian@elischer.org>, current@FreeBSD.ORG
Subject:   Re: RE: __asm help..
Message-ID:  <200012082129.eB8LTMM22955@earth.backplane.com>
References:   <XFMail.001208104618.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
: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 <jhb@FreeBSD.org> -- 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




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