RE: [PATCH]: ACPI: preserve the ebx value in acpi_copy_wakeup_routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



According to the SYSTEM V APPLICATION BINARY INTERFACE,
Intel386 Architecture:
"ecx and edx: Scratch registers have no specified role in the standard calling
sequence. Functions do not have to preserve their values for the
caller."

Best regards,
Zhang.Rui(Ray)

 
-----Original Message-----
From: Pavel Machek [mailto:pavel@xxxxxx] 
Sent: 2007年6月1日 18:17
To: Zhang, Rui
Cc: linux-acpi@xxxxxxxxxxxxxxx; lenb@xxxxxxxxxx; Tian, Kevin
Subject: Re: [PATCH]: ACPI: preserve the ebx value in acpi_copy_wakeup_routine

Hi!

> From: Tian Kevin <kevin.tian@xxxxxxxxx>
> 
> Register %ebx serves as the "global offset table base register"
> for position-independent code. For absolute code, %ebx serves
> as a local register and has no specified role in the function
> calling sequence. In either case, a function must preserve the
> register value for the caller.
> 
> acpi_copy_wakeup_routine overrides %ebx without saving it,
> this may corrupt the called data.
> 
> Kevin found that most time the value of Sx is saved in %esi,
> however sometimes compiler also uses %ebx. When this happens,
> suspends fails since sleep value in ebx is changed by
> acpi_copy_wakeup_routine.
> 
> The same funtion in X86_64 doesn't have this problem.
> 
> Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>

Looks okay to me. That routine also corrupts ecx and edx, hopefully
that's okay?
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux