WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [Mini-OS] Optimize get_current()

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [Mini-OS] Optimize get_current()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Nov 2007 13:50:09 -0800
Delivery-date: Fri, 23 Nov 2007 13:50:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1195834983 0
# Node ID 2215f4f6f0f225c8b7d377f376ca3fa4d5d6d742
# Parent  f28d36628de80b05fcab24094684d95a17026db1
[Mini-OS] Optimize get_current()

Let gcc perform the computation with SP itself, leading to yet better
code.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxx>
---
 extras/mini-os/include/x86/arch_sched.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -r f28d36628de8 -r 2215f4f6f0f2 extras/mini-os/include/x86/arch_sched.h
--- a/extras/mini-os/include/x86/arch_sched.h   Fri Nov 23 16:22:36 2007 +0000
+++ b/extras/mini-os/include/x86/arch_sched.h   Fri Nov 23 16:23:03 2007 +0000
@@ -7,10 +7,11 @@ static inline struct thread* get_current
 {
     struct thread **current;
 #ifdef __i386__    
-    __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
+    register unsigned long sp asm("esp");
 #else
-    __asm__("andq %%rsp,%0; ":"=r" (current) : "0" (~8191UL));
+    register unsigned long sp asm("rsp");
 #endif 
+    current = (void *)(sp & ~8191UL);
     return *current;
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [Mini-OS] Optimize get_current(), Xen patchbot-unstable <=