Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Aug 2002 09:16:08 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Mitsuru IWASAKI <iwasaki@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   RE: cvs commit: src/sys/i386/acpica acpi_wakeup.c
Message-ID:  <XFMail.20020801091608.jhb@FreeBSD.org>
In-Reply-To: <200208010948.g719m2DZ068561@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 01-Aug-2002 Mitsuru IWASAKI wrote:
> iwasaki     2002/08/01 02:48:02 PDT
> 
>   Modified files:
>     sys/i386/acpica      acpi_wakeup.c 
>   Log:
>   Fix a bug about stack manipulation at ACPI wakeup.
>   This should avoid kernel panic on kernel compiled w/o
>   NO_CPU_COPTFLAGS.
>   
>   Suggested by:   optimized code by -mcpu=pentiumpro

Sorry I couldn't help you with this earlier.  Thanks for fixing it!
I have a couple of questions about acpu_restorecpu():

1) Why bother moving r_eax into %eax when you zero %eax anyways
   right before returning?
2) To make the code perhaps a bit easier to follow (esp. to explain
   why you had to add the popl) maybe you could remove the extra
   pop and change the last 3 lines to look like this:

        movl    ret_addr,%eax   # override      \n\
        movl    %eax,(%esp)     # ret addr      \n\
        xorl    %eax,%eax                       \n\
        ret                                     \n\

This also uses one less memory access although that isn't that
important.  You could also use 'addl $4,%esp' instead of the pop
if you wanted.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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