Subject: port-i386/21558: cpu_switch() allways returns value 0
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ups@stups.com>
List: netbsd-bugs
Date: 05/13/2003 01:28:31
>Number: 21558
>Category: port-i386
>Synopsis: cpu_switch() allways returns value 0
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-i386-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue May 13 01:29:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Stephan Uphoff
>Release: 1.6T
>Organization:
>Environment:
NetBSD giant 1.6T NetBSD 1.6T (GIANT) #0: Mon May 12 20:17:34 EDT 2003 ups@giant:/usr/home/ups/sources/build/makeobjectdirprefix/usr/home/ups/sources/src/sys/arch/i386/compile/GIANT i386
>Description:
The return value is written too early to the eax register.
The register is overwritten by function calls later in the code.
( The last function called is Xspllower() which sets the eax register to 0)
>How-To-Repeat:
>Fix:
Use the ebx register to hold the value until
it is save to store it to the eax register.
RCS file: /cvsroot/src/sys/arch/i386/i386/locore.S,v
retrieving revision 1.8
diff -r1.8 locore.S
1856c1856
< movl $1, %eax
---
> movl $1, %ebx
1964c1964
< xor %eax,%eax
---
> xorl %ebx,%ebx
1974c1974,1975
<
---
>
> movl %ebx,%eax
>Release-Note:
>Audit-Trail:
>Unformatted: