All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Mini-os get_current() fixup
@ 2007-10-15 16:23 Samuel Thibault
  2007-10-15 16:30 ` Samuel Thibault
       [not found] ` <20071018145006.GM4003@implementation.uk.xensource.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Samuel Thibault @ 2007-10-15 16:23 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

Hi,

I'm currently playing with mini-os, and noticed bogus code:

0x00019301 <do_page_fault+81>:  mov    $0x1,%ecx
0x00019306 <do_page_fault+86>:  mov    $0xffffe000,%eax
0x0001930b <do_page_fault+91>:  mov    %ecx,0x32980
0x00019311 <do_page_fault+97>:  and    %esp,%edx
0x00019313 <do_page_fault+99>:  mov    (%edx),%ecx
0x00019315 <do_page_fault+101>: 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

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 623 bytes --]

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;
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-24 13:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-15 16:23 [PATCH] Mini-os get_current() fixup Samuel Thibault
2007-10-15 16:30 ` Samuel Thibault
     [not found] ` <20071018145006.GM4003@implementation.uk.xensource.com>
2007-10-24 13:31   ` [PATCH] Mini-os xenbus wait fixup Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.