All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@xensource.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Mini-os get_current() fixup
Date: Mon, 15 Oct 2007 17:23:32 +0100	[thread overview]
Message-ID: <20071015162332.GB26450@implementation.uk.xensource.com> (raw)

[-- 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

             reply	other threads:[~2007-10-15 16:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 16:23 Samuel Thibault [this message]
2007-10-15 16:30 ` [PATCH] Mini-os get_current() fixup Samuel Thibault
     [not found] ` <20071018145006.GM4003@implementation.uk.xensource.com>
2007-10-24 13:31   ` [PATCH] Mini-os xenbus wait fixup Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071015162332.GB26450@implementation.uk.xensource.com \
    --to=samuel.thibault@xensource.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.