From: Samuel Thibault Subject: [PATCH] Mini-os get_current() fixup Date: Mon, 15 Oct 2007 17:23:32 +0100 Message-ID: <20071015162332.GB26450@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I'm currently playing with mini-os, and noticed bogus code: 0x00019301 : mov $0x1,%ecx 0x00019306 : mov $0xffffe000,%eax 0x0001930b : mov %ecx,0x32980 0x00019311 : and %esp,%edx 0x00019313 : mov (%edx),%ecx 0x00019315 : mov (%ecx),%eax Which is supposed to approximately correspond to get_current(). It happens that %edx is never set to 0xfffff000. The attached patch fixes that. Samuel --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch diff -r 3746b3d4f301 extras/mini-os/include/x86/arch_sched.h --- a/extras/mini-os/include/x86/arch_sched.h Thu Feb 22 15:26:21 2007 +0000 +++ b/extras/mini-os/include/x86/arch_sched.h Mon Oct 15 17:23:01 2007 +0100 @@ -7,9 +7,9 @@ static inline struct thread* get_current { struct thread **current; #ifdef __i386__ - __asm__("andl %%esp,%0; ":"=r" (current) : "r" (~8191UL)); + __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL)); #else - __asm__("andq %%rsp,%0; ":"=r" (current) : "r" (~8191UL)); + __asm__("andq %%rsp,%0; ":"=r" (current) : "0" (~8191UL)); #endif return *current; } --Kj7319i9nmIyA2yE Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Kj7319i9nmIyA2yE--